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 // This interface is for managing the global services of the application. Each | 5 // This interface is for managing the global services of the application. Each |
6 // service is lazily created when requested the first time. The service getters | 6 // service is lazily created when requested the first time. The service getters |
7 // will return NULL if the service is not available, so callers must check for | 7 // will return NULL if the service is not available, so callers must check for |
8 // this condition. | 8 // this condition. |
9 | 9 |
10 #ifndef CHROME_BROWSER_BROWSER_PROCESS_H_ | 10 #ifndef CHROME_BROWSER_BROWSER_PROCESS_H_ |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 } | 111 } |
112 | 112 |
113 namespace rappor { | 113 namespace rappor { |
114 class RapporServiceImpl; | 114 class RapporServiceImpl; |
115 } | 115 } |
116 | 116 |
117 namespace safe_browsing { | 117 namespace safe_browsing { |
118 class ClientSideDetectionService; | 118 class ClientSideDetectionService; |
119 } | 119 } |
120 | 120 |
121 namespace ukm { | |
122 class UkmService; | |
123 } | |
124 | |
121 // NOT THREAD SAFE, call only from the main thread. | 125 // NOT THREAD SAFE, call only from the main thread. |
122 // These functions shouldn't return NULL unless otherwise noted. | 126 // These functions shouldn't return NULL unless otherwise noted. |
123 class BrowserProcess { | 127 class BrowserProcess { |
124 public: | 128 public: |
125 BrowserProcess(); | 129 BrowserProcess(); |
126 virtual ~BrowserProcess(); | 130 virtual ~BrowserProcess(); |
127 | 131 |
128 // Called when the ResourceDispatcherHost object is created by content. | 132 // Called when the ResourceDispatcherHost object is created by content. |
129 virtual void ResourceDispatcherHostCreated() = 0; | 133 virtual void ResourceDispatcherHostCreated() = 0; |
130 | 134 |
131 // Invoked when the user is logging out/shutting down. When logging off we may | 135 // Invoked when the user is logging out/shutting down. When logging off we may |
132 // not have enough time to do a normal shutdown. This method is invoked prior | 136 // not have enough time to do a normal shutdown. This method is invoked prior |
133 // to normal shutdown and saves any state that must be saved before we are | 137 // to normal shutdown and saves any state that must be saved before we are |
134 // continue shutdown. | 138 // continue shutdown. |
135 virtual void EndSession() = 0; | 139 virtual void EndSession() = 0; |
136 | 140 |
137 // Gets the manager for the various metrics-related services, constructing it | 141 // Gets the manager for the various metrics-related services, constructing it |
138 // if necessary. | 142 // if necessary. |
139 virtual metrics_services_manager::MetricsServicesManager* | 143 virtual metrics_services_manager::MetricsServicesManager* |
140 GetMetricsServicesManager() = 0; | 144 GetMetricsServicesManager() = 0; |
141 | 145 |
142 // Services: any of these getters may return NULL | 146 // Services: any of these getters may return NULL |
143 virtual metrics::MetricsService* metrics_service() = 0; | 147 virtual metrics::MetricsService* metrics_service() = 0; |
144 virtual rappor::RapporServiceImpl* rappor_service() = 0; | 148 virtual rappor::RapporServiceImpl* rappor_service() = 0; |
149 virtual ukm::UkmService* ukm_service() = 0; | |
sky
2017/01/24 22:38:01
Can you outline why we need both GetMetricsService
oystein (OOO til 10th of July)
2017/01/24 22:44:16
I followed the example of rappor_service() and var
| |
145 virtual ProfileManager* profile_manager() = 0; | 150 virtual ProfileManager* profile_manager() = 0; |
146 virtual PrefService* local_state() = 0; | 151 virtual PrefService* local_state() = 0; |
147 virtual net::URLRequestContextGetter* system_request_context() = 0; | 152 virtual net::URLRequestContextGetter* system_request_context() = 0; |
148 virtual variations::VariationsService* variations_service() = 0; | 153 virtual variations::VariationsService* variations_service() = 0; |
149 | 154 |
150 virtual BrowserProcessPlatformPart* platform_part() = 0; | 155 virtual BrowserProcessPlatformPart* platform_part() = 0; |
151 | 156 |
152 virtual extensions::EventRouterForwarder* | 157 virtual extensions::EventRouterForwarder* |
153 extension_event_router_forwarder() = 0; | 158 extension_event_router_forwarder() = 0; |
154 | 159 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 // Returns the Physical Web data source. | 289 // Returns the Physical Web data source. |
285 virtual physical_web::PhysicalWebDataSource* GetPhysicalWebDataSource() = 0; | 290 virtual physical_web::PhysicalWebDataSource* GetPhysicalWebDataSource() = 0; |
286 | 291 |
287 private: | 292 private: |
288 DISALLOW_COPY_AND_ASSIGN(BrowserProcess); | 293 DISALLOW_COPY_AND_ASSIGN(BrowserProcess); |
289 }; | 294 }; |
290 | 295 |
291 extern BrowserProcess* g_browser_process; | 296 extern BrowserProcess* g_browser_process; |
292 | 297 |
293 #endif // CHROME_BROWSER_BROWSER_PROCESS_H_ | 298 #endif // CHROME_BROWSER_BROWSER_PROCESS_H_ |
OLD | NEW |