00001 // -*- c++ -*- 00002 00003 // generated code -- do not edit 00004 00005 #ifndef __WATCHDOG_H__ 00006 #define __WATCHDOG_H__ 00007 00008 #include <e32base.h> 00009 #include <e32math.h> 00010 #include <sysutil.h> 00011 #include <w32std.h> 00012 #include "epoc-time.h" 00013 #include "timer_observer.h" 00014 #include "process_handle_observer.h" 00015 #include "common/assertions.h" 00016 #include "common/logging.h" 00017 #include "common/panic.h" 00018 00019 class CWatchdog : 00020 public CBase, 00021 public MTimerObserver, 00022 public MProcessHandleObserver 00023 { 00024 public: 00025 00026 static CWatchdog *NewLC(CActiveSchedulerWait &aLoop); 00027 00028 static CWatchdog *NewL(CActiveSchedulerWait &aLoop); 00029 00030 private: 00031 00032 CWatchdog(CActiveSchedulerWait &aLoop); 00033 00034 void ConstructL(); 00035 00036 CActiveSchedulerWait &iLoop; 00037 00038 public: 00039 00040 ~CWatchdog(); 00041 00042 void Start(); 00043 00044 private: 00045 00046 void UpdateAppStartTime(); 00047 00048 void WaitWhile(TInt aSecs); 00049 00050 void HandleMinorError(); 00051 00052 void ObserveProcess(); 00053 00054 void StartApp(); 00055 00056 void FindApp(); 00057 00058 void FindAppByPattern(); 00059 00060 void CloseProcess(); 00061 00062 void HandleTimerEvent(TInt errCode); 00063 00064 void HandleProcessHandleEvent(TInt errCode); 00065 00066 void ExitWatchdog(TInt errCode, char const *errText); 00067 00068 void Cancel(); 00069 00070 TBool DiedQuickly(); 00071 00072 CTimerAo *iTimerAo; 00073 00074 CProcessHandleObserver *iLogonAo; 00075 00076 RWsSession iWsSession; 00077 00078 TBool iWsSessionOpen; 00079 00080 RFs iFs; 00081 00082 TBool iFsOpen; 00083 00084 RProcess iProcess; 00085 00086 TBool iProcessOpen; 00087 00088 TTime iAppStartTime; 00089 00090 TInt iNumMinorErrors; 00091 00092 TInt64 iRandSeed; 00093 }; 00094 00095 #endif // __WATCHDOG_H__ 00096 00097 /** 00098 Copyright 2008 Helsinki Institute for Information Technology (HIIT) 00099 and Tero Hasu <tero.hasu@hut.fi>. All rights reserved. 00100 00101 This license applies: 00102 00103 This program is free software; you can redistribute it and/or modify 00104 it under the terms of the GNU General Public License as published by 00105 the Free Software Foundation; either version 2 of the License, or 00106 (at your option) any later version. 00107 00108 This program is distributed in the hope that it will be useful, 00109 but WITHOUT ANY WARRANTY; without even the implied warranty of 00110 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00111 GNU General Public License for more details. 00112 00113 You should have received a copy of the GNU General Public License 00114 along with this program; if not, write to the Free Software 00115 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00116 00117 Alternatively, this license applies: 00118 00119 Permission is hereby granted, free of charge, to any person 00120 obtaining a copy of this software and associated documentation files 00121 (the "Software"), to deal in the Software without restriction, 00122 including without limitation the rights to use, copy, modify, merge, 00123 publish, distribute, sublicense, and/or sell copies of the Software, 00124 and to permit persons to whom the Software is furnished to do so, 00125 subject to the following conditions: 00126 00127 The above copyright notice and this permission notice shall be 00128 included in all copies or substantial portions of the Software. 00129 00130 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00131 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00132 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00133 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 00134 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 00135 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00136 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 00137 SOFTWARE. 00138 */
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:57 2011 by Doxygen 1.6.1