OLD | NEW |
1 | 1 |
2 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #ifndef CHROME_BROWSER_OOM_PRIORITY_MANAGER_H_ | 6 #ifndef CHROME_BROWSER_OOM_PRIORITY_MANAGER_H_ |
7 #define CHROME_BROWSER_OOM_PRIORITY_MANAGER_H_ | 7 #define CHROME_BROWSER_OOM_PRIORITY_MANAGER_H_ |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/hash_tables.h" | 13 #include "base/hash_tables.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/process.h" | 15 #include "base/process.h" |
16 #include "base/string16.h" | 16 #include "base/string16.h" |
17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
18 #include "base/time.h" | 18 #include "base/time.h" |
19 #include "base/timer.h" | 19 #include "base/timer.h" |
20 #include "content/public/browser/notification_observer.h" | 20 #include "content/public/browser/notification_observer.h" |
21 #include "content/public/browser/notification_registrar.h" | 21 #include "content/public/browser/notification_registrar.h" |
22 | 22 |
23 class TabContents; | |
24 | |
25 namespace browser { | 23 namespace browser { |
26 | 24 |
27 class LowMemoryObserver; | 25 class LowMemoryObserver; |
28 | 26 |
29 // The OomPriorityManager periodically checks (see | 27 // The OomPriorityManager periodically checks (see |
30 // ADJUSTMENT_INTERVAL_SECONDS in the source) the status of renderers | 28 // ADJUSTMENT_INTERVAL_SECONDS in the source) the status of renderers |
31 // and adjusts the out of memory (OOM) adjustment value (in | 29 // and adjusts the out of memory (OOM) adjustment value (in |
32 // /proc/<pid>/oom_score_adj) of the renderers so that they match the | 30 // /proc/<pid>/oom_score_adj) of the renderers so that they match the |
33 // algorithm embedded here for priority in being killed upon OOM | 31 // algorithm embedded here for priority in being killed upon OOM |
34 // conditions. | 32 // conditions. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 base::ProcessHandle focused_tab_pid_; | 97 base::ProcessHandle focused_tab_pid_; |
100 | 98 |
101 scoped_ptr<LowMemoryObserver> low_memory_observer_; | 99 scoped_ptr<LowMemoryObserver> low_memory_observer_; |
102 | 100 |
103 DISALLOW_COPY_AND_ASSIGN(OomPriorityManager); | 101 DISALLOW_COPY_AND_ASSIGN(OomPriorityManager); |
104 }; | 102 }; |
105 | 103 |
106 } // namespace browser | 104 } // namespace browser |
107 | 105 |
108 #endif // CHROME_BROWSER_OOM_PRIORITY_MANAGER_H_ | 106 #endif // CHROME_BROWSER_OOM_PRIORITY_MANAGER_H_ |
OLD | NEW |