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

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

Issue 897873002: Make ComponentInstaller refcounted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@2015_01_19_component_installer
Patch Set: fix Created 5 years, 10 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 #include "chrome/browser/component_updater/supervised_user_whitelist_installer.h " 5 #include "chrome/browser/component_updater/supervised_user_whitelist_installer.h "
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 132 }
133 133
134 void SupervisedUserWhitelistInstallerImpl::RegisterWhitelist( 134 void SupervisedUserWhitelistInstallerImpl::RegisterWhitelist(
135 const std::string& crx_id, 135 const std::string& crx_id,
136 const std::string& name, 136 const std::string& name,
137 bool newly_added, 137 bool newly_added,
138 const WhitelistReadyCallback& callback) { 138 const WhitelistReadyCallback& callback) {
139 scoped_ptr<ComponentInstallerTraits> traits( 139 scoped_ptr<ComponentInstallerTraits> traits(
140 new SupervisedUserWhitelistComponentInstallerTraits(crx_id, name, 140 new SupervisedUserWhitelistComponentInstallerTraits(crx_id, name,
141 callback)); 141 callback));
142 DefaultComponentInstaller* installer = 142 scoped_refptr<DefaultComponentInstaller> installer(
143 new DefaultComponentInstaller(traits.Pass()); 143 new DefaultComponentInstaller(traits.Pass()));
144 144
145 // Takes ownership of |installer|.
146 installer->Register(cus_); 145 installer->Register(cus_);
147 146
148 if (newly_added) 147 if (newly_added)
149 TriggerComponentUpdate(&cus_->GetOnDemandUpdater(), crx_id); 148 TriggerComponentUpdate(&cus_->GetOnDemandUpdater(), crx_id);
150 } 149 }
151 150
152 void SupervisedUserWhitelistInstallerImpl::UnregisterWhitelist( 151 void SupervisedUserWhitelistInstallerImpl::UnregisterWhitelist(
153 const std::string& id) { 152 const std::string& id) {
154 // TODO(bauerb): Implement! 153 // TODO(bauerb): Implement!
155 NOTIMPLEMENTED(); 154 NOTIMPLEMENTED();
(...skipping 30 matching lines...) Expand all
186 } 185 }
187 186
188 // static 187 // static
189 void SupervisedUserWhitelistInstaller::TriggerComponentUpdate( 188 void SupervisedUserWhitelistInstaller::TriggerComponentUpdate(
190 OnDemandUpdater* updater, 189 OnDemandUpdater* updater,
191 const std::string& crx_id) { 190 const std::string& crx_id) {
192 updater->OnDemandUpdate(crx_id); 191 updater->OnDemandUpdate(crx_id);
193 } 192 }
194 193
195 } // namespace component_updater 194 } // namespace component_updater
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698