77
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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: Main classes for Out of Memory Monitor.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "oommemorymonitorserver.h"
|
|
19 |
#include "oommonitorclientserver.h"
|
|
20 |
#include "oommemorymonitorsession.h"
|
|
21 |
#include "oommemorymonitor.h"
|
|
22 |
#include "OomTraces.h"
|
|
23 |
|
|
24 |
#ifdef CLIENT_REQUEST_QUEUE
|
|
25 |
CMemoryMonitorServer* CMemoryMonitorServer::NewL(COomClientRequestQueue& aQueue)
|
|
26 |
#else
|
|
27 |
CMemoryMonitorServer* CMemoryMonitorServer::NewL(CMemoryMonitor& aMonitor)
|
|
28 |
#endif
|
|
29 |
{
|
|
30 |
// FUNC_LOG;
|
|
31 |
|
|
32 |
#ifdef CLIENT_REQUEST_QUEUE
|
|
33 |
CMemoryMonitorServer* self=new(ELeave) CMemoryMonitorServer(aQueue);
|
|
34 |
#else
|
|
35 |
CMemoryMonitorServer* self=new(ELeave) CMemoryMonitorServer(aMonitor);
|
|
36 |
#endif
|
|
37 |
CleanupStack::PushL(self);
|
|
38 |
self->ConstructL();
|
|
39 |
CleanupStack::Pop(self);
|
|
40 |
return self;
|
|
41 |
}
|
|
42 |
|
|
43 |
CMemoryMonitorServer::~CMemoryMonitorServer()
|
|
44 |
{
|
|
45 |
// FUNC_LOG;
|
|
46 |
}
|
|
47 |
|
|
48 |
#ifdef CLIENT_REQUEST_QUEUE
|
|
49 |
CMemoryMonitorServer::CMemoryMonitorServer(COomClientRequestQueue& aQueue)
|
|
50 |
:CServer2(CActive::EPriorityStandard), iQueue(aQueue)
|
|
51 |
#else
|
|
52 |
CMemoryMonitorServer::CMemoryMonitorServer(CMemoryMonitor& aMonitor)
|
|
53 |
:CServer2(CActive::EPriorityStandard), iMonitor(aMonitor)
|
|
54 |
#endif
|
|
55 |
{
|
|
56 |
|
|
57 |
}
|
|
58 |
|
|
59 |
void CMemoryMonitorServer::ConstructL()
|
|
60 |
{
|
|
61 |
|
|
62 |
}
|
|
63 |
|
|
64 |
CSession2* CMemoryMonitorServer::NewSessionL(const TVersion& /*aVersion*/, const RMessage2& /*aMessage*/) const
|
|
65 |
{
|
|
66 |
return new(ELeave) CMemoryMonitorSession();
|
|
67 |
}
|
|
68 |
|
|
69 |
TInt CMemoryMonitorServer::RunError(TInt aError)
|
|
70 |
{
|
|
71 |
return KErrNone; // handled the error fully
|
|
72 |
}
|
|
73 |
|
|
74 |
#ifdef CLIENT_REQUEST_QUEUE
|
|
75 |
COomClientRequestQueue& CMemoryMonitorServer::ClientRequestQueue()
|
|
76 |
{
|
|
77 |
FUNC_LOG;
|
|
78 |
|
|
79 |
return iQueue;
|
|
80 |
}
|
|
81 |
#else
|
|
82 |
CMemoryMonitor& CMemoryMonitorServer::Monitor()
|
|
83 |
{
|
|
84 |
|
|
85 |
}
|
|
86 |
#endif
|
|
87 |
|
|
88 |
#ifndef CLIENT_REQUEST_QUEUE
|
|
89 |
void CMemoryMonitorServer::CloseAppsFinished(TInt aBytesFree, TBool aMemoryGood)
|
|
90 |
{
|
|
91 |
|
|
92 |
}
|
|
93 |
#endif
|