sysresmonitoring/oommonitor/src/oommonitorplugin.cpp
branchRCL_3
changeset 4 0fdb7f6b0309
parent 0 2e3d3ce01487
child 12 7645e9ce10dc
--- a/sysresmonitoring/oommonitor/src/oommonitorplugin.cpp	Tue Feb 02 10:12:00 2010 +0200
+++ b/sysresmonitoring/oommonitor/src/oommonitorplugin.cpp	Fri Feb 19 22:58:54 2010 +0200
@@ -16,26 +16,33 @@
 */
 
 
+#include <apgwgnam.h>
 #include "oommonitorplugin.h"
-#include "oommonitor.h"
-#include <apgwgnam.h>
+#include "oommemorymonitor.h"
+#include "oomtraces.h"
 
 // TLS is used to store the CMemoryMonitor pointer, CMemoryMonitor
 // being the main object in the OOM monitor thread. This allows
 // plugins to access the CMemoryMonitor object easily.
 EXPORT_C void SetMemoryMonitorTls(CMemoryMonitor* aMonitor)
     {
+    FUNC_LOG;
+
     Dll::SetTls(aMonitor);
     }
 
 CMemoryMonitor* MemoryMonitorTls()
     {
+    FUNC_LOG;
+
     return static_cast<CMemoryMonitor*>(Dll::Tls());
     }
 
 
 void OomMonitorPluginPanic(TOomMonitorPluginPanic aReason)
     {
+    FUNC_LOG;
+
     _LIT(KCat, "OomMonitorPlugin");
     User::Panic(KCat, aReason);
     }
@@ -43,34 +50,53 @@
 
 EXPORT_C COomMonitorPlugin::COomMonitorPlugin()
 : iMemoryMonitor(MemoryMonitorTls())
-	{
-	__ASSERT_ALWAYS(iMemoryMonitor, OomMonitorPluginPanic(EOomMonitorPluginPanic_PluginConstructedOutsideOomMonitorThread));
-	}
+    {
+    FUNC_LOG;
+
+    __ASSERT_ALWAYS(iMemoryMonitor, OomMonitorPluginPanic(EOomMonitorPluginPanic_PluginConstructedOutsideOomMonitorThread));
+    }
 
 EXPORT_C COomMonitorPlugin::~COomMonitorPlugin()
-	{
-	}
+    {
+    FUNC_LOG;
+    }
 
 EXPORT_C void COomMonitorPlugin::ConstructL()
-	{
-	// CAppOomMonitorPlugin assumes ConstructL is empty
-	}
+    {
+    FUNC_LOG;
+
+    // CAppOomMonitorPlugin assumes ConstructL is empty
+    }
 
 EXPORT_C void COomMonitorPlugin::ExtensionInterface(TUid /*aInterfaceId*/, TAny*& /*aImplementaion*/)
-	{
-	}
+    {
+    FUNC_LOG;
+    }
 
 EXPORT_C RFs& COomMonitorPlugin::FsSession()
     {
+    FUNC_LOG;
+
     return iMemoryMonitor->iFs;
     }
 
 EXPORT_C RWsSession& COomMonitorPlugin::WsSession()
     {
+    FUNC_LOG;
+
     return iMemoryMonitor->iWs;
     }
 
 
+
+EXPORT_C void COomMonitorPluginV2::FreeRam()
+    {
+    // Note that OomMonitorV2 will not call this version of the function
+    // so it does not need to be implemented in derived classes.
+    }
+
+
+
 EXPORT_C CAppOomMonitorPlugin* CAppOomMonitorPlugin::NewL(TUid aAppUid)
     {
     CAppOomMonitorPlugin* self = new(ELeave) CAppOomMonitorPlugin(aAppUid);
@@ -96,18 +122,18 @@
 void CAppOomMonitorPlugin::SendMessageToApp(TInt aMessage)
     {
     RWsSession& ws = WsSession();
-	TInt wgId = 0;
+    TInt wgId = 0;
 
     do 
         {
-		CApaWindowGroupName::FindByAppUid(iAppUid, ws, wgId);
-		if (wgId>0)
-			{
-        	TWsEvent event;
-        	event.SetType(aMessage);
-        	event.SetTimeNow();
-			ws.SendEventToWindowGroup(wgId, event);
-			}
+        CApaWindowGroupName::FindByAppUid(iAppUid, ws, wgId);
+        if (wgId>0)
+            {
+            TWsEvent event;
+            event.SetType(aMessage);
+            event.SetTimeNow();
+            ws.SendEventToWindowGroup(wgId, event);
+            }
         }
-	while (wgId>0);
+    while (wgId>0);
     }