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