sysresmonitoring/oommonitor/inc/oommemorymonitor.h
branchRCL_3
changeset 18 0818dd463d41
parent 1 0fdb7f6b0309
child 19 924385140d98
equal deleted inserted replaced
17:5e7d68cc22e0 18:0818dd463d41
     1 /*
     1 /*
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    17 
    17 
    18 
    18 
    19 #ifndef OOMMEMORYMONITOR_H
    19 #ifndef OOMMEMORYMONITOR_H
    20 #define OOMMEMORYMONITOR_H
    20 #define OOMMEMORYMONITOR_H
    21 
    21 
       
    22 #include <u32hal.h>
    22 #include <e32property.h>
    23 #include <e32property.h>
    23 #include <f32file.h>
    24 #include <f32file.h>
    24 #include <w32std.h>
    25 #include <w32std.h>
    25 #include "oomglobalconfig.h"
    26 #include "oomglobalconfig.h"
    26 #include "oomwindowgrouplist.h"
    27 #include "oomwindowgrouplist.h"
    67     ~CMemoryMonitor();
    68     ~CMemoryMonitor();
    68 
    69 
    69 public: // event handlers
    70 public: // event handlers
    70     void FreeMemThresholdCrossedL();
    71     void FreeMemThresholdCrossedL();
    71     void AppNotExiting(TInt aWgId);
    72     void AppNotExiting(TInt aWgId);
    72     void StartFreeSomeRamL(TInt aTargetFree);
    73     void StartFreeSomeRamL(TInt aFreeRamTarget, TInt aFreeSwapSpaceTarget);
    73     void StartFreeSomeRamL(TInt aTargetFree, TInt aMaxPriority);
    74     void StartFreeSomeRamL(TInt aFreeRamTarget, TInt aFreeSwapSpaceTarget, TInt aMaxPriority);
    74     void FreeOptionalRamL(TInt aBytesRequested, TInt aPluginId); // The ID of the plugin that will clear up the allocation, used to determine the priority of the allocation
    75     void FreeOptionalRamL(TInt aBytesRequested, TInt aPluginId, TBool aDataPaged); // The ID of the plugin that will clear up the allocation, used to determine the priority of the allocation
    75     void HandleFocusedWgChangeL();
    76     void HandleFocusedWgChangeL();
    76     static const COomGlobalConfig& GlobalConfig();
    77     static const COomGlobalConfig& GlobalConfig();
    77     void SetPriorityBusy(TInt aWgId);
    78     void SetPriorityBusy(TInt aWgId);
    78     void SetPriorityNormal(TInt aWgId);
    79     void SetPriorityNormal(TInt aWgId);
    79     void SetPriorityHigh(TInt aWgId);
    80     void SetPriorityHigh(TInt aWgId);
    80     void ResetTargets();
    81     void ResetTargets();
    81     void RequestTimerCallbackL();
    82     void RequestTimerCallbackL();
    82     void GetFreeMemory(TInt& aCurrentFreeMemory);
    83     void GetFreeMemory(TInt& aCurrentFreeMemory);
       
    84     void GetFreeSwapSpace(TInt& aCurrentFreeSwapSpace);
    83     TActionTriggerType ActionTrigger() const;
    85     TActionTriggerType ActionTrigger() const;
    84 #ifdef CLIENT_REQUEST_QUEUE
    86 #ifdef CLIENT_REQUEST_QUEUE
    85     void ActionsCompleted(TInt aBytesFree, TBool aMemoryGood);
    87     void ActionsCompleted(TInt aBytesFree, TBool aMemoryGood);
    86     TInt GoodThreshold() const;
    88     TInt GoodRamThreshold() const;
    87     TInt LowThreshold() const;
    89     TInt LowRamThreshold() const;
    88 #endif
    90 #endif
    89     void RequestFreeMemoryL(TInt aBytesRequested);
    91     void RequestFreeMemoryL(TInt aBytesRequested, TBool aDataPaged);
    90     void RequestFreeMemoryPandSL(TInt aBytesRequested);
    92     void RequestFreeMemoryPandSL(TInt aBytesRequested);
    91     
    93     
    92     /*
    94     /*
    93      * Sets the RProperty associated with KOomMemoryMonitorStatusPropertyKey
    95      * Sets the RProperty associated with KOomMemoryMonitorStatusPropertyKey
    94      * It checks if the value is going to be changed. 
    96      * It checks if the value is going to be changed. 
   113     // All members are owned
   115     // All members are owned
   114     // generally useful sessions
   116     // generally useful sessions
   115     RFs iFs;
   117     RFs iFs;
   116     RWsSession iWs;
   118     RWsSession iWs;
   117 
   119 
       
   120     TBool iDataPaged;
       
   121     
   118 private: //data
   122 private: //data
   119 
   123 
   120     // parameters for OOM watcher.
   124     // parameters for OOM watcher.
   121     TInt iLowThreshold;
   125     TInt iLowRamThreshold;
   122     TInt iGoodThreshold;
   126     TInt iGoodRamThreshold;
   123     TInt iCurrentTarget;
   127     TInt iLowSwapThreshold;
       
   128     TInt iGoodSwapThreshold;
       
   129     TInt iCurrentRamTarget;
       
   130     TInt iCurrentSwapTarget;
       
   131     
       
   132    
       
   133     
   124 #ifdef CLIENT_REQUEST_QUEUE
   134 #ifdef CLIENT_REQUEST_QUEUE
   125     TInt iClientBytesRequested;
   135     TInt iClientBytesRequested;
   126 #endif        
   136 #endif        
   127     // event receivers
   137     // event receivers
   128     
   138