Chromium Code Reviews| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 // will not be canceled. | 186 // will not be canceled. |
| 182 virtual Status Stop() = 0; | 187 virtual Status Stop() = 0; |
| 183 | 188 |
| 184 // Add component to be checked for updates. You can call this method | 189 // Add component to be checked for updates. You can call this method |
| 185 // before calling Start(). | 190 // before calling Start(). |
| 186 virtual Status RegisterComponent(const CrxComponent& component) = 0; | 191 virtual Status RegisterComponent(const CrxComponent& component) = 0; |
| 187 | 192 |
| 188 // Returns a list of registered components. | 193 // Returns a list of registered components. |
| 189 virtual void GetComponents(std::vector<CrxComponentInfo>* components) = 0; | 194 virtual void GetComponents(std::vector<CrxComponentInfo>* components) = 0; |
| 190 | 195 |
| 196 // Returns a resource throttler. It imeans that a component will be downloaded | |
|
Sorin Jianu
2013/10/30 21:02:44
imeans
Sorin Jianu
2013/10/30 22:09:13
small nit, maybe say "resource throttle" instead o
cpu_(ooo_6.6-7.5)
2013/10/31 04:38:26
Done.
| |
| 197 // and installed before the resource is untrottled. Note that is this called | |
|
waffles
2013/10/30 21:11:20
also, untrottled -> unthrottled
cpu_(ooo_6.6-7.5)
2013/10/31 04:38:26
Done.
| |
| 198 // from the IO thread. | |
| 199 virtual content::ResourceThrottle* GetResourceThrottle( | |
|
Sorin Jianu
2013/10/30 22:09:13
Since now this is part of the public interface of
cpu_(ooo_6.6-7.5)
2013/10/31 04:38:26
For it to work it requires a fair bit of infrastru
| |
| 200 net::URLRequest* request, const char* crx_id) = 0; | |
| 201 | |
| 191 virtual ~ComponentUpdateService() {} | 202 virtual ~ComponentUpdateService() {} |
| 192 | 203 |
| 193 // TODO(waffles): Remove PNaCl as a friend once an alternative on-demand | 204 // TODO(waffles): Remove PNaCl as a friend once an alternative on-demand |
| 194 // trigger is available. | 205 // trigger is available. |
| 195 friend class ComponentsUI; | 206 friend class ComponentsUI; |
| 196 friend class PnaclComponentInstaller; | 207 friend class PnaclComponentInstaller; |
|
waffles
2013/10/30 21:11:20
Is the plan to remove this friendship and the old
cpu_(ooo_6.6-7.5)
2013/10/31 04:38:26
Yes, possibly in this change-list.
| |
| 197 friend class OnDemandTester; | 208 friend class OnDemandTester; |
| 198 | 209 |
| 199 private: | 210 private: |
| 200 // Ask the component updater to do an update check for a previously | 211 // Ask the component updater to do an update check for a previously |
| 201 // registered component, immediately. If an update or check is already | 212 // registered component, immediately. If an update or check is already |
| 202 // in progress, returns |kInProgress|. | 213 // in progress, returns |kInProgress|. |
| 203 // There is no guarantee that the item will actually be updated, | 214 // There is no guarantee that the item will actually be updated, |
| 204 // since an update may not be available. Listeners for the component will | 215 // since an update may not be available. Listeners for the component will |
| 205 // know the outcome of the check. | 216 // know the outcome of the check. |
| 206 virtual Status OnDemandUpdate(const std::string& component_id) = 0; | 217 virtual Status OnDemandUpdate(const std::string& component_id) = 0; |
| 207 }; | 218 }; |
| 208 | 219 |
| 209 // Creates the component updater. You must pass a valid |config| allocated on | 220 // Creates the component updater. You must pass a valid |config| allocated on |
| 210 // the heap which the component updater will own. | 221 // the heap which the component updater will own. |
| 211 ComponentUpdateService* ComponentUpdateServiceFactory( | 222 ComponentUpdateService* ComponentUpdateServiceFactory( |
| 212 ComponentUpdateService::Configurator* config); | 223 ComponentUpdateService::Configurator* config); |
| 213 | 224 |
| 214 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 225 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
| OLD | NEW |