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

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

Issue 1937683002: Implement support in DefaultComponentInstaller for picking up bundled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments through #35 Created 4 years, 7 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 } 83 }
84 84
85 // Called during startup and installation before ComponentReady(). 85 // Called during startup and installation before ComponentReady().
86 bool STHSetComponentInstallerTraits::VerifyInstallation( 86 bool STHSetComponentInstallerTraits::VerifyInstallation(
87 const base::DictionaryValue& manifest, 87 const base::DictionaryValue& manifest,
88 const base::FilePath& install_dir) const { 88 const base::FilePath& install_dir) const {
89 return base::PathExists(GetInstalledPath(install_dir)); 89 return base::PathExists(GetInstalledPath(install_dir));
90 } 90 }
91 91
92 base::FilePath STHSetComponentInstallerTraits::GetBaseDirectory() const { 92 base::FilePath STHSetComponentInstallerTraits::GetRelativeInstallDir() const {
93 base::FilePath result; 93 return base::FilePath(FILE_PATH_LITERAL("CertificateTransparency"));
94 PathService::Get(DIR_CERT_TRANS_TREE_STATES, &result);
95 return result;
96 } 94 }
97 95
98 void STHSetComponentInstallerTraits::GetHash(std::vector<uint8_t>* hash) const { 96 void STHSetComponentInstallerTraits::GetHash(std::vector<uint8_t>* hash) const {
99 hash->assign(std::begin(kPublicKeySHA256), std::end(kPublicKeySHA256)); 97 hash->assign(std::begin(kPublicKeySHA256), std::end(kPublicKeySHA256));
100 } 98 }
101 99
102 std::string STHSetComponentInstallerTraits::GetName() const { 100 std::string STHSetComponentInstallerTraits::GetName() const {
103 return kSTHSetFetcherManifestName; 101 return kSTHSetFetcherManifestName;
104 } 102 }
105 103
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 190
193 std::unique_ptr<ComponentInstallerTraits> traits( 191 std::unique_ptr<ComponentInstallerTraits> traits(
194 new STHSetComponentInstallerTraits(std::move(distributor))); 192 new STHSetComponentInstallerTraits(std::move(distributor)));
195 // |cus| will take ownership of |installer| during installer->Register(cus). 193 // |cus| will take ownership of |installer| during installer->Register(cus).
196 DefaultComponentInstaller* installer = 194 DefaultComponentInstaller* installer =
197 new DefaultComponentInstaller(std::move(traits)); 195 new DefaultComponentInstaller(std::move(traits));
198 installer->Register(cus, base::Closure()); 196 installer->Register(cus, base::Closure());
199 } 197 }
200 198
201 } // namespace component_updater 199 } // namespace component_updater
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698