|
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 // CONSTANTS |
|
27 |
|
28 // CLASS DECLARATION |
|
29 |
|
30 /** |
|
31 * MGSWatchDog is responsible for quarantining plugins and updating blacklist |
|
32 * for crashing GS plugins. This is the class responsible for keeping GS |
|
33 * application functional even if some plugin to panics all the time. |
|
34 * |
|
35 * This is the interface for GSWatchDog. Client has no need to know the actual |
|
36 * implementation as it is owned by GS application. |
|
37 * |
|
38 * @since Series60_3.2 |
|
39 */ |
|
40 class MGSWatchDog |
|
41 { |
|
42 public: // New |
|
43 |
|
44 /** |
|
45 * Adds plugin to quarantine. In case GS crashes, quarantined plugin |
|
46 * will be blacklisted so it is not loaded in next GS run. Same plugin |
|
47 * can be quarantined multiple times or even have several uid instances |
|
48 * in quarantine if needed as long as all these are removed |
|
49 * correspondingly. |
|
50 * |
|
51 * NOTE: Plugin must ALWAYS be removed from quarantine after plugin's |
|
52 * function execution. |
|
53 * 1. QuarantineL(). |
|
54 * 2. Call quarantined plugin function. |
|
55 * 3. RemoveFromQuarantineL(). |
|
56 * |
|
57 * @param aPluginUid uid of the quarantined plugin. |
|
58 */ |
|
59 virtual void QuarantineL( TUid aPluginUid ) = 0; |
|
60 |
|
61 /** |
|
62 * Removes plugin from quarantine. In case plugin is not removed from |
|
63 * quarantine before GS exits, the plugin will be blacklisted during |
|
64 * next GS startup. |
|
65 * |
|
66 * @param aPluginUid uid of the plugin to be removed from quarantine. |
|
67 */ |
|
68 virtual void RemoveFromQuarantineL( TUid aPluginUid ) = 0; |
|
69 |
|
70 /** |
|
71 * @return ETrue if GS exited cleanly last time. |
|
72 * EFalse if GS crashed during last execution. |
|
73 */ |
|
74 virtual TBool WasCleanExitL() = 0; |
|
75 |
|
76 /** |
|
77 * This must be called in all the cases GS exits normally. If GS panics, |
|
78 * this will not be called resulting in banning of all quarantined |
|
79 * plugins.Increments iRunsAfterCrash counter for blacklisted plugins. |
|
80 * Sets iGSAppRunning to EFalse. |
|
81 */ |
|
82 virtual void ReportCleanExitL() = 0; |
|
83 |
|
84 /** |
|
85 * Checks if plugin is in blacklist. This can be used to determine if |
|
86 * plugin should be loaded. |
|
87 * |
|
88 * @return ETrue in case plugin is in blacklist and should not be loaded. |
|
89 * EFalse in case plugin should not be loaded |
|
90 */ |
|
91 virtual TBool IsInBlackList( TUid aPluginUid ) = 0; |
|
92 |
|
93 }; |
|
94 |
|
95 #endif // GSWATCHDOG_INTERFACE_H |
|
96 // End of File |