Index: athena/resource_manager/public/resource_manager.h |
diff --git a/athena/resource_manager/public/resource_manager.h b/athena/resource_manager/public/resource_manager.h |
index be07b6e6f33986e926d971b6fb74bc7fb783b02d..8bc7a6077d7f9276e39a09e59d36d30a203937f6 100644 |
--- a/athena/resource_manager/public/resource_manager.h |
+++ b/athena/resource_manager/public/resource_manager.h |
@@ -31,10 +31,29 @@ class ResourceManager { |
virtual void SetMemoryPressureAndStopMonitoring( |
MemoryPressureObserver::MemoryPressure pressure) = 0; |
+ // Disable the resource manager temporarily if |pause| is set. This can be |
oshima
2014/09/04 16:39:23
"Disable" may be misleading. How about just say "P
Mr4D (OOO till 08-26)
2014/09/04 19:10:57
Done.
|
+ // called before e.g. re-arranging the order of activities. Once called with |
+ // |pause| == false any queued operations will be performed and the resource |
+ // manager will continue its work. |
+ virtual void Pause(bool pause) = 0; |
+ |
private: |
DISALLOW_COPY_AND_ASSIGN(ResourceManager); |
}; |
+// Use this scoped object to pause/restart the resource manager. |
+class ScopedPauseResourceManager { |
+ public: |
+ ScopedPauseResourceManager() { |
+ ResourceManager::Get()->Pause(true); |
+ } |
+ ~ScopedPauseResourceManager() { |
+ ResourceManager::Get()->Pause(false); |
+ } |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(ScopedPauseResourceManager); |
+}; |
+ |
} // namespace athena |
#endif // ATHENA_RESOURCE_MANAGER_PUBLIC_RESOURCE_MANAGER_H_ |