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

Side by Side Diff: components/component_updater/default_component_installer.h

Issue 2102083002: Allow component installers to specify a map of installer attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 months 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ 5 #ifndef COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_
6 #define COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ 6 #define COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // Returns a relative path that will be appended to the component updater 79 // Returns a relative path that will be appended to the component updater
80 // root directories to find the data for this particular component. 80 // root directories to find the data for this particular component.
81 virtual base::FilePath GetRelativeInstallDir() const = 0; 81 virtual base::FilePath GetRelativeInstallDir() const = 0;
82 82
83 // Returns the component's SHA2 hash as raw bytes. 83 // Returns the component's SHA2 hash as raw bytes.
84 virtual void GetHash(std::vector<uint8_t>* hash) const = 0; 84 virtual void GetHash(std::vector<uint8_t>* hash) const = 0;
85 85
86 // Returns the human-readable name of the component. 86 // Returns the human-readable name of the component.
87 virtual std::string GetName() const = 0; 87 virtual std::string GetName() const = 0;
88 88
89 // Returns the additional parameters to be used in the update checks for 89 // Returns a container of name-value pairs representing arbitrary,
90 // this component. A compatible server may use this attribute to negotiate 90 // installer-defined metadata.
91 // special update rules when issuing an update response. 91
Sorin Jianu 2016/06/28 21:46:11 I will handle this empty line.
92 // The current implementation restricts ap to ^([-+_=a-zA-Z0-9]{0,256})$ 92 // The installer metadata may be used in the update checks for this component.
93 virtual std::string GetAp() const = 0; 93 // A compatible server may use these attributes to negotiate special update
94 // rules when issuing an update response.
95 // Valid values for the name part of an attribute match
96 // ^[-_a-zA-Z0-9]{1,256}$ and valid values the value part of an attribute
97 // match ^[-.,;+_=a-zA-Z0-9]{0,256}$ .
98 virtual update_client::InstallerAttributes GetInstallerAttributes() const = 0;
94 }; 99 };
95 100
96 // A DefaultComponentInstaller is intended to be final, and not derived from. 101 // A DefaultComponentInstaller is intended to be final, and not derived from.
97 // Customization must be provided by passing a ComponentInstallerTraits object 102 // Customization must be provided by passing a ComponentInstallerTraits object
98 // to the constructor. 103 // to the constructor.
99 class DefaultComponentInstaller : public update_client::CrxInstaller { 104 class DefaultComponentInstaller : public update_client::CrxInstaller {
100 public: 105 public:
101 DefaultComponentInstaller( 106 DefaultComponentInstaller(
102 std::unique_ptr<ComponentInstallerTraits> installer_traits); 107 std::unique_ptr<ComponentInstallerTraits> installer_traits);
103 108
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; 149 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
145 150
146 base::ThreadChecker thread_checker_; 151 base::ThreadChecker thread_checker_;
147 152
148 DISALLOW_COPY_AND_ASSIGN(DefaultComponentInstaller); 153 DISALLOW_COPY_AND_ASSIGN(DefaultComponentInstaller);
149 }; 154 };
150 155
151 } // namespace component_updater 156 } // namespace component_updater
152 157
153 #endif // COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ 158 #endif // COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698