uiacceltk/hitchcock/goommonitor/src/goommemorymonitorsession.cpp
changeset 53 5ba07f7750a9
parent 38 69409653e863
--- a/uiacceltk/hitchcock/goommonitor/src/goommemorymonitorsession.cpp	Mon Aug 02 12:09:20 2010 +0300
+++ b/uiacceltk/hitchcock/goommonitor/src/goommemorymonitorsession.cpp	Thu Sep 02 13:30:25 2010 +0300
@@ -35,7 +35,7 @@
 CMemoryMonitorSession::~CMemoryMonitorSession()
     {
     FUNC_LOG;
-    Server().Monitor().SessionInCriticalAllocation(0,0);
+    Server().Monitor().SessionInCriticalAllocation(0,iClientId);
     CloseAppsFinished(0, EFalse);
     }
 
@@ -61,35 +61,35 @@
     RThread t;
     aMessage.Client(t);
     
-    TUint clientId = t.SecureId();
+    iClientId = t.SecureId();
     t.Close();
     
-    TRACES1("NEW REQUEST from client %x", clientId);
+    TRACES1("NEW REQUEST from client %x", iClientId);
     switch (aMessage.Function())
         {
         case EGOomMonitorRequestFreeMemory:
 
             //Do not take any more requests from the same client if previous request being served
-            if (!iRequestFreeRam.IsNull() && !Server().Monitor().IsSafeToProcessNewRequest(clientId))
+            if (!iRequestFreeRam.IsNull() && !Server().Monitor().IsSafeToProcessNewRequest(iClientId))
                 {
-                TRACES1("CANNOT PROCESS NEW REQUEST from %x", clientId);
+                TRACES1("CANNOT PROCESS NEW REQUEST from %x", iClientId);
                 aMessage.Complete(KErrInUse);
                 return;
                 }
             
-            Server().Monitor().SetActiveClient(clientId);
+            Server().Monitor().SetActiveClient(iClientId);
             // message will be completed when CloseAppsFinished() is called.
             if (aMessage.Int1() == 0)
                 {
                 iRequestFreeRam = aMessage;
 
-                Server().Monitor().SessionInCriticalAllocation(1, clientId);
+                Server().Monitor().SessionInCriticalAllocation(1, iClientId);
                 
                 TRAPD(err, Monitor().RequestFreeMemoryL(aMessage.Int0()));
                 if(err == KErrCompletion) 
                     {
                     TRACES("There is already enough memory - nothing to do");
-                    Server().Monitor().SessionInCriticalAllocation(0, clientId);
+                    Server().Monitor().SessionInCriticalAllocation(0, iClientId);
                     }
                 else if (err != KErrNone )
                     {
@@ -108,8 +108,8 @@
             break;
             
         case EGOomMonitorMemoryAllocationsComplete:
-            TRACES1("ServiceL : Memory Allocations complete from %x", clientId);
-            Server().Monitor().SessionInCriticalAllocation(0, clientId);
+            TRACES1("ServiceL : Memory Allocations complete from %x", iClientId);
+            Server().Monitor().SessionInCriticalAllocation(0, iClientId);
             aMessage.Complete(KErrNone);
             break;
 
@@ -118,7 +118,7 @@
                 {
                 iRequestFreeRam.Complete(KErrCancel);
                 }
-            Server().Monitor().SessionInCriticalAllocation(0, clientId);
+            Server().Monitor().SessionInCriticalAllocation(0, iClientId);
             aMessage.Complete(KErrNone);
             break;
 
@@ -128,11 +128,11 @@
             break;
 
         case EGOomMonitorRequestOptionalRam:
-            if (!iRequestFreeRam.IsNull() && !Server().Monitor().IsSafeToProcessNewRequest(clientId))
+            if (!iRequestFreeRam.IsNull() && !Server().Monitor().IsSafeToProcessNewRequest(iClientId))
                 {
                 aMessage.Complete(KErrInUse);
                 }
-            Server().Monitor().SetActiveClient(clientId);
+            Server().Monitor().SetActiveClient(iClientId);
             // message will be completed when CloseAppsFinished() is called.
             iRequestFreeRam = aMessage;
             iMinimumMemoryRequested = aMessage.Int1();
@@ -167,10 +167,19 @@
             iUseAbsoluteTargets = aMessage.Int0();
 /*            TRACES2("EGoomMonitorAppUsesAbsoluteMemTargets this: 0x%x, use abs targets %d", this, iUseAbsoluteTargets);
             Server().Monitor().SessionInCriticalAllocation(iUseAbsoluteTargets);
-*/           aMessage.Complete(KErrNone);     
+*/          aMessage.Complete(KErrNone);     
             break;
             }    
+        case EGOomMonitorRequestHWRendering:
+            {
+            RDebug::Printf("RAN_DEBUG : GOOM EGOomMonitorRequestHWRendering");
+            if(Server().Monitor().SwitchRenderingToHW())
+                aMessage.Complete(KErrNone);
+            else
+                aMessage.Complete(KErrNoMemory);
             
+            break;
+            }
         default:
             PanicClient(aMessage, EPanicIllegalFunction);
             break;