| 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_OOM_PRIORITY_MANAGER_DELEGATE_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_MEMORY_OOM_PRIORITY_MANAGER_DELEGATE_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_MEMORY_OOM_PRIORITY_MANAGER_DELEGATE_CHROMEOS_H_ | 6 #define CHROME_BROWSER_MEMORY_OOM_PRIORITY_MANAGER_DELEGATE_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 // Posts AdjustFocusedTabScore task to the file thread. | 59 // Posts AdjustFocusedTabScore task to the file thread. |
| 60 void OnFocusTabScoreAdjustmentTimeout(); | 60 void OnFocusTabScoreAdjustmentTimeout(); |
| 61 | 61 |
| 62 // Sets the score of the focused tab to the least value. | 62 // Sets the score of the focused tab to the least value. |
| 63 void AdjustFocusedTabScoreOnFileThread(); | 63 void AdjustFocusedTabScoreOnFileThread(); |
| 64 | 64 |
| 65 // Registrar to receive renderer notifications. | 65 // Registrar to receive renderer notifications. |
| 66 content::NotificationRegistrar registrar_; | 66 content::NotificationRegistrar registrar_; |
| 67 // Timer to guarantee that the tab is focused for a certain amount of time. | 67 // Timer to guarantee that the tab is focused for a certain amount of time. |
| 68 base::OneShotTimer<OomPriorityManagerDelegate> focus_tab_score_adjust_timer_; | 68 base::OneShotTimer focus_tab_score_adjust_timer_; |
| 69 // This lock is for |oom_score_map_| and |focused_tab_process_info_|. | 69 // This lock is for |oom_score_map_| and |focused_tab_process_info_|. |
| 70 base::Lock oom_score_lock_; | 70 base::Lock oom_score_lock_; |
| 71 // Map maintaining the child process host id - oom_score mapping. | 71 // Map maintaining the child process host id - oom_score mapping. |
| 72 typedef base::hash_map<int, int> ProcessScoreMap; | 72 typedef base::hash_map<int, int> ProcessScoreMap; |
| 73 ProcessScoreMap oom_score_map_; | 73 ProcessScoreMap oom_score_map_; |
| 74 // Holds the focused tab's child process host id. | 74 // Holds the focused tab's child process host id. |
| 75 ProcessInfo focused_tab_process_info_; | 75 ProcessInfo focused_tab_process_info_; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(OomPriorityManagerDelegate); | 77 DISALLOW_COPY_AND_ASSIGN(OomPriorityManagerDelegate); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace memory | 80 } // namespace memory |
| 81 | 81 |
| 82 #endif // CHROME_BROWSER_MEMORY_OOM_PRIORITY_MANAGER_DELEGATE_CHROMEOS_H_ | 82 #endif // CHROME_BROWSER_MEMORY_OOM_PRIORITY_MANAGER_DELEGATE_CHROMEOS_H_ |
| OLD | NEW |