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 // When each service is created, we set a flag indicating this. At this point, | 5 // When each service is created, we set a flag indicating this. At this point, |
6 // the service initialization could fail or succeed. This allows us to remember | 6 // the service initialization could fail or succeed. This allows us to remember |
7 // if we tried to create a service, and not try creating it over and over if | 7 // if we tried to create a service, and not try creating it over and over if |
8 // the creation failed. | 8 // the creation failed. |
9 | 9 |
10 #ifndef CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ | 10 #ifndef CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 class PolicyService; | 50 class PolicyService; |
51 }; | 51 }; |
52 | 52 |
53 // Real implementation of BrowserProcess that creates and returns the services. | 53 // Real implementation of BrowserProcess that creates and returns the services. |
54 class BrowserProcessImpl : public BrowserProcess, | 54 class BrowserProcessImpl : public BrowserProcess, |
55 public base::NonThreadSafe { | 55 public base::NonThreadSafe { |
56 public: | 56 public: |
57 // |local_state_task_runner| must be a shutdown-blocking task runner. | 57 // |local_state_task_runner| must be a shutdown-blocking task runner. |
58 BrowserProcessImpl(base::SequencedTaskRunner* local_state_task_runner, | 58 BrowserProcessImpl(base::SequencedTaskRunner* local_state_task_runner, |
59 const base::CommandLine& command_line); | 59 const base::CommandLine& command_line); |
60 virtual ~BrowserProcessImpl(); | 60 ~BrowserProcessImpl() override; |
61 | 61 |
62 // Called before the browser threads are created. | 62 // Called before the browser threads are created. |
63 void PreCreateThreads(); | 63 void PreCreateThreads(); |
64 | 64 |
65 // Called after the threads have been created but before the message loops | 65 // Called after the threads have been created but before the message loops |
66 // starts running. Allows the browser process to do any initialization that | 66 // starts running. Allows the browser process to do any initialization that |
67 // requires all threads running. | 67 // requires all threads running. |
68 void PreMainMessageLoopRun(); | 68 void PreMainMessageLoopRun(); |
69 | 69 |
70 // Most cleanup is done by these functions, driven from | 70 // Most cleanup is done by these functions, driven from |
71 // ChromeBrowserMain based on notifications from the content | 71 // ChromeBrowserMain based on notifications from the content |
72 // framework, rather than in the destructor, so that we can | 72 // framework, rather than in the destructor, so that we can |
73 // interleave cleanup with threads being stopped. | 73 // interleave cleanup with threads being stopped. |
74 void StartTearDown(); | 74 void StartTearDown(); |
75 void PostDestroyThreads(); | 75 void PostDestroyThreads(); |
76 | 76 |
77 // BrowserProcess implementation. | 77 // BrowserProcess implementation. |
78 virtual void ResourceDispatcherHostCreated() override; | 78 void ResourceDispatcherHostCreated() override; |
79 virtual void EndSession() override; | 79 void EndSession() override; |
80 virtual MetricsServicesManager* GetMetricsServicesManager() override; | 80 MetricsServicesManager* GetMetricsServicesManager() override; |
81 virtual metrics::MetricsService* metrics_service() override; | 81 metrics::MetricsService* metrics_service() override; |
82 virtual rappor::RapporService* rappor_service() override; | 82 rappor::RapporService* rappor_service() override; |
83 virtual IOThread* io_thread() override; | 83 IOThread* io_thread() override; |
84 virtual WatchDogThread* watchdog_thread() override; | 84 WatchDogThread* watchdog_thread() override; |
85 virtual ProfileManager* profile_manager() override; | 85 ProfileManager* profile_manager() override; |
86 virtual PrefService* local_state() override; | 86 PrefService* local_state() override; |
87 virtual net::URLRequestContextGetter* system_request_context() override; | 87 net::URLRequestContextGetter* system_request_context() override; |
88 virtual chrome_variations::VariationsService* variations_service() override; | 88 chrome_variations::VariationsService* variations_service() override; |
89 virtual BrowserProcessPlatformPart* platform_part() override; | 89 BrowserProcessPlatformPart* platform_part() override; |
90 virtual extensions::EventRouterForwarder* | 90 extensions::EventRouterForwarder* extension_event_router_forwarder() override; |
91 extension_event_router_forwarder() override; | 91 NotificationUIManager* notification_ui_manager() override; |
92 virtual NotificationUIManager* notification_ui_manager() override; | 92 message_center::MessageCenter* message_center() override; |
93 virtual message_center::MessageCenter* message_center() override; | 93 policy::BrowserPolicyConnector* browser_policy_connector() override; |
94 virtual policy::BrowserPolicyConnector* browser_policy_connector() override; | 94 policy::PolicyService* policy_service() override; |
95 virtual policy::PolicyService* policy_service() override; | 95 IconManager* icon_manager() override; |
96 virtual IconManager* icon_manager() override; | 96 GLStringManager* gl_string_manager() override; |
97 virtual GLStringManager* gl_string_manager() override; | 97 GpuModeManager* gpu_mode_manager() override; |
98 virtual GpuModeManager* gpu_mode_manager() override; | 98 void CreateDevToolsHttpProtocolHandler( |
99 virtual void CreateDevToolsHttpProtocolHandler( | |
100 chrome::HostDesktopType host_desktop_type, | 99 chrome::HostDesktopType host_desktop_type, |
101 const std::string& ip, | 100 const std::string& ip, |
102 int port) override; | 101 int port) override; |
103 virtual unsigned int AddRefModule() override; | 102 unsigned int AddRefModule() override; |
104 virtual unsigned int ReleaseModule() override; | 103 unsigned int ReleaseModule() override; |
105 virtual bool IsShuttingDown() override; | 104 bool IsShuttingDown() override; |
106 virtual printing::PrintJobManager* print_job_manager() override; | 105 printing::PrintJobManager* print_job_manager() override; |
107 virtual printing::PrintPreviewDialogController* | 106 printing::PrintPreviewDialogController* print_preview_dialog_controller() |
108 print_preview_dialog_controller() override; | 107 override; |
109 virtual printing::BackgroundPrintingManager* | 108 printing::BackgroundPrintingManager* background_printing_manager() override; |
110 background_printing_manager() override; | 109 IntranetRedirectDetector* intranet_redirect_detector() override; |
111 virtual IntranetRedirectDetector* intranet_redirect_detector() override; | 110 const std::string& GetApplicationLocale() override; |
112 virtual const std::string& GetApplicationLocale() override; | 111 void SetApplicationLocale(const std::string& locale) override; |
113 virtual void SetApplicationLocale(const std::string& locale) override; | 112 DownloadStatusUpdater* download_status_updater() override; |
114 virtual DownloadStatusUpdater* download_status_updater() override; | 113 DownloadRequestLimiter* download_request_limiter() override; |
115 virtual DownloadRequestLimiter* download_request_limiter() override; | 114 BackgroundModeManager* background_mode_manager() override; |
116 virtual BackgroundModeManager* background_mode_manager() override; | 115 void set_background_mode_manager_for_test( |
117 virtual void set_background_mode_manager_for_test( | |
118 scoped_ptr<BackgroundModeManager> manager) override; | 116 scoped_ptr<BackgroundModeManager> manager) override; |
119 virtual StatusTray* status_tray() override; | 117 StatusTray* status_tray() override; |
120 virtual SafeBrowsingService* safe_browsing_service() override; | 118 SafeBrowsingService* safe_browsing_service() override; |
121 virtual safe_browsing::ClientSideDetectionService* | 119 safe_browsing::ClientSideDetectionService* safe_browsing_detection_service() |
122 safe_browsing_detection_service() override; | 120 override; |
123 | 121 |
124 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 122 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
125 virtual void StartAutoupdateTimer() override; | 123 virtual void StartAutoupdateTimer() override; |
126 #endif | 124 #endif |
127 | 125 |
128 virtual ChromeNetLog* net_log() override; | 126 ChromeNetLog* net_log() override; |
129 virtual prerender::PrerenderTracker* prerender_tracker() override; | 127 prerender::PrerenderTracker* prerender_tracker() override; |
130 virtual component_updater::ComponentUpdateService* | 128 component_updater::ComponentUpdateService* component_updater() override; |
131 component_updater() override; | 129 CRLSetFetcher* crl_set_fetcher() override; |
132 virtual CRLSetFetcher* crl_set_fetcher() override; | 130 component_updater::PnaclComponentInstaller* pnacl_component_installer() |
133 virtual component_updater::PnaclComponentInstaller* | 131 override; |
134 pnacl_component_installer() override; | 132 MediaFileSystemRegistry* media_file_system_registry() override; |
135 virtual MediaFileSystemRegistry* media_file_system_registry() override; | 133 bool created_local_state() const override; |
136 virtual bool created_local_state() const override; | |
137 #if defined(ENABLE_WEBRTC) | 134 #if defined(ENABLE_WEBRTC) |
138 virtual WebRtcLogUploader* webrtc_log_uploader() override; | 135 WebRtcLogUploader* webrtc_log_uploader() override; |
139 #endif | 136 #endif |
140 virtual network_time::NetworkTimeTracker* network_time_tracker() override; | 137 network_time::NetworkTimeTracker* network_time_tracker() override; |
141 virtual gcm::GCMDriver* gcm_driver() override; | 138 gcm::GCMDriver* gcm_driver() override; |
142 | 139 |
143 static void RegisterPrefs(PrefRegistrySimple* registry); | 140 static void RegisterPrefs(PrefRegistrySimple* registry); |
144 | 141 |
145 private: | 142 private: |
146 void CreateWatchdogThread(); | 143 void CreateWatchdogThread(); |
147 void CreateProfileManager(); | 144 void CreateProfileManager(); |
148 void CreateLocalState(); | 145 void CreateLocalState(); |
149 void CreateViewedPageTracker(); | 146 void CreateViewedPageTracker(); |
150 void CreateIconManager(); | 147 void CreateIconManager(); |
151 void CreateIntranetRedirectDetector(); | 148 void CreateIntranetRedirectDetector(); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 scoped_ptr<gcm::GCMDriver> gcm_driver_; | 301 scoped_ptr<gcm::GCMDriver> gcm_driver_; |
305 | 302 |
306 #if !defined(OS_ANDROID) | 303 #if !defined(OS_ANDROID) |
307 scoped_ptr<ChromeDeviceClient> device_client_; | 304 scoped_ptr<ChromeDeviceClient> device_client_; |
308 #endif | 305 #endif |
309 | 306 |
310 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl); | 307 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl); |
311 }; | 308 }; |
312 | 309 |
313 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ | 310 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ |
OLD | NEW |