Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: chrome/browser/oom_priority_manager.cc

Issue 5519016: Add a new GetInstance() method for singleton classes used in chrome/browser files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/oom_priority_manager.h" 5 #include "chrome/browser/oom_priority_manager.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/process.h" 9 #include "base/process.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 const int kMaxPriority = 10; 159 const int kMaxPriority = 10;
160 const int kPriorityRange = kMaxPriority - kMinPriority; 160 const int kPriorityRange = kMaxPriority - kMinPriority;
161 float priority_increment = 161 float priority_increment =
162 static_cast<float>(kPriorityRange) / renderer_stats.size(); 162 static_cast<float>(kPriorityRange) / renderer_stats.size();
163 float priority = kMinPriority; 163 float priority = kMinPriority;
164 std::set<base::ProcessHandle> already_seen; 164 std::set<base::ProcessHandle> already_seen;
165 for (StatsList::iterator iterator = renderer_stats.begin(); 165 for (StatsList::iterator iterator = renderer_stats.begin();
166 iterator != renderer_stats.end(); ++iterator) { 166 iterator != renderer_stats.end(); ++iterator) {
167 if (already_seen.find(iterator->renderer_handle) == already_seen.end()) { 167 if (already_seen.find(iterator->renderer_handle) == already_seen.end()) {
168 already_seen.insert(iterator->renderer_handle); 168 already_seen.insert(iterator->renderer_handle);
169 Singleton<ZygoteHost>::get()->AdjustRendererOOMScore( 169 ZygoteHost::GetInstance()->AdjustRendererOOMScore(
170 iterator->renderer_handle, 170 iterator->renderer_handle,
171 static_cast<int>(priority + 0.5f)); 171 static_cast<int>(priority + 0.5f));
172 priority += priority_increment; 172 priority += priority_increment;
173 } 173 }
174 } 174 }
175 } 175 }
176 176
177 } // namespace browser 177 } // namespace browser
OLDNEW
« no previous file with comments | « chrome/browser/memory_details_linux.cc ('k') | chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698