OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" | 5 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 //////////////////////////////////////////////////////////////////////////////// | 108 //////////////////////////////////////////////////////////////////////////////// |
109 // OomMemoryDetails logs details about all Chrome processes during an out-of- | 109 // OomMemoryDetails logs details about all Chrome processes during an out-of- |
110 // memory event in an attempt to identify the culprit, then discards a tab and | 110 // memory event in an attempt to identify the culprit, then discards a tab and |
111 // deletes itself. | 111 // deletes itself. |
112 class OomMemoryDetails : public MemoryDetails { | 112 class OomMemoryDetails : public MemoryDetails { |
113 public: | 113 public: |
114 OomMemoryDetails(); | 114 OomMemoryDetails(); |
115 | 115 |
116 // MemoryDetails overrides: | 116 // MemoryDetails overrides: |
117 virtual void OnDetailsAvailable() OVERRIDE; | 117 virtual void OnDetailsAvailable() override; |
118 | 118 |
119 private: | 119 private: |
120 virtual ~OomMemoryDetails() {} | 120 virtual ~OomMemoryDetails() {} |
121 | 121 |
122 TimeTicks start_time_; | 122 TimeTicks start_time_; |
123 | 123 |
124 DISALLOW_COPY_AND_ASSIGN(OomMemoryDetails); | 124 DISALLOW_COPY_AND_ASSIGN(OomMemoryDetails); |
125 }; | 125 }; |
126 | 126 |
127 OomMemoryDetails::OomMemoryDetails() { | 127 OomMemoryDetails::OomMemoryDetails() { |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 if (it == pid_to_oom_score_.end() || it->second != score) { | 654 if (it == pid_to_oom_score_.end() || it->second != score) { |
655 content::ZygoteHost::GetInstance()->AdjustRendererOOMScore(*iterator, | 655 content::ZygoteHost::GetInstance()->AdjustRendererOOMScore(*iterator, |
656 score); | 656 score); |
657 pid_to_oom_score_[*iterator] = score; | 657 pid_to_oom_score_[*iterator] = score; |
658 } | 658 } |
659 priority += priority_increment; | 659 priority += priority_increment; |
660 } | 660 } |
661 } | 661 } |
662 | 662 |
663 } // namespace chromeos | 663 } // namespace chromeos |
OLD | NEW |