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

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

Issue 2479633003: Makes the component installers return a Result instead of a bool. (Closed)
Patch Set: rebase Created 4 years, 1 month 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 bool STHSetComponentInstallerTraits:: 58 bool STHSetComponentInstallerTraits::
59 SupportsGroupPolicyEnabledComponentUpdates() const { 59 SupportsGroupPolicyEnabledComponentUpdates() const {
60 return false; 60 return false;
61 } 61 }
62 62
63 // Public data is delivered via this component, no need for encryption. 63 // Public data is delivered via this component, no need for encryption.
64 bool STHSetComponentInstallerTraits::RequiresNetworkEncryption() const { 64 bool STHSetComponentInstallerTraits::RequiresNetworkEncryption() const {
65 return false; 65 return false;
66 } 66 }
67 67
68 bool STHSetComponentInstallerTraits::OnCustomInstall( 68 update_client::CrxInstaller::Result
69 STHSetComponentInstallerTraits::OnCustomInstall(
69 const base::DictionaryValue& manifest, 70 const base::DictionaryValue& manifest,
70 const base::FilePath& install_dir) { 71 const base::FilePath& install_dir) {
71 return true; // Nothing custom here. 72 return update_client::CrxInstaller::Result(0); // Nothing custom here.
72 } 73 }
73 74
74 void STHSetComponentInstallerTraits::ComponentReady( 75 void STHSetComponentInstallerTraits::ComponentReady(
75 const base::Version& version, 76 const base::Version& version,
76 const base::FilePath& install_dir, 77 const base::FilePath& install_dir,
77 std::unique_ptr<base::DictionaryValue> manifest) { 78 std::unique_ptr<base::DictionaryValue> manifest) {
78 const base::Closure load_sths_closure = base::Bind( 79 const base::Closure load_sths_closure = base::Bind(
79 &STHSetComponentInstallerTraits::LoadSTHsFromDisk, 80 &STHSetComponentInstallerTraits::LoadSTHsFromDisk,
80 weak_ptr_factory_.GetWeakPtr(), GetInstalledPath(install_dir), version); 81 weak_ptr_factory_.GetWeakPtr(), GetInstalledPath(install_dir), version);
81 82
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 202
202 std::unique_ptr<ComponentInstallerTraits> traits( 203 std::unique_ptr<ComponentInstallerTraits> traits(
203 new STHSetComponentInstallerTraits(distributor)); 204 new STHSetComponentInstallerTraits(distributor));
204 // |cus| will take ownership of |installer| during installer->Register(cus). 205 // |cus| will take ownership of |installer| during installer->Register(cus).
205 DefaultComponentInstaller* installer = 206 DefaultComponentInstaller* installer =
206 new DefaultComponentInstaller(std::move(traits)); 207 new DefaultComponentInstaller(std::move(traits));
207 installer->Register(cus, base::Closure()); 208 installer->Register(cus, base::Closure());
208 } 209 }
209 210
210 } // namespace component_updater 211 } // namespace component_updater
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698