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

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

Issue 7825026: Revert "Currently, base/timer.cc calls PostTask with FROM_HERE as the Location, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 months 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 30 matching lines...) Expand all
41 OomPriorityManager::OomPriorityManager() { 41 OomPriorityManager::OomPriorityManager() {
42 StartTimer(); 42 StartTimer();
43 } 43 }
44 44
45 OomPriorityManager::~OomPriorityManager() { 45 OomPriorityManager::~OomPriorityManager() {
46 StopTimer(); 46 StopTimer();
47 } 47 }
48 48
49 void OomPriorityManager::StartTimer() { 49 void OomPriorityManager::StartTimer() {
50 if (!timer_.IsRunning()) { 50 if (!timer_.IsRunning()) {
51 timer_.Start(FROM_HERE, 51 timer_.Start(TimeDelta::FromSeconds(ADJUSTMENT_INTERVAL_SECONDS),
52 TimeDelta::FromSeconds(ADJUSTMENT_INTERVAL_SECONDS),
53 this, 52 this,
54 &OomPriorityManager::AdjustOomPriorities); 53 &OomPriorityManager::AdjustOomPriorities);
55 } 54 }
56 } 55 }
57 56
58 void OomPriorityManager::StopTimer() { 57 void OomPriorityManager::StopTimer() {
59 timer_.Stop(); 58 timer_.Stop();
60 } 59 }
61 60
62 // Returns true if |first| is considered less desirable to be killed 61 // Returns true if |first| is considered less desirable to be killed
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 if (already_seen.find(iterator->renderer_handle) == already_seen.end()) { 177 if (already_seen.find(iterator->renderer_handle) == already_seen.end()) {
179 already_seen.insert(iterator->renderer_handle); 178 already_seen.insert(iterator->renderer_handle);
180 ZygoteHost::GetInstance()->AdjustRendererOOMScore( 179 ZygoteHost::GetInstance()->AdjustRendererOOMScore(
181 iterator->renderer_handle, static_cast<int>(priority + 0.5f)); 180 iterator->renderer_handle, static_cast<int>(priority + 0.5f));
182 priority += priority_increment; 181 priority += priority_increment;
183 } 182 }
184 } 183 }
185 } 184 }
186 185
187 } // namespace browser 186 } // namespace browser
OLDNEW
« no previous file with comments | « chrome/browser/notifications/notification_ui_manager.cc ('k') | chrome/browser/policy/delayed_work_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698