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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 #include "content/public/browser/child_process_security_policy.h" | 111 #include "content/public/browser/child_process_security_policy.h" |
112 #include "content/public/browser/notification_details.h" | 112 #include "content/public/browser/notification_details.h" |
113 #include "content/public/browser/plugin_service.h" | 113 #include "content/public/browser/plugin_service.h" |
114 #include "content/public/browser/render_process_host.h" | 114 #include "content/public/browser/render_process_host.h" |
115 #include "content/public/browser/resource_dispatcher_host.h" | 115 #include "content/public/browser/resource_dispatcher_host.h" |
116 #include "content/public/browser/service_worker_context.h" | 116 #include "content/public/browser/service_worker_context.h" |
117 #include "content/public/browser/storage_partition.h" | 117 #include "content/public/browser/storage_partition.h" |
118 #include "content/public/common/content_switches.h" | 118 #include "content/public/common/content_switches.h" |
119 #include "extensions/common/constants.h" | 119 #include "extensions/common/constants.h" |
120 #include "extensions/features/features.h" | 120 #include "extensions/features/features.h" |
| 121 #include "media/media_features.h" |
121 #include "net/socket/client_socket_pool_manager.h" | 122 #include "net/socket/client_socket_pool_manager.h" |
122 #include "net/url_request/url_request_context_getter.h" | 123 #include "net/url_request/url_request_context_getter.h" |
123 #include "ppapi/features/features.h" | 124 #include "ppapi/features/features.h" |
124 #include "printing/features/features.h" | 125 #include "printing/features/features.h" |
125 #include "ui/base/idle/idle.h" | 126 #include "ui/base/idle/idle.h" |
126 #include "ui/base/l10n/l10n_util.h" | 127 #include "ui/base/l10n/l10n_util.h" |
127 #include "ui/message_center/message_center.h" | 128 #include "ui/message_center/message_center.h" |
128 | 129 |
129 #if defined(OS_WIN) | 130 #if defined(OS_WIN) |
130 #include "base/win/windows_version.h" | 131 #include "base/win/windows_version.h" |
(...skipping 24 matching lines...) Expand all Loading... |
155 #endif | 156 #endif |
156 | 157 |
157 #if !defined(DISABLE_NACL) | 158 #if !defined(DISABLE_NACL) |
158 #include "chrome/browser/component_updater/pnacl_component_installer.h" | 159 #include "chrome/browser/component_updater/pnacl_component_installer.h" |
159 #endif | 160 #endif |
160 | 161 |
161 #if BUILDFLAG(ENABLE_PLUGIN_INSTALLATION) | 162 #if BUILDFLAG(ENABLE_PLUGIN_INSTALLATION) |
162 #include "chrome/browser/plugins/plugins_resource_service.h" | 163 #include "chrome/browser/plugins/plugins_resource_service.h" |
163 #endif | 164 #endif |
164 | 165 |
165 #if defined(ENABLE_WEBRTC) | 166 #if BUILDFLAG(ENABLE_WEBRTC) |
166 #include "chrome/browser/media/webrtc/webrtc_log_uploader.h" | 167 #include "chrome/browser/media/webrtc/webrtc_log_uploader.h" |
167 #endif | 168 #endif |
168 | 169 |
169 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) | 170 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) |
170 #include "chrome/browser/memory/tab_manager.h" | 171 #include "chrome/browser/memory/tab_manager.h" |
171 #endif | 172 #endif |
172 | 173 |
173 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) | 174 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) |
174 #include "chrome/browser/first_run/upgrade_util.h" | 175 #include "chrome/browser/first_run/upgrade_util.h" |
175 #endif | 176 #endif |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 | 347 |
347 // The |gcm_driver_| must shut down while the IO thread is still alive. | 348 // The |gcm_driver_| must shut down while the IO thread is still alive. |
348 if (gcm_driver_) | 349 if (gcm_driver_) |
349 gcm_driver_->Shutdown(); | 350 gcm_driver_->Shutdown(); |
350 | 351 |
351 // Stop the watchdog thread before stopping other threads. | 352 // Stop the watchdog thread before stopping other threads. |
352 watchdog_thread_.reset(); | 353 watchdog_thread_.reset(); |
353 | 354 |
354 platform_part()->StartTearDown(); | 355 platform_part()->StartTearDown(); |
355 | 356 |
356 #if defined(ENABLE_WEBRTC) | 357 #if BUILDFLAG(ENABLE_WEBRTC) |
357 // Cancel any uploads to release the system url request context references. | 358 // Cancel any uploads to release the system url request context references. |
358 if (webrtc_log_uploader_) | 359 if (webrtc_log_uploader_) |
359 webrtc_log_uploader_->StartShutdown(); | 360 webrtc_log_uploader_->StartShutdown(); |
360 #endif | 361 #endif |
361 | 362 |
362 if (local_state()) | 363 if (local_state()) |
363 local_state()->CommitPendingWrite(); | 364 local_state()->CommitPendingWrite(); |
364 } | 365 } |
365 | 366 |
366 void BrowserProcessImpl::PostDestroyThreads() { | 367 void BrowserProcessImpl::PostDestroyThreads() { |
367 // With the file_thread_ flushed, we can release any icon resources. | 368 // With the file_thread_ flushed, we can release any icon resources. |
368 icon_manager_.reset(); | 369 icon_manager_.reset(); |
369 | 370 |
370 #if defined(ENABLE_WEBRTC) | 371 #if BUILDFLAG(ENABLE_WEBRTC) |
371 // Must outlive the file thread. | 372 // Must outlive the file thread. |
372 webrtc_log_uploader_.reset(); | 373 webrtc_log_uploader_.reset(); |
373 #endif | 374 #endif |
374 | 375 |
375 // Reset associated state right after actual thread is stopped, | 376 // Reset associated state right after actual thread is stopped, |
376 // as io_thread_.global_ cleanup happens in CleanUp on the IO | 377 // as io_thread_.global_ cleanup happens in CleanUp on the IO |
377 // thread, i.e. as the thread exits its message loop. | 378 // thread, i.e. as the thread exits its message loop. |
378 // | 379 // |
379 // This is important also because in various places, the | 380 // This is important also because in various places, the |
380 // IOThread object being NULL is considered synonymous with the | 381 // IOThread object being NULL is considered synonymous with the |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 return media_file_system_registry_.get(); | 739 return media_file_system_registry_.get(); |
739 #else | 740 #else |
740 return NULL; | 741 return NULL; |
741 #endif | 742 #endif |
742 } | 743 } |
743 | 744 |
744 bool BrowserProcessImpl::created_local_state() const { | 745 bool BrowserProcessImpl::created_local_state() const { |
745 return created_local_state_; | 746 return created_local_state_; |
746 } | 747 } |
747 | 748 |
748 #if defined(ENABLE_WEBRTC) | 749 #if BUILDFLAG(ENABLE_WEBRTC) |
749 WebRtcLogUploader* BrowserProcessImpl::webrtc_log_uploader() { | 750 WebRtcLogUploader* BrowserProcessImpl::webrtc_log_uploader() { |
750 if (!webrtc_log_uploader_.get()) | 751 if (!webrtc_log_uploader_.get()) |
751 webrtc_log_uploader_.reset(new WebRtcLogUploader()); | 752 webrtc_log_uploader_.reset(new WebRtcLogUploader()); |
752 return webrtc_log_uploader_.get(); | 753 return webrtc_log_uploader_.get(); |
753 } | 754 } |
754 #endif | 755 #endif |
755 | 756 |
756 network_time::NetworkTimeTracker* BrowserProcessImpl::network_time_tracker() { | 757 network_time::NetworkTimeTracker* BrowserProcessImpl::network_time_tracker() { |
757 if (!network_time_tracker_) { | 758 if (!network_time_tracker_) { |
758 network_time_tracker_.reset(new network_time::NetworkTimeTracker( | 759 network_time_tracker_.reset(new network_time::NetworkTimeTracker( |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1401 } | 1402 } |
1402 | 1403 |
1403 void BrowserProcessImpl::OnAutoupdateTimer() { | 1404 void BrowserProcessImpl::OnAutoupdateTimer() { |
1404 if (CanAutorestartForUpdate()) { | 1405 if (CanAutorestartForUpdate()) { |
1405 DLOG(WARNING) << "Detected update. Restarting browser."; | 1406 DLOG(WARNING) << "Detected update. Restarting browser."; |
1406 RestartBackgroundInstance(); | 1407 RestartBackgroundInstance(); |
1407 } | 1408 } |
1408 } | 1409 } |
1409 | 1410 |
1410 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1411 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |