OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CHROME_BROWSER_MEMORY_TAB_MANAGER_DELEGATE_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_MEMORY_TAB_MANAGER_DELEGATE_CHROMEOS_H_ |
6 #define CHROME_BROWSER_MEMORY_TAB_MANAGER_DELEGATE_CHROMEOS_H_ | 6 #define CHROME_BROWSER_MEMORY_TAB_MANAGER_DELEGATE_CHROMEOS_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 // content::NotificationObserver: | 144 // content::NotificationObserver: |
145 void Observe(int type, | 145 void Observe(int type, |
146 const content::NotificationSource& source, | 146 const content::NotificationSource& source, |
147 const content::NotificationDetails& details) override; | 147 const content::NotificationDetails& details) override; |
148 | 148 |
149 // Pair to hold child process host id and ProcessHandle. | 149 // Pair to hold child process host id and ProcessHandle. |
150 typedef std::pair<int, base::ProcessHandle> ProcessInfo; | 150 typedef std::pair<int, base::ProcessHandle> ProcessInfo; |
151 | 151 |
152 // Cache OOM scores in memory. | 152 // Cache OOM scores in memory. |
153 typedef base::hash_map<base::ProcessHandle, int> ProcessScoreMap; // NOLINT | 153 typedef base::hash_map<base::ProcessHandle, int> ProcessScoreMap; |
154 | 154 |
155 // Get the list of candidates to kill, sorted by reversed importance. | 155 // Get the list of candidates to kill, sorted by reversed importance. |
156 static std::vector<Candidate> GetSortedCandidates( | 156 static std::vector<Candidate> GetSortedCandidates( |
157 const TabStatsList& tab_list, | 157 const TabStatsList& tab_list, |
158 const std::vector<arc::ArcProcess>& arc_processes); | 158 const std::vector<arc::ArcProcess>& arc_processes); |
159 | 159 |
160 // Posts AdjustFocusedTabScore task to the file thread. | 160 // Posts AdjustFocusedTabScore task to the file thread. |
161 void OnFocusTabScoreAdjustmentTimeout(); | 161 void OnFocusTabScoreAdjustmentTimeout(); |
162 | 162 |
163 // Kills a process after getting all info of tabs and apps. | 163 // Kills a process after getting all info of tabs and apps. |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 // reported if available memory is under the number. | 274 // reported if available memory is under the number. |
275 static int LowMemoryMarginKB(); | 275 static int LowMemoryMarginKB(); |
276 | 276 |
277 // Reads in an integer. | 277 // Reads in an integer. |
278 static int ReadIntFromFile(const char* file_name, int default_val); | 278 static int ReadIntFromFile(const char* file_name, int default_val); |
279 }; | 279 }; |
280 | 280 |
281 } // namespace memory | 281 } // namespace memory |
282 | 282 |
283 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_DELEGATE_CHROMEOS_H_ | 283 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_DELEGATE_CHROMEOS_H_ |
OLD | NEW |