Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: chrome/browser/component_updater/component_updater_service.h

Issue 25883006: Support asynchronous patching operations in the component updater. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tests
Patch Set: sorin@, cpu@ review Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 11 matching lines...) Expand all
22 } 22 }
23 23
24 namespace component_updater { 24 namespace component_updater {
25 class OnDemandTester; 25 class OnDemandTester;
26 } 26 }
27 27
28 namespace content { 28 namespace content {
29 class ResourceThrottle; 29 class ResourceThrottle;
30 } 30 }
31 31
32 namespace component_updater {
32 class ComponentPatcher; 33 class ComponentPatcher;
34 }
33 35
34 // Component specific installers must derive from this class and implement 36 // Component specific installers must derive from this class and implement
35 // OnUpdateError() and Install(). A valid instance of this class must be 37 // OnUpdateError() and Install(). A valid instance of this class must be
36 // given to ComponentUpdateService::RegisterComponent(). 38 // given to ComponentUpdateService::RegisterComponent().
37 class ComponentInstaller { 39 class ComponentInstaller {
38 public : 40 public :
39 // Called by the component updater on the UI thread when there was a 41 // 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 42 // problem unpacking or verifying the component. |error| is a non-zero
41 // value which is only meaningful to the component updater. 43 // value which is only meaningful to the component updater.
42 virtual void OnUpdateError(int error) = 0; 44 virtual void OnUpdateError(int error) = 0;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // Parameters added to each url request. It can be null if none are needed. 172 // Parameters added to each url request. It can be null if none are needed.
171 virtual const char* ExtraRequestParams() = 0; 173 virtual const char* ExtraRequestParams() = 0;
172 // How big each update request can be. Don't go above 2000. 174 // How big each update request can be. Don't go above 2000.
173 virtual size_t UrlSizeLimit() = 0; 175 virtual size_t UrlSizeLimit() = 0;
174 // The source of contexts for all the url requests. 176 // The source of contexts for all the url requests.
175 virtual net::URLRequestContextGetter* RequestContext() = 0; 177 virtual net::URLRequestContextGetter* RequestContext() = 0;
176 // True means that all ops are performed in this process. 178 // True means that all ops are performed in this process.
177 virtual bool InProcess() = 0; 179 virtual bool InProcess() = 0;
178 // Creates a new ComponentPatcher in a platform-specific way. This is useful 180 // Creates a new ComponentPatcher in a platform-specific way. This is useful
179 // for dependency injection. 181 // for dependency injection.
180 virtual ComponentPatcher* CreateComponentPatcher() = 0; 182 virtual component_updater::ComponentPatcher* CreateComponentPatcher() = 0;
181 // True means that this client can handle delta updates. 183 // True means that this client can handle delta updates.
182 virtual bool DeltasEnabled() const = 0; 184 virtual bool DeltasEnabled() const = 0;
183 }; 185 };
184 186
185 // Start doing update checks and installing new versions of registered 187 // Start doing update checks and installing new versions of registered
186 // components after Configurator::InitialDelay() seconds. 188 // components after Configurator::InitialDelay() seconds.
187 virtual Status Start() = 0; 189 virtual Status Start() = 0;
188 190
189 // Stop doing update checks. In-flight requests and pending installations 191 // Stop doing update checks. In-flight requests and pending installations
190 // will not be canceled. 192 // will not be canceled.
(...skipping 26 matching lines...) Expand all
217 // know the outcome of the check. 219 // know the outcome of the check.
218 virtual Status OnDemandUpdate(const std::string& component_id) = 0; 220 virtual Status OnDemandUpdate(const std::string& component_id) = 0;
219 }; 221 };
220 222
221 // Creates the component updater. You must pass a valid |config| allocated on 223 // Creates the component updater. You must pass a valid |config| allocated on
222 // the heap which the component updater will own. 224 // the heap which the component updater will own.
223 ComponentUpdateService* ComponentUpdateServiceFactory( 225 ComponentUpdateService* ComponentUpdateServiceFactory(
224 ComponentUpdateService::Configurator* config); 226 ComponentUpdateService::Configurator* config);
225 227
226 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ 228 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698