|
1 /* |
|
2 * Copyright (c) 2009 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: Low memory observer for havester server |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "mdsoomplugin.h" |
|
20 #include "harvesterlog.h" |
|
21 #include "harvestercommon.h" |
|
22 |
|
23 |
|
24 CMdSOomPlugin::CMdSOomPlugin() |
|
25 { |
|
26 WRITELOG("CMdSOomPlugin::CMdSOomPlugin()"); |
|
27 } |
|
28 |
|
29 |
|
30 CMdSOomPlugin::~CMdSOomPlugin() |
|
31 { |
|
32 iOomMsgQueue.Close(); |
|
33 } |
|
34 |
|
35 CMdSOomPlugin* CMdSOomPlugin::NewL() |
|
36 { |
|
37 CMdSOomPlugin* self = new (ELeave) CMdSOomPlugin(); |
|
38 CleanupStack::PushL(self); |
|
39 self->ConstructL(); |
|
40 CleanupStack::Pop(self); |
|
41 return self; |
|
42 } |
|
43 |
|
44 void CMdSOomPlugin::ConstructL() |
|
45 { |
|
46 COomMonitorPlugin::ConstructL(); |
|
47 |
|
48 User::LeaveIfError( iOomMsgQueue.CreateGlobal(KHarvesterOomQueue, 32) ); |
|
49 } |
|
50 |
|
51 |
|
52 void CMdSOomPlugin::FreeRam() |
|
53 { |
|
54 WRITELOG("CMdSOomPlugin::FreeRam() - start"); |
|
55 |
|
56 iOomMsgQueue.Send( TMdsOomFreeRam ); |
|
57 |
|
58 WRITELOG("CMdSOomPlugin::FreeRam() - end"); |
|
59 } |
|
60 |
|
61 void CMdSOomPlugin::MemoryGood() |
|
62 { |
|
63 WRITELOG("CMdSOomPlugin::MemoryGood - start"); |
|
64 |
|
65 iOomMsgQueue.Send( TMdsOomMemoryGood ); |
|
66 |
|
67 WRITELOG("CMdSOomPlugin::MemoryGood - end "); |
|
68 } |
|
69 |
|
70 void CMdSOomPlugin::ExtensionInterface(TUid aInterfaceId, TAny*& aImplementation) |
|
71 { |
|
72 COomMonitorPlugin::ExtensionInterface(aInterfaceId, aImplementation); |
|
73 } |
|
74 |
|
75 |