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 #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 |
11 #include "base/version.h" | 11 #include "base/version.h" |
12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class DictionaryValue; | 15 class DictionaryValue; |
16 class FilePath; | 16 class FilePath; |
17 } | 17 } |
18 | 18 |
19 namespace net { | 19 namespace net { |
20 class URLRequestContextGetter; | 20 class URLRequestContextGetter; |
| 21 class URLRequest; |
| 22 } |
| 23 |
| 24 namespace content { |
| 25 class ResourceThrottle; |
21 } | 26 } |
22 | 27 |
23 class ComponentPatcher; | 28 class ComponentPatcher; |
24 | 29 |
25 // Component specific installers must derive from this class and implement | 30 // Component specific installers must derive from this class and implement |
26 // OnUpdateError() and Install(). A valid instance of this class must be | 31 // OnUpdateError() and Install(). A valid instance of this class must be |
27 // given to ComponentUpdateService::RegisterComponent(). | 32 // given to ComponentUpdateService::RegisterComponent(). |
28 class ComponentInstaller { | 33 class ComponentInstaller { |
29 public : | 34 public : |
30 // Called by the component updater on the UI thread when there was a | 35 // Called by the component updater on the UI thread when there was a |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 // There is no guarantee that the item will actually be updated, | 190 // There is no guarantee that the item will actually be updated, |
186 // since another item may be chosen to be updated. Since there is | 191 // since another item may be chosen to be updated. Since there is |
187 // no time guarantee, there is no notification if the item is not updated. | 192 // no time guarantee, there is no notification if the item is not updated. |
188 // However, the ComponentInstaller should know if an update succeeded | 193 // However, the ComponentInstaller should know if an update succeeded |
189 // via the Install() hook. | 194 // via the Install() hook. |
190 virtual Status CheckForUpdateSoon(const std::string& component_id) = 0; | 195 virtual Status CheckForUpdateSoon(const std::string& component_id) = 0; |
191 | 196 |
192 // Returns a list of registered components. | 197 // Returns a list of registered components. |
193 virtual void GetComponents(std::vector<CrxComponentInfo>* components) = 0; | 198 virtual void GetComponents(std::vector<CrxComponentInfo>* components) = 0; |
194 | 199 |
| 200 // Returns a resource throttler. It imeans that a component will be downloaded |
| 201 // and installed before the resource is untrottled. Note that is this called |
| 202 // from the IO thread. |
| 203 virtual content::ResourceThrottle* GetResourceThrottle( |
| 204 net::URLRequest* request, const char* crx_id) = 0; |
| 205 |
195 virtual ~ComponentUpdateService() {} | 206 virtual ~ComponentUpdateService() {} |
196 }; | 207 }; |
197 | 208 |
198 // Creates the component updater. You must pass a valid |config| allocated on | 209 // Creates the component updater. You must pass a valid |config| allocated on |
199 // the heap which the component updater will own. | 210 // the heap which the component updater will own. |
200 ComponentUpdateService* ComponentUpdateServiceFactory( | 211 ComponentUpdateService* ComponentUpdateServiceFactory( |
201 ComponentUpdateService::Configurator* config); | 212 ComponentUpdateService::Configurator* config); |
202 | 213 |
203 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 214 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
OLD | NEW |