OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 class URLRequest; | 23 class URLRequest; |
24 } | 24 } |
25 | 25 |
26 namespace content { | 26 namespace content { |
27 class ResourceThrottle; | 27 class ResourceThrottle; |
28 } | 28 } |
29 | 29 |
30 namespace component_updater { | 30 namespace component_updater { |
31 | 31 |
32 class OnDemandTester; | 32 class OnDemandTester; |
| 33 class ComponentPatcher; |
33 | 34 |
34 // Component specific installers must derive from this class and implement | 35 // Component specific installers must derive from this class and implement |
35 // OnUpdateError() and Install(). A valid instance of this class must be | 36 // OnUpdateError() and Install(). A valid instance of this class must be |
36 // given to ComponentUpdateService::RegisterComponent(). | 37 // given to ComponentUpdateService::RegisterComponent(). |
37 class ComponentInstaller { | 38 class ComponentInstaller { |
38 public : | 39 public : |
39 // Called by the component updater on the UI thread when there was a | 40 // Called by the component updater on the UI thread when there was a |
40 // problem unpacking or verifying the component. |error| is a non-zero | 41 // problem unpacking or verifying the component. |error| is a non-zero |
41 // value which is only meaningful to the component updater. | 42 // value which is only meaningful to the component updater. |
42 virtual void OnUpdateError(int error) = 0; | 43 virtual void OnUpdateError(int error) = 0; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // pings are disabled. | 171 // pings are disabled. |
171 virtual GURL PingUrl() = 0; | 172 virtual GURL PingUrl() = 0; |
172 // Parameters added to each url request. It can be null if none are needed. | 173 // Parameters added to each url request. It can be null if none are needed. |
173 virtual std::string ExtraRequestParams() = 0; | 174 virtual std::string ExtraRequestParams() = 0; |
174 // How big each update request can be. Don't go above 2000. | 175 // How big each update request can be. Don't go above 2000. |
175 virtual size_t UrlSizeLimit() = 0; | 176 virtual size_t UrlSizeLimit() = 0; |
176 // The source of contexts for all the url requests. | 177 // The source of contexts for all the url requests. |
177 virtual net::URLRequestContextGetter* RequestContext() = 0; | 178 virtual net::URLRequestContextGetter* RequestContext() = 0; |
178 // True means that all ops are performed in this process. | 179 // True means that all ops are performed in this process. |
179 virtual bool InProcess() = 0; | 180 virtual bool InProcess() = 0; |
| 181 // Creates a new ComponentPatcher in a platform-specific way. This is useful |
| 182 // for dependency injection. |
| 183 virtual ComponentPatcher* CreateComponentPatcher() = 0; |
180 // True means that this client can handle delta updates. | 184 // True means that this client can handle delta updates. |
181 virtual bool DeltasEnabled() const = 0; | 185 virtual bool DeltasEnabled() const = 0; |
182 // True means that the background downloader can be used for downloading | 186 // True means that the background downloader can be used for downloading |
183 // non on-demand components. | 187 // non on-demand components. |
184 virtual bool UseBackgroundDownloader() const = 0; | 188 virtual bool UseBackgroundDownloader() const = 0; |
185 }; | 189 }; |
186 | 190 |
187 // Start doing update checks and installing new versions of registered | 191 // Start doing update checks and installing new versions of registered |
188 // components after Configurator::InitialDelay() seconds. | 192 // components after Configurator::InitialDelay() seconds. |
189 virtual Status Start() = 0; | 193 virtual Status Start() = 0; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 }; | 225 }; |
222 | 226 |
223 // Creates the component updater. You must pass a valid |config| allocated on | 227 // Creates the component updater. You must pass a valid |config| allocated on |
224 // the heap which the component updater will own. | 228 // the heap which the component updater will own. |
225 ComponentUpdateService* ComponentUpdateServiceFactory( | 229 ComponentUpdateService* ComponentUpdateServiceFactory( |
226 ComponentUpdateService::Configurator* config); | 230 ComponentUpdateService::Configurator* config); |
227 | 231 |
228 } // namespace component_updater | 232 } // namespace component_updater |
229 | 233 |
230 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 234 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
OLD | NEW |