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

Side by Side Diff: athena/resource_manager/memory_pressure_notifier.h

Issue 514293003: Run athena on chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments, rebase 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/resource_manager/DEPS ('k') | athena/resource_manager/public/DEPS » ('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 (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_MEMORY_PRESSURE_NOTIFIER_H_ 5 #ifndef ATHENA_RESOURCE_MANAGER_MEMORY_PRESSURE_NOTIFIER_H_
6 #define ATHENA_RESOURCE_MANAGER_MEMORY_PRESSURE_NOTIFIER_H_ 6 #define ATHENA_RESOURCE_MANAGER_MEMORY_PRESSURE_NOTIFIER_H_
7 7
8 #include "athena/athena_export.h"
8 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
10 #include "base/timer/timer.h" 11 #include "base/timer/timer.h"
11 12
12 namespace athena { 13 namespace athena {
13 14
14 class MemoryPressureNotifierImpl; 15 class MemoryPressureNotifierImpl;
15 class ResourceManagerDelegate; 16 class ResourceManagerDelegate;
16 17
17 //////////////////////////////////////////////////////////////////////////////// 18 ////////////////////////////////////////////////////////////////////////////////
(...skipping 26 matching lines...) Expand all
44 45
45 //////////////////////////////////////////////////////////////////////////////// 46 ////////////////////////////////////////////////////////////////////////////////
46 // MemoryPressureNotifier 47 // MemoryPressureNotifier
47 // 48 //
48 // Class to handle the observation of our free memory. It notifies the owner of 49 // Class to handle the observation of our free memory. It notifies the owner of
49 // memory fill level changes, so that it can take action to reduce memory by 50 // memory fill level changes, so that it can take action to reduce memory by
50 // reducing active activities. 51 // reducing active activities.
51 // 52 //
52 // The observer will use 3 different fill levels: 50% full, 75% full and 90% 53 // The observer will use 3 different fill levels: 50% full, 75% full and 90%
53 // full. 54 // full.
54 class MemoryPressureNotifier { 55 class ATHENA_EXPORT MemoryPressureNotifier {
55 public: 56 public:
56 // The creator gets the |listener| object. Note that the ownership of the 57 // The creator gets the |listener| object. Note that the ownership of the
57 // listener object remains with the creator. 58 // listener object remains with the creator.
58 explicit MemoryPressureNotifier(MemoryPressureObserver* listener); 59 explicit MemoryPressureNotifier(MemoryPressureObserver* listener);
59 ~MemoryPressureNotifier(); 60 ~MemoryPressureNotifier();
60 61
61 // Stop observing the memory fill level. 62 // Stop observing the memory fill level.
62 // May be safely called if StartObserving has not been called. 63 // May be safely called if StartObserving has not been called.
63 void StopObserving(); 64 void StopObserving();
64 65
(...skipping 18 matching lines...) Expand all
83 84
84 // Our current memory pressure. 85 // Our current memory pressure.
85 MemoryPressureObserver::MemoryPressure current_pressure_; 86 MemoryPressureObserver::MemoryPressure current_pressure_;
86 87
87 DISALLOW_COPY_AND_ASSIGN(MemoryPressureNotifier); 88 DISALLOW_COPY_AND_ASSIGN(MemoryPressureNotifier);
88 }; 89 };
89 90
90 } // namespace athena 91 } // namespace athena
91 92
92 #endif // ATHENA_RESOURCE_MANAGER_MEMORY_PRESSURE_NOTIFIER_H_ 93 #endif // ATHENA_RESOURCE_MANAGER_MEMORY_PRESSURE_NOTIFIER_H_
OLDNEW
« no previous file with comments | « athena/resource_manager/DEPS ('k') | athena/resource_manager/public/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698