68
|
1 |
/*
|
|
2 |
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef GSWATCHDOG_INTERFACE_H
|
|
21 |
#define GSWATCHDOG_INTERFACE_H
|
|
22 |
|
|
23 |
// System includes
|
|
24 |
#include <e32base.h>
|
|
25 |
|
|
26 |
#ifdef _DEBUG
|
|
27 |
#define GS_ENABLE_WATCH_DOG
|
|
28 |
#endif
|
|
29 |
|
|
30 |
|
|
31 |
// CONSTANTS
|
|
32 |
|
|
33 |
// CLASS DECLARATION
|
|
34 |
|
|
35 |
/**
|
|
36 |
* MGSWatchDog is responsible for quarantining plugins and updating blacklist
|
|
37 |
* for crashing GS plugins. This is the class responsible for keeping GS
|
|
38 |
* application functional even if some plugin to panics all the time.
|
|
39 |
*
|
|
40 |
* This is the interface for GSWatchDog. Client has no need to know the actual
|
|
41 |
* implementation as it is owned by GS application.
|
|
42 |
*
|
|
43 |
* @since Series60_3.2
|
|
44 |
*/
|
|
45 |
class MGSWatchDog
|
|
46 |
{
|
|
47 |
public: // New
|
|
48 |
|
|
49 |
/**
|
|
50 |
* Adds plugin to quarantine. In case GS crashes, quarantined plugin
|
|
51 |
* will be blacklisted so it is not loaded in next GS run. Same plugin
|
|
52 |
* can be quarantined multiple times or even have several uid instances
|
|
53 |
* in quarantine if needed as long as all these are removed
|
|
54 |
* correspondingly.
|
|
55 |
*
|
|
56 |
* NOTE: Plugin must ALWAYS be removed from quarantine after plugin's
|
|
57 |
* function execution.
|
|
58 |
* 1. QuarantineL().
|
|
59 |
* 2. Call quarantined plugin function.
|
|
60 |
* 3. RemoveFromQuarantineL().
|
|
61 |
*
|
|
62 |
* @param aPluginUid uid of the quarantined plugin.
|
|
63 |
*/
|
|
64 |
virtual void QuarantineL( TUid aPluginUid ) = 0;
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Removes plugin from quarantine. In case plugin is not removed from
|
|
68 |
* quarantine before GS exits, the plugin will be blacklisted during
|
|
69 |
* next GS startup.
|
|
70 |
*
|
|
71 |
* @param aPluginUid uid of the plugin to be removed from quarantine.
|
|
72 |
*/
|
|
73 |
virtual void RemoveFromQuarantineL( TUid aPluginUid ) = 0;
|
|
74 |
|
|
75 |
/**
|
|
76 |
* @return ETrue if GS exited cleanly last time.
|
|
77 |
* EFalse if GS crashed during last execution.
|
|
78 |
*/
|
|
79 |
virtual TBool WasCleanExitL() = 0;
|
|
80 |
|
|
81 |
/**
|
|
82 |
* This must be called in all the cases GS exits normally. If GS panics,
|
|
83 |
* this will not be called resulting in banning of all quarantined
|
|
84 |
* plugins.Increments iRunsAfterCrash counter for blacklisted plugins.
|
|
85 |
* Sets iGSAppRunning to EFalse.
|
|
86 |
*/
|
|
87 |
virtual void ReportCleanExitL() = 0;
|
|
88 |
|
|
89 |
/**
|
|
90 |
* Checks if plugin is in blacklist. This can be used to determine if
|
|
91 |
* plugin should be loaded.
|
|
92 |
*
|
|
93 |
* @return ETrue in case plugin is in blacklist and should not be loaded.
|
|
94 |
* EFalse in case plugin should not be loaded
|
|
95 |
*/
|
|
96 |
virtual TBool IsInBlackList( TUid aPluginUid ) = 0;
|
|
97 |
|
|
98 |
};
|
|
99 |
|
|
100 |
#endif // GSWATCHDOG_INTERFACE_H
|
|
101 |
// End of File
|