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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 | 113 |
114 #if defined(ENABLE_PLUGIN_INSTALLATION) | 114 #if defined(ENABLE_PLUGIN_INSTALLATION) |
115 #include "chrome/browser/plugins/plugins_resource_service.h" | 115 #include "chrome/browser/plugins/plugins_resource_service.h" |
116 #endif | 116 #endif |
117 | 117 |
118 #if defined(OS_MACOSX) | 118 #if defined(OS_MACOSX) |
119 #include "apps/app_shim/app_shim_host_manager_mac.h" | 119 #include "apps/app_shim/app_shim_host_manager_mac.h" |
120 #include "chrome/browser/ui/app_list/app_list_service.h" | 120 #include "chrome/browser/ui/app_list/app_list_service.h" |
121 #endif | 121 #endif |
122 | 122 |
123 #if defined(ENABLE_WEBRTC) | |
124 #include "components/webrtc_log_uploader/webrtc_log_uploader.h" | |
125 #endif | |
126 | |
123 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 127 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
124 // How often to check if the persistent instance of Chrome needs to restart | 128 // How often to check if the persistent instance of Chrome needs to restart |
125 // to install an update. | 129 // to install an update. |
126 static const int kUpdateCheckIntervalHours = 6; | 130 static const int kUpdateCheckIntervalHours = 6; |
127 #endif | 131 #endif |
128 | 132 |
129 #if defined(OS_WIN) | 133 #if defined(OS_WIN) |
130 // Attest to the fact that the call to the file thread to save preferences has | 134 // Attest to the fact that the call to the file thread to save preferences has |
131 // run, and it is safe to terminate. This avoids the potential of some other | 135 // run, and it is safe to terminate. This avoids the potential of some other |
132 // task prematurely terminating our waiting message loop by posting a | 136 // task prematurely terminating our waiting message loop by posting a |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
623 if (!media_file_system_registry_) | 627 if (!media_file_system_registry_) |
624 media_file_system_registry_.reset(new chrome::MediaFileSystemRegistry()); | 628 media_file_system_registry_.reset(new chrome::MediaFileSystemRegistry()); |
625 return media_file_system_registry_.get(); | 629 return media_file_system_registry_.get(); |
626 #endif | 630 #endif |
627 } | 631 } |
628 | 632 |
629 bool BrowserProcessImpl::created_local_state() const { | 633 bool BrowserProcessImpl::created_local_state() const { |
630 return created_local_state_; | 634 return created_local_state_; |
631 } | 635 } |
632 | 636 |
637 #if defined(ENABLE_WEBRTC) | |
638 components::WebRtcLogUploader* BrowserProcessImpl::webrtc_log_uploader() { | |
639 return webrtc_log_uploader_.get(); | |
640 } | |
641 #endif | |
642 | |
633 // static | 643 // static |
634 void BrowserProcessImpl::RegisterPrefs(PrefRegistrySimple* registry) { | 644 void BrowserProcessImpl::RegisterPrefs(PrefRegistrySimple* registry) { |
635 registry->RegisterBooleanPref(prefs::kDefaultBrowserSettingEnabled, | 645 registry->RegisterBooleanPref(prefs::kDefaultBrowserSettingEnabled, |
636 false); | 646 false); |
637 // This policy needs to be defined before the net subsystem is initialized, | 647 // This policy needs to be defined before the net subsystem is initialized, |
638 // so we do it here. | 648 // so we do it here. |
639 registry->RegisterIntegerPref(prefs::kMaxConnectionsPerProxy, | 649 registry->RegisterIntegerPref(prefs::kMaxConnectionsPerProxy, |
640 net::kDefaultMaxSocketsPerProxyServer); | 650 net::kDefaultMaxSocketsPerProxyServer); |
641 | 651 |
642 // This is observed by ChildProcessSecurityPolicy, which lives in content/ | 652 // This is observed by ChildProcessSecurityPolicy, which lives in content/ |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
897 if (browser_defaults::bookmarks_enabled && | 907 if (browser_defaults::bookmarks_enabled && |
898 BookmarkPromptController::IsEnabled()) { | 908 BookmarkPromptController::IsEnabled()) { |
899 bookmark_prompt_controller_.reset(new BookmarkPromptController()); | 909 bookmark_prompt_controller_.reset(new BookmarkPromptController()); |
900 } | 910 } |
901 #endif | 911 #endif |
902 | 912 |
903 #if defined(OS_MACOSX) | 913 #if defined(OS_MACOSX) |
904 app_shim_host_manager_.reset(new AppShimHostManager); | 914 app_shim_host_manager_.reset(new AppShimHostManager); |
905 AppListService::InitAll(NULL); | 915 AppListService::InitAll(NULL); |
906 #endif | 916 #endif |
917 | |
918 #if defined(ENABLE_WEBRTC) | |
919 webrtc_log_uploader_.reset(new components::WebRtcLogUploader()); | |
Jói
2013/05/24 21:14:06
Suggest constructing only on demand (in the access
| |
920 #endif | |
907 } | 921 } |
908 | 922 |
909 void BrowserProcessImpl::CreateIconManager() { | 923 void BrowserProcessImpl::CreateIconManager() { |
910 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); | 924 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); |
911 created_icon_manager_ = true; | 925 created_icon_manager_ = true; |
912 icon_manager_.reset(new IconManager); | 926 icon_manager_.reset(new IconManager); |
913 } | 927 } |
914 | 928 |
915 void BrowserProcessImpl::CreateIntranetRedirectDetector() { | 929 void BrowserProcessImpl::CreateIntranetRedirectDetector() { |
916 DCHECK(intranet_redirect_detector_.get() == NULL); | 930 DCHECK(intranet_redirect_detector_.get() == NULL); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1045 } | 1059 } |
1046 | 1060 |
1047 void BrowserProcessImpl::OnAutoupdateTimer() { | 1061 void BrowserProcessImpl::OnAutoupdateTimer() { |
1048 if (CanAutorestartForUpdate()) { | 1062 if (CanAutorestartForUpdate()) { |
1049 DLOG(WARNING) << "Detected update. Restarting browser."; | 1063 DLOG(WARNING) << "Detected update. Restarting browser."; |
1050 RestartBackgroundInstance(); | 1064 RestartBackgroundInstance(); |
1051 } | 1065 } |
1052 } | 1066 } |
1053 | 1067 |
1054 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1068 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |