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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 // Returns oom_score_adj of a process if the score is cached by |this|. | 73 // Returns oom_score_adj of a process if the score is cached by |this|. |
74 // If couldn't find the score in the cache, returns -1001 since the valid | 74 // If couldn't find the score in the cache, returns -1001 since the valid |
75 // range of oom_score_adj is [-1000, 1000]. | 75 // range of oom_score_adj is [-1000, 1000]. |
76 int GetCachedOomScore(base::ProcessHandle process_handle); | 76 int GetCachedOomScore(base::ProcessHandle process_handle); |
77 | 77 |
78 // Called when the timer fires, sets oom_adjust_score for all renderers. | 78 // Called when the timer fires, sets oom_adjust_score for all renderers. |
79 void AdjustOomPriorities(const TabStatsList& tab_list); | 79 void AdjustOomPriorities(const TabStatsList& tab_list); |
80 | 80 |
81 protected: | 81 protected: |
82 // Kills an Arc process. Returns true if the kill request is successfully sent | 82 // Kills an ARC process. Returns true if the kill request is successfully sent |
83 // to Android. Virtual for unit testing. | 83 // to Android. Virtual for unit testing. |
84 virtual bool KillArcProcess(const int nspid); | 84 virtual bool KillArcProcess(const int nspid); |
85 | 85 |
86 // Kills a tab. Returns true if the tab is killed successfully. | 86 // Kills a tab. Returns true if the tab is killed successfully. |
87 // Virtual for unit testing. | 87 // Virtual for unit testing. |
88 virtual bool KillTab(int64_t tab_id); | 88 virtual bool KillTab(int64_t tab_id); |
89 | 89 |
90 // Get debugd client instance. | 90 // Get debugd client instance. |
91 virtual chromeos::DebugDaemonClient* GetDebugDaemonClient(); | 91 virtual chromeos::DebugDaemonClient* GetDebugDaemonClient(); |
92 | 92 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 // reported if available memory is under the number. | 229 // reported if available memory is under the number. |
230 static int LowMemoryMarginKB(); | 230 static int LowMemoryMarginKB(); |
231 | 231 |
232 // Reads in an integer. | 232 // Reads in an integer. |
233 static int ReadIntFromFile(const char* file_name, int default_val); | 233 static int ReadIntFromFile(const char* file_name, int default_val); |
234 }; | 234 }; |
235 | 235 |
236 } // namespace memory | 236 } // namespace memory |
237 | 237 |
238 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_DELEGATE_CHROMEOS_H_ | 238 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_DELEGATE_CHROMEOS_H_ |
OLD | NEW |