Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: athena/resource_manager/public/resource_manager.h

Issue 536013002: Decoupling visibility states from webcontent, adding visibility management in ResourceManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « athena/home/home_card_impl.cc ('k') | athena/resource_manager/resource_manager_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3978f7fa10905e34856897fbc3a8d682eff5391f..a639ff8187205847667ac3f53bf013ad9546ea81 100644
--- a/athena/resource_manager/public/resource_manager.h
+++ b/athena/resource_manager/public/resource_manager.h
@@ -32,10 +32,29 @@ class ATHENA_EXPORT ResourceManager {
virtual void SetMemoryPressureAndStopMonitoring(
MemoryPressureObserver::MemoryPressure pressure) = 0;
+ // Suspend the resource manager temporarily if |pause| is set. This can be
+ // 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_
« no previous file with comments | « athena/home/home_card_impl.cc ('k') | athena/resource_manager/resource_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698