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

Unified Diff: chrome/browser/component_updater/cros_component_installer.cc

Issue 2898063002: Hold cros_component_installers in browser_process. (Closed)
Patch Set: switch to smart pointer Created 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/component_updater/cros_component_installer.cc
diff --git a/chrome/browser/component_updater/cros_component_installer.cc b/chrome/browser/component_updater/cros_component_installer.cc
index b68cd03f14e51a67945e8b6a09eaa450bfb6cfc5..e21d3d127cb5edb3c8b18688fac111c2f3cdd029 100644
--- a/chrome/browser/component_updater/cros_component_installer.cc
+++ b/chrome/browser/component_updater/cros_component_installer.cc
@@ -128,6 +128,7 @@ std::vector<std::string> CrOSComponentInstallerTraits::GetMimeTypes() const {
}
void CrOSComponent::RegisterCrOSComponentInternal(
+ const std::string& name,
ComponentUpdateService* cus,
const ComponentConfig& config,
const base::Closure& installcallback) {
@@ -135,8 +136,9 @@ void CrOSComponent::RegisterCrOSComponentInternal(
new CrOSComponentInstallerTraits(config));
// |cus| will take ownership of |installer| during
sky 2017/05/23 23:20:30 Update comment? Also, I'm rather confused about t
xiaochu 2017/05/23 23:40:52 Done.
// installer->Register(cus).
- DefaultComponentInstaller* installer =
- new DefaultComponentInstaller(std::move(traits));
+ scoped_refptr<DefaultComponentInstaller> installer =
+ g_browser_process->platform_part()->GetCrosComponentInstaller(
+ name, std::move(traits));
installer->Register(cus, installcallback);
}
@@ -174,7 +176,7 @@ bool CrOSComponent::InstallCrOSComponent(
ComponentConfig config(it->first, it->second.find("env_version")->second,
it->second.find("sha2hashstr")->second);
RegisterCrOSComponentInternal(
- cus, config,
+ name, cus, config,
base::Bind(InstallChromeOSComponent, cus,
crx_file::id_util::GenerateIdFromHex(
it->second.find("sha2hashstr")->second)

Powered by Google App Engine
This is Rietveld 408576698