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

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

Issue 1045433002: Migrate ChromeOS to base::MemoryPressureMonitor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup/fixes Created 5 years, 8 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/browser_process_platform_part_chromeos.h" 5 #include "chrome/browser/browser_process_platform_part_chromeos.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/time/default_tick_clock.h" 9 #include "base/time/default_tick_clock.h"
10 #include "base/time/tick_clock.h" 10 #include "base/time/tick_clock.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/chromeos/login/session/chrome_session_manager.h" 12 #include "chrome/browser/chromeos/login/session/chrome_session_manager.h"
13 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h" 13 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h"
14 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" 14 #include "chrome/browser/chromeos/memory/oom_priority_manager.h"
15 #include "chrome/browser/chromeos/net/delay_network_call.h" 15 #include "chrome/browser/chromeos/net/delay_network_call.h"
16 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 16 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
17 #include "chrome/browser/chromeos/profiles/profile_helper.h" 17 #include "chrome/browser/chromeos/profiles/profile_helper.h"
18 #include "chrome/browser/chromeos/settings/cros_settings.h" 18 #include "chrome/browser/chromeos/settings/cros_settings.h"
19 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h" 19 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h"
20 #include "chrome/browser/chromeos/system/device_disabling_manager.h" 20 #include "chrome/browser/chromeos/system/device_disabling_manager.h"
21 #include "chrome/browser/chromeos/system/device_disabling_manager_default_delega te.h" 21 #include "chrome/browser/chromeos/system/device_disabling_manager_default_delega te.h"
22 #include "chrome/browser/chromeos/system/timezone_util.h" 22 #include "chrome/browser/chromeos/system/timezone_util.h"
23 #include "chrome/browser/profiles/profile.h" 23 #include "chrome/browser/profiles/profile.h"
24 #include "chrome/common/chrome_switches.h" 24 #include "chrome/common/chrome_switches.h"
25 #include "chrome/common/memory_pressure_monitor_chromeos.h"
26 #include "chromeos/chromeos_switches.h"
25 #include "chromeos/geolocation/simple_geolocation_provider.h" 27 #include "chromeos/geolocation/simple_geolocation_provider.h"
26 #include "chromeos/timezone/timezone_resolver.h" 28 #include "chromeos/timezone/timezone_resolver.h"
27 #include "components/session_manager/core/session_manager.h" 29 #include "components/session_manager/core/session_manager.h"
28 #include "components/user_manager/user_manager.h" 30 #include "components/user_manager/user_manager.h"
29 31
30 BrowserProcessPlatformPart::BrowserProcessPlatformPart() 32 BrowserProcessPlatformPart::BrowserProcessPlatformPart()
31 : created_profile_helper_(false) { 33 : created_profile_helper_(false) {
32 } 34 }
33 35
34 BrowserProcessPlatformPart::~BrowserProcessPlatformPart() { 36 BrowserProcessPlatformPart::~BrowserProcessPlatformPart() {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 90 }
89 91
90 session_manager::SessionManager* BrowserProcessPlatformPart::SessionManager() { 92 session_manager::SessionManager* BrowserProcessPlatformPart::SessionManager() {
91 DCHECK(CalledOnValidThread()); 93 DCHECK(CalledOnValidThread());
92 return session_manager_.get(); 94 return session_manager_.get();
93 } 95 }
94 96
95 chromeos::OomPriorityManager* 97 chromeos::OomPriorityManager*
96 BrowserProcessPlatformPart::oom_priority_manager() { 98 BrowserProcessPlatformPart::oom_priority_manager() {
97 DCHECK(CalledOnValidThread()); 99 DCHECK(CalledOnValidThread());
98 if (!oom_priority_manager_.get()) 100 if (!oom_priority_manager_.get()) {
Mr4D (OOO till 08-26) 2015/03/31 21:12:17 I suppose this is temporary? Also - I am not sure
101 if (chromeos::switches::MemoryPressureHandlingEnabled()) {
Mr4D (OOO till 08-26) 2015/03/31 21:12:17 What was the reason for not instantiating it with
102 memory_pressure_monitor_.reset(new MemoryPressureMonitorChromeOS(
103 chromeos::switches::GetMemoryPressureThresholds()));
104 }
99 oom_priority_manager_.reset(new chromeos::OomPriorityManager()); 105 oom_priority_manager_.reset(new chromeos::OomPriorityManager());
106 }
100 return oom_priority_manager_.get(); 107 return oom_priority_manager_.get();
101 } 108 }
102 109
103 chromeos::ProfileHelper* BrowserProcessPlatformPart::profile_helper() { 110 chromeos::ProfileHelper* BrowserProcessPlatformPart::profile_helper() {
104 DCHECK(CalledOnValidThread()); 111 DCHECK(CalledOnValidThread());
105 if (!created_profile_helper_) 112 if (!created_profile_helper_)
106 CreateProfileHelper(); 113 CreateProfileHelper();
107 return profile_helper_.get(); 114 return profile_helper_.get();
108 } 115 }
109 116
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 BrowserProcessPlatformPart::CreateBrowserPolicyConnector() { 153 BrowserProcessPlatformPart::CreateBrowserPolicyConnector() {
147 return scoped_ptr<policy::BrowserPolicyConnector>( 154 return scoped_ptr<policy::BrowserPolicyConnector>(
148 new policy::BrowserPolicyConnectorChromeOS()); 155 new policy::BrowserPolicyConnectorChromeOS());
149 } 156 }
150 157
151 void BrowserProcessPlatformPart::CreateProfileHelper() { 158 void BrowserProcessPlatformPart::CreateProfileHelper() {
152 DCHECK(!created_profile_helper_ && profile_helper_.get() == NULL); 159 DCHECK(!created_profile_helper_ && profile_helper_.get() == NULL);
153 created_profile_helper_ = true; 160 created_profile_helper_ = true;
154 profile_helper_.reset(new chromeos::ProfileHelper()); 161 profile_helper_.reset(new chromeos::ProfileHelper());
155 } 162 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_platform_part_chromeos.h ('k') | chrome/browser/chromeos/memory/oom_priority_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698