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

Side by Side Diff: chrome/browser/component_updater/sth_set_component_installer.cc

Issue 1872053002: Implement an API to allow passing an "ap" parameter to component updates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 97 }
98 98
99 void STHSetComponentInstallerTraits::GetHash(std::vector<uint8_t>* hash) const { 99 void STHSetComponentInstallerTraits::GetHash(std::vector<uint8_t>* hash) const {
100 hash->assign(std::begin(kPublicKeySHA256), std::end(kPublicKeySHA256)); 100 hash->assign(std::begin(kPublicKeySHA256), std::end(kPublicKeySHA256));
101 } 101 }
102 102
103 std::string STHSetComponentInstallerTraits::GetName() const { 103 std::string STHSetComponentInstallerTraits::GetName() const {
104 return kSTHSetFetcherManifestName; 104 return kSTHSetFetcherManifestName;
105 } 105 }
106 106
107 std::string STHSetComponentInstallerTraits::GetAp() const {
108 return std::string();
109 }
110
107 void STHSetComponentInstallerTraits::LoadSTHsFromDisk( 111 void STHSetComponentInstallerTraits::LoadSTHsFromDisk(
108 const base::FilePath& sths_path, 112 const base::FilePath& sths_path,
109 const base::Version& version) { 113 const base::Version& version) {
110 if (sths_path.empty()) 114 if (sths_path.empty())
111 return; 115 return;
112 116
113 base::FileEnumerator sth_file_enumerator(sths_path, false, 117 base::FileEnumerator sth_file_enumerator(sths_path, false,
114 base::FileEnumerator::FILES, 118 base::FileEnumerator::FILES,
115 FILE_PATH_LITERAL("*.sth")); 119 FILE_PATH_LITERAL("*.sth"));
116 base::FilePath sth_file_path; 120 base::FilePath sth_file_path;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 193
190 scoped_ptr<ComponentInstallerTraits> traits( 194 scoped_ptr<ComponentInstallerTraits> traits(
191 new STHSetComponentInstallerTraits(std::move(distributor))); 195 new STHSetComponentInstallerTraits(std::move(distributor)));
192 // |cus| will take ownership of |installer| during installer->Register(cus). 196 // |cus| will take ownership of |installer| during installer->Register(cus).
193 DefaultComponentInstaller* installer = 197 DefaultComponentInstaller* installer =
194 new DefaultComponentInstaller(std::move(traits)); 198 new DefaultComponentInstaller(std::move(traits));
195 installer->Register(cus, base::Closure()); 199 installer->Register(cus, base::Closure());
196 } 200 }
197 201
198 } // namespace component_updater 202 } // namespace component_updater
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698