| 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/browser_process_impl.h" | 5 #include "chrome/browser/browser_process_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 #endif | 154 #endif |
| 155 | 155 |
| 156 #if defined(USE_X11) || defined(OS_WIN) || defined(USE_OZONE) | 156 #if defined(USE_X11) || defined(OS_WIN) || defined(USE_OZONE) |
| 157 // How long to wait for the File thread to complete during EndSession, on Linux | 157 // How long to wait for the File thread to complete during EndSession, on Linux |
| 158 // and Windows. We have a timeout here because we're unable to run the UI | 158 // and Windows. We have a timeout here because we're unable to run the UI |
| 159 // messageloop and there's some deadlock risk. Our only option is to exit | 159 // messageloop and there's some deadlock risk. Our only option is to exit |
| 160 // anyway. | 160 // anyway. |
| 161 static const int kEndSessionTimeoutSeconds = 10; | 161 static const int kEndSessionTimeoutSeconds = 10; |
| 162 #endif | 162 #endif |
| 163 | 163 |
| 164 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 165 #include "chrome/browser/chrome_webusb_browser_client.h" |
| 166 #endif |
| 167 |
| 164 using content::BrowserThread; | 168 using content::BrowserThread; |
| 165 using content::ChildProcessSecurityPolicy; | 169 using content::ChildProcessSecurityPolicy; |
| 166 using content::PluginService; | 170 using content::PluginService; |
| 167 using content::ResourceDispatcherHost; | 171 using content::ResourceDispatcherHost; |
| 168 | 172 |
| 169 BrowserProcessImpl::BrowserProcessImpl( | 173 BrowserProcessImpl::BrowserProcessImpl( |
| 170 base::SequencedTaskRunner* local_state_task_runner, | 174 base::SequencedTaskRunner* local_state_task_runner, |
| 171 const base::CommandLine& command_line) | 175 const base::CommandLine& command_line) |
| 172 : created_watchdog_thread_(false), | 176 : created_watchdog_thread_(false), |
| 173 created_browser_policy_connector_(false), | 177 created_browser_policy_connector_(false), |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 222 |
| 219 extensions_browser_client_.reset( | 223 extensions_browser_client_.reset( |
| 220 new extensions::ChromeExtensionsBrowserClient); | 224 new extensions::ChromeExtensionsBrowserClient); |
| 221 extensions::ExtensionsBrowserClient::Set(extensions_browser_client_.get()); | 225 extensions::ExtensionsBrowserClient::Set(extensions_browser_client_.get()); |
| 222 #endif | 226 #endif |
| 223 | 227 |
| 224 message_center::MessageCenter::Initialize(); | 228 message_center::MessageCenter::Initialize(); |
| 225 | 229 |
| 226 update_client::UpdateQueryParams::SetDelegate( | 230 update_client::UpdateQueryParams::SetDelegate( |
| 227 ChromeUpdateQueryParamsDelegate::GetInstance()); | 231 ChromeUpdateQueryParamsDelegate::GetInstance()); |
| 232 |
| 233 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 234 webusb::WebUsbBrowserClient::Set(new ChromeWebUsbBrowserClient()); |
| 235 #endif |
| 228 } | 236 } |
| 229 | 237 |
| 230 BrowserProcessImpl::~BrowserProcessImpl() { | 238 BrowserProcessImpl::~BrowserProcessImpl() { |
| 231 tracked_objects::ThreadData::EnsureCleanupWasCalled(4); | 239 tracked_objects::ThreadData::EnsureCleanupWasCalled(4); |
| 232 | 240 |
| 233 g_browser_process = NULL; | 241 g_browser_process = NULL; |
| 234 } | 242 } |
| 235 | 243 |
| 236 void BrowserProcessImpl::StartTearDown() { | 244 void BrowserProcessImpl::StartTearDown() { |
| 237 TRACE_EVENT0("shutdown", "BrowserProcessImpl::StartTearDown"); | 245 TRACE_EVENT0("shutdown", "BrowserProcessImpl::StartTearDown"); |
| (...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1250 } | 1258 } |
| 1251 | 1259 |
| 1252 void BrowserProcessImpl::OnAutoupdateTimer() { | 1260 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1253 if (CanAutorestartForUpdate()) { | 1261 if (CanAutorestartForUpdate()) { |
| 1254 DLOG(WARNING) << "Detected update. Restarting browser."; | 1262 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1255 RestartBackgroundInstance(); | 1263 RestartBackgroundInstance(); |
| 1256 } | 1264 } |
| 1257 } | 1265 } |
| 1258 | 1266 |
| 1259 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1267 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |