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

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

Issue 2898063002: Hold cros_component_installers in browser_process. (Closed)
Patch Set: trim code 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..5fe419d2d6a5ebe9b2132e44b996d2306630ba20 100644
--- a/chrome/browser/component_updater/cros_component_installer.cc
+++ b/chrome/browser/component_updater/cros_component_installer.cc
@@ -127,16 +127,28 @@ std::vector<std::string> CrOSComponentInstallerTraits::GetMimeTypes() const {
return mime_types;
}
+CrOSComponentInstaller::CrOSComponentInstaller(
+ std::unique_ptr<ComponentInstallerTraits> installer_traits)
+ : DefaultComponentInstaller(std::move(installer_traits)) {}
+
+CrOSComponentInstaller::~CrOSComponentInstaller() {}
+
+std::unique_ptr<base::DictionaryValue>
+CrOSComponentInstaller::GetCurrentManifest() {
+ std::unique_ptr<base::DictionaryValue> manifest_copy(
+ current_manifest_->DeepCopy());
+ return manifest_copy;
+}
+
void CrOSComponent::RegisterCrOSComponentInternal(
ComponentUpdateService* cus,
const ComponentConfig& config,
const base::Closure& installcallback) {
std::unique_ptr<ComponentInstallerTraits> traits(
new CrOSComponentInstallerTraits(config));
- // |cus| will take ownership of |installer| during
- // installer->Register(cus).
- DefaultComponentInstaller* installer =
- new DefaultComponentInstaller(std::move(traits));
+ scoped_refptr<CrOSComponentInstaller> installer =
+ g_browser_process->platform_part()->GetCrosComponentInstaller(
+ config.name, std::move(traits));
installer->Register(cus, installcallback);
}
@@ -153,7 +165,7 @@ bool CrOSComponent::InstallCrOSComponent(
auto* const cus = g_browser_process->component_updater();
const ConfigMap components = {
{"epson-inkjet-printer-escpr",
- {{"env_version", "0.0"},
+ {{"env_version", "2.0"},
{"sha2hashstr",
"1913a5e0a6cad30b6f03e176177e0d7ed62c5d6700a9c66da556d7c3f5d6a47e"}}}};
if (name.empty()) {

Powered by Google App Engine
This is Rietveld 408576698