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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ATHENA_RESOURCE_MANAGER_PUBLIC_RESOURCE_MANAGER_H_ 5 #ifndef ATHENA_RESOURCE_MANAGER_PUBLIC_RESOURCE_MANAGER_H_
6 #define ATHENA_RESOURCE_MANAGER_PUBLIC_RESOURCE_MANAGER_H_ 6 #define ATHENA_RESOURCE_MANAGER_PUBLIC_RESOURCE_MANAGER_H_
7 7
8 #include "athena/athena_export.h" 8 #include "athena/athena_export.h"
9 #include "athena/resource_manager/memory_pressure_notifier.h" 9 #include "athena/resource_manager/memory_pressure_notifier.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 14 matching lines...) Expand all
25 ResourceManager(); 25 ResourceManager();
26 virtual ~ResourceManager(); 26 virtual ~ResourceManager();
27 27
28 // Unit tests can simulate MemoryPressure changes with this call. 28 // Unit tests can simulate MemoryPressure changes with this call.
29 // Note: Even though the default unit test ResourceManagerDelegte 29 // Note: Even though the default unit test ResourceManagerDelegte
30 // implementation ensures that the MemoryPressure event will not go off, 30 // implementation ensures that the MemoryPressure event will not go off,
31 // this call will also explicitly stop the MemoryPressureNotifier. 31 // this call will also explicitly stop the MemoryPressureNotifier.
32 virtual void SetMemoryPressureAndStopMonitoring( 32 virtual void SetMemoryPressureAndStopMonitoring(
33 MemoryPressureObserver::MemoryPressure pressure) = 0; 33 MemoryPressureObserver::MemoryPressure pressure) = 0;
34 34
35 // Suspend the resource manager temporarily if |pause| is set. This can be
36 // called before e.g. re-arranging the order of activities. Once called with
37 // |pause| == false any queued operations will be performed and the resource
38 // manager will continue its work.
39 virtual void Pause(bool pause) = 0;
40
35 private: 41 private:
36 DISALLOW_COPY_AND_ASSIGN(ResourceManager); 42 DISALLOW_COPY_AND_ASSIGN(ResourceManager);
37 }; 43 };
38 44
45 // Use this scoped object to pause/restart the resource manager.
46 class ScopedPauseResourceManager {
47 public:
48 ScopedPauseResourceManager() {
49 ResourceManager::Get()->Pause(true);
50 }
51 ~ScopedPauseResourceManager() {
52 ResourceManager::Get()->Pause(false);
53 }
54 private:
55 DISALLOW_COPY_AND_ASSIGN(ScopedPauseResourceManager);
56 };
57
39 } // namespace athena 58 } // namespace athena
40 59
41 #endif // ATHENA_RESOURCE_MANAGER_PUBLIC_RESOURCE_MANAGER_H_ 60 #endif // ATHENA_RESOURCE_MANAGER_PUBLIC_RESOURCE_MANAGER_H_
OLDNEW
« 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