OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "chrome/browser/component_updater/sth_set_component_installer.h" | 5 #include "chrome/browser/component_updater/sth_set_component_installer.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 95 } |
96 | 96 |
97 void STHSetComponentInstallerTraits::GetHash(std::vector<uint8_t>* hash) const { | 97 void STHSetComponentInstallerTraits::GetHash(std::vector<uint8_t>* hash) const { |
98 hash->assign(std::begin(kPublicKeySHA256), std::end(kPublicKeySHA256)); | 98 hash->assign(std::begin(kPublicKeySHA256), std::end(kPublicKeySHA256)); |
99 } | 99 } |
100 | 100 |
101 std::string STHSetComponentInstallerTraits::GetName() const { | 101 std::string STHSetComponentInstallerTraits::GetName() const { |
102 return kSTHSetFetcherManifestName; | 102 return kSTHSetFetcherManifestName; |
103 } | 103 } |
104 | 104 |
105 std::string STHSetComponentInstallerTraits::GetAp() const { | 105 update_client::InstallerAttributes |
106 return std::string(); | 106 STHSetComponentInstallerTraits::GetInstallerAttributes() const { |
| 107 return update_client::InstallerAttributes(); |
107 } | 108 } |
108 | 109 |
109 void STHSetComponentInstallerTraits::LoadSTHsFromDisk( | 110 void STHSetComponentInstallerTraits::LoadSTHsFromDisk( |
110 const base::FilePath& sths_path, | 111 const base::FilePath& sths_path, |
111 const base::Version& version) { | 112 const base::Version& version) { |
112 if (sths_path.empty()) | 113 if (sths_path.empty()) |
113 return; | 114 return; |
114 | 115 |
115 base::FileEnumerator sth_file_enumerator(sths_path, false, | 116 base::FileEnumerator sth_file_enumerator(sths_path, false, |
116 base::FileEnumerator::FILES, | 117 base::FileEnumerator::FILES, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 191 |
191 std::unique_ptr<ComponentInstallerTraits> traits( | 192 std::unique_ptr<ComponentInstallerTraits> traits( |
192 new STHSetComponentInstallerTraits(distributor)); | 193 new STHSetComponentInstallerTraits(distributor)); |
193 // |cus| will take ownership of |installer| during installer->Register(cus). | 194 // |cus| will take ownership of |installer| during installer->Register(cus). |
194 DefaultComponentInstaller* installer = | 195 DefaultComponentInstaller* installer = |
195 new DefaultComponentInstaller(std::move(traits)); | 196 new DefaultComponentInstaller(std::move(traits)); |
196 installer->Register(cus, base::Closure()); | 197 installer->Register(cus, base::Closure()); |
197 } | 198 } |
198 | 199 |
199 } // namespace component_updater | 200 } // namespace component_updater |
OLD | NEW |