| 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 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 virtual void GetComponents(std::vector<CrxComponentInfo>* components) = 0; | 194 virtual void GetComponents(std::vector<CrxComponentInfo>* components) = 0; |
| 195 | 195 |
| 196 // Returns a network resource throttle. It means that a component will be | 196 // Returns a network resource throttle. It means that a component will be |
| 197 // downloaded and installed before the resource is unthrottled. This is the | 197 // downloaded and installed before the resource is unthrottled. This is the |
| 198 // only function callable from the IO thread. | 198 // only function callable from the IO thread. |
| 199 virtual content::ResourceThrottle* GetOnDemandResourceThrottle( | 199 virtual content::ResourceThrottle* GetOnDemandResourceThrottle( |
| 200 net::URLRequest* request, const std::string& crx_id) = 0; | 200 net::URLRequest* request, const std::string& crx_id) = 0; |
| 201 | 201 |
| 202 virtual ~ComponentUpdateService() {} | 202 virtual ~ComponentUpdateService() {} |
| 203 | 203 |
| 204 // TODO(waffles): Remove PNaCl as a friend once an alternative on-demand | |
| 205 // trigger is available. | |
| 206 friend class ComponentsUI; | 204 friend class ComponentsUI; |
| 207 friend class PnaclComponentInstaller; | |
| 208 friend class OnDemandTester; | 205 friend class OnDemandTester; |
| 209 | 206 |
| 210 private: | 207 private: |
| 211 // Ask the component updater to do an update check for a previously | 208 // Ask the component updater to do an update check for a previously |
| 212 // registered component, immediately. If an update or check is already | 209 // registered component, immediately. If an update or check is already |
| 213 // in progress, returns |kInProgress|. | 210 // in progress, returns |kInProgress|. |
| 214 // There is no guarantee that the item will actually be updated, | 211 // There is no guarantee that the item will actually be updated, |
| 215 // since an update may not be available. Listeners for the component will | 212 // since an update may not be available. Listeners for the component will |
| 216 // know the outcome of the check. | 213 // know the outcome of the check. |
| 217 virtual Status OnDemandUpdate(const std::string& component_id) = 0; | 214 virtual Status OnDemandUpdate(const std::string& component_id) = 0; |
| 218 }; | 215 }; |
| 219 | 216 |
| 220 // Creates the component updater. You must pass a valid |config| allocated on | 217 // Creates the component updater. You must pass a valid |config| allocated on |
| 221 // the heap which the component updater will own. | 218 // the heap which the component updater will own. |
| 222 ComponentUpdateService* ComponentUpdateServiceFactory( | 219 ComponentUpdateService* ComponentUpdateServiceFactory( |
| 223 ComponentUpdateService::Configurator* config); | 220 ComponentUpdateService::Configurator* config); |
| 224 | 221 |
| 225 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 222 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
| OLD | NEW |