| Index: chrome/browser/component_updater/component_updater_service.h
|
| diff --git a/chrome/browser/component_updater/component_updater_service.h b/chrome/browser/component_updater/component_updater_service.h
|
| index 3ac645d8a0b0b4f7041aa6fb484680e0369878bd..bf011eb43e022d3940a0b874390ab09923eab858 100644
|
| --- a/chrome/browser/component_updater/component_updater_service.h
|
| +++ b/chrome/browser/component_updater/component_updater_service.h
|
| @@ -20,6 +20,8 @@ class DictionaryValue;
|
| class FilePath;
|
| }
|
|
|
| +class ComponentPatcher;
|
| +
|
| // Component specific installers must derive from this class and implement
|
| // OnUpdateError() and Install(). A valid instance of this class must be
|
| // given to ComponentUpdateService::RegisterComponent().
|
| @@ -37,15 +39,22 @@ class ComponentInstaller {
|
| virtual bool Install(const base::DictionaryValue& manifest,
|
| const base::FilePath& unpack_path) = 0;
|
|
|
| + // Set |installed_file| to the full path to the installed |file|. |file| is
|
| + // the filename of the file in this component's CRX. Returns false if this is
|
| + // not possible (the file has been removed or modified, or its current
|
| + // location is unknown). Otherwise, returns true.
|
| + virtual bool GetInstalledFile(const std::string& file,
|
| + base::FilePath* installed_file) = 0;
|
| +
|
| protected:
|
| virtual ~ComponentInstaller() {}
|
| };
|
|
|
| // Describes a particular component that can be installed or updated. This
|
| // structure is required to register a component with the component updater.
|
| -// Only |name| is optional. |pk_hash| is the SHA256 hash of the component's
|
| -// public key. If the component is to be installed then version should be
|
| -// "0" or "0.0", else it should be the current version.
|
| +// |pk_hash| is the SHA256 hash of the component's public key. If the component
|
| +// is to be installed then version should be "0" or "0.0", else it should be
|
| +// the current version. |fingerprint| and |name| are optional.
|
| // |source| is by default pointing to BANDAID but if needed it can be made
|
| // to point to the webstore (CWS_PUBLIC) or to the webstore sandbox. It is
|
| // important to note that the BANDAID source if active throught the day
|
| @@ -55,12 +64,13 @@ struct CrxComponent {
|
| enum UrlSource {
|
| BANDAID,
|
| CWS_PUBLIC,
|
| - CWS_SANDBOX
|
| + CWS_SANDBOX,
|
| };
|
|
|
| std::vector<uint8> pk_hash;
|
| ComponentInstaller* installer;
|
| Version version;
|
| + std::string fingerprint;
|
| std::string name;
|
| UrlSource source;
|
| CrxComponent();
|
| @@ -128,6 +138,11 @@ class ComponentUpdateService {
|
| // happens. It should be used mostly as a place to add application specific
|
| // logging or telemetry. |extra| is |event| dependent.
|
| virtual void OnEvent(Events event, int extra) = 0;
|
| + // Creates a new ComponentPatcher in a platform-specific way. This is useful
|
| + // for dependency injection.
|
| + virtual ComponentPatcher* CreateComponentPatcher() = 0;
|
| + // True means that this client can handle delta updates.
|
| + virtual bool DeltasEnabled() const = 0;
|
| };
|
|
|
| // Start doing update checks and installing new versions of registered
|
|
|