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 <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 #elif defined(OS_MACOSX) | 107 #elif defined(OS_MACOSX) |
108 #include "chrome/browser/chrome_browser_main_mac.h" | 108 #include "chrome/browser/chrome_browser_main_mac.h" |
109 #endif | 109 #endif |
110 | 110 |
111 #if defined(USE_AURA) | 111 #if defined(USE_AURA) |
112 #include "ui/aura/env.h" | 112 #include "ui/aura/env.h" |
113 #endif | 113 #endif |
114 | 114 |
115 #if defined(OS_CHROMEOS) | 115 #if defined(OS_CHROMEOS) |
116 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" | 116 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" |
| 117 #include "chrome/browser/chromeos/settings/device_oauth2_token_service.h" |
117 #endif // defined(OS_CHROMEOS) | 118 #endif // defined(OS_CHROMEOS) |
118 | 119 |
119 #if defined(ENABLE_PLUGIN_INSTALLATION) | 120 #if defined(ENABLE_PLUGIN_INSTALLATION) |
120 #include "chrome/browser/plugins/plugins_resource_service.h" | 121 #include "chrome/browser/plugins/plugins_resource_service.h" |
121 #endif | 122 #endif |
122 | 123 |
123 #if defined(OS_MACOSX) | 124 #if defined(OS_MACOSX) |
124 #include "apps/app_shim/app_shim_host_manager_mac.h" | 125 #include "apps/app_shim/app_shim_host_manager_mac.h" |
125 #endif | 126 #endif |
126 | 127 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 | 268 |
268 #if defined(USE_AURA) | 269 #if defined(USE_AURA) |
269 // Delete aura after the metrics service has been deleted as it accesses | 270 // Delete aura after the metrics service has been deleted as it accesses |
270 // monitor information. | 271 // monitor information. |
271 aura::Env::DeleteInstance(); | 272 aura::Env::DeleteInstance(); |
272 #endif | 273 #endif |
273 | 274 |
274 #if defined(OS_MACOSX) | 275 #if defined(OS_MACOSX) |
275 app_shim_host_manager_.reset(); | 276 app_shim_host_manager_.reset(); |
276 #endif | 277 #endif |
| 278 |
| 279 #if defined(OS_CHROMEOS) |
| 280 // Terminate any in-flight token requests before the IO thread shuts down. |
| 281 device_oauth2_token_service_.reset(); |
| 282 #endif |
277 } | 283 } |
278 | 284 |
279 void BrowserProcessImpl::PostDestroyThreads() { | 285 void BrowserProcessImpl::PostDestroyThreads() { |
280 // With the file_thread_ flushed, we can release any icon resources. | 286 // With the file_thread_ flushed, we can release any icon resources. |
281 icon_manager_.reset(); | 287 icon_manager_.reset(); |
282 | 288 |
283 // Reset associated state right after actual thread is stopped, | 289 // Reset associated state right after actual thread is stopped, |
284 // as io_thread_.global_ cleanup happens in CleanUp on the IO | 290 // as io_thread_.global_ cleanup happens in CleanUp on the IO |
285 // thread, i.e. as the thread exits its message loop. | 291 // thread, i.e. as the thread exits its message loop. |
286 // | 292 // |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 return variations_service_.get(); | 455 return variations_service_.get(); |
450 } | 456 } |
451 | 457 |
452 #if defined(OS_CHROMEOS) | 458 #if defined(OS_CHROMEOS) |
453 chromeos::OomPriorityManager* BrowserProcessImpl::oom_priority_manager() { | 459 chromeos::OomPriorityManager* BrowserProcessImpl::oom_priority_manager() { |
454 DCHECK(CalledOnValidThread()); | 460 DCHECK(CalledOnValidThread()); |
455 if (!oom_priority_manager_.get()) | 461 if (!oom_priority_manager_.get()) |
456 oom_priority_manager_.reset(new chromeos::OomPriorityManager()); | 462 oom_priority_manager_.reset(new chromeos::OomPriorityManager()); |
457 return oom_priority_manager_.get(); | 463 return oom_priority_manager_.get(); |
458 } | 464 } |
| 465 |
| 466 chromeos::DeviceOAuth2TokenService* |
| 467 BrowserProcessImpl::device_oauth2_token_service() { |
| 468 DCHECK(CalledOnValidThread()); |
| 469 if (!device_oauth2_token_service_.get()) { |
| 470 device_oauth2_token_service_.reset( |
| 471 new chromeos::DeviceOAuth2TokenService(system_request_context(), |
| 472 local_state())); |
| 473 } |
| 474 return device_oauth2_token_service_.get(); |
| 475 } |
459 #endif // defined(OS_CHROMEOS) | 476 #endif // defined(OS_CHROMEOS) |
460 | 477 |
461 extensions::EventRouterForwarder* | 478 extensions::EventRouterForwarder* |
462 BrowserProcessImpl::extension_event_router_forwarder() { | 479 BrowserProcessImpl::extension_event_router_forwarder() { |
463 return extension_event_router_forwarder_.get(); | 480 return extension_event_router_forwarder_.get(); |
464 } | 481 } |
465 | 482 |
466 NotificationUIManager* BrowserProcessImpl::notification_ui_manager() { | 483 NotificationUIManager* BrowserProcessImpl::notification_ui_manager() { |
467 DCHECK(CalledOnValidThread()); | 484 DCHECK(CalledOnValidThread()); |
468 if (!created_notification_ui_manager_) | 485 if (!created_notification_ui_manager_) |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 } | 1066 } |
1050 | 1067 |
1051 void BrowserProcessImpl::OnAutoupdateTimer() { | 1068 void BrowserProcessImpl::OnAutoupdateTimer() { |
1052 if (CanAutorestartForUpdate()) { | 1069 if (CanAutorestartForUpdate()) { |
1053 DLOG(WARNING) << "Detected update. Restarting browser."; | 1070 DLOG(WARNING) << "Detected update. Restarting browser."; |
1054 RestartBackgroundInstance(); | 1071 RestartBackgroundInstance(); |
1055 } | 1072 } |
1056 } | 1073 } |
1057 | 1074 |
1058 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1075 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |