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

Unified Diff: components/component_updater/default_component_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 side-by-side diff with in-line comments
Download patch
Index: components/component_updater/default_component_installer.cc
diff --git a/components/component_updater/default_component_installer.cc b/components/component_updater/default_component_installer.cc
index 6588973281ccb2aa5f8c065c686228486560c6d7..d73b4fc9cf868c795eb881dbea54e6a41399060b 100644
--- a/components/component_updater/default_component_installer.cc
+++ b/components/component_updater/default_component_installer.cc
@@ -55,8 +55,7 @@ void DefaultComponentInstaller::Register(ComponentUpdateService* cus) {
task_runner_->PostTask(
FROM_HERE,
base::Bind(&DefaultComponentInstaller::StartRegistration,
- base::Unretained(this),
- cus));
+ this, cus));
}
void DefaultComponentInstaller::OnUpdateError(int error) {
@@ -103,11 +102,8 @@ bool DefaultComponentInstaller::Install(const base::DictionaryValue& manifest,
current_manifest_->DeepCopy());
main_task_runner_->PostTask(
FROM_HERE,
- base::Bind(&ComponentInstallerTraits::ComponentReady,
- base::Unretained(installer_traits_.get()),
- current_version_,
- GetInstallDirectory(),
- base::Passed(&manifest_copy)));
+ base::Bind(&DefaultComponentInstaller::ComponentReady,
+ this, base::Passed(&manifest_copy)));
return true;
}
@@ -197,8 +193,7 @@ void DefaultComponentInstaller::StartRegistration(ComponentUpdateService* cus) {
main_task_runner_->PostTask(
FROM_HERE,
base::Bind(&DefaultComponentInstaller::FinishRegistration,
- base::Unretained(this),
- cus));
+ this, cus));
}
base::FilePath DefaultComponentInstaller::GetInstallDirectory() {
@@ -230,8 +225,13 @@ void DefaultComponentInstaller::FinishRegistration(
scoped_ptr<base::DictionaryValue> manifest_copy(
current_manifest_->DeepCopy());
+ ComponentReady(manifest_copy.Pass());
+}
+
+void DefaultComponentInstaller::ComponentReady(
+ scoped_ptr<base::DictionaryValue> manifest) {
installer_traits_->ComponentReady(
- current_version_, GetInstallDirectory(), manifest_copy.Pass());
+ current_version_, GetInstallDirectory(), manifest.Pass());
}
} // namespace component_updater
« no previous file with comments | « components/component_updater/default_component_installer.h ('k') | components/update_client/component_patcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698