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

Unified Diff: chrome/browser/component_updater/pnacl/pnacl_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: chrome/browser/component_updater/pnacl/pnacl_component_installer.cc
diff --git a/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc b/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc
index 6667dc870c67873f1a53bb24fbc01b2b1431b3cd..785df6a93a1fdbbf6ae2b67f493ee5d6deaa1806 100644
--- a/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc
+++ b/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc
@@ -92,7 +92,7 @@ void OverrideDirPnaclComponent(const base::FilePath& base_path) {
PathService::Override(chrome::DIR_PNACL_COMPONENT, GetPlatformDir(base_path));
}
-bool GetLatestPnaclDirectory(PnaclComponentInstaller* pci,
+bool GetLatestPnaclDirectory(const scoped_refptr<PnaclComponentInstaller>& pci,
base::FilePath* latest_dir,
Version* latest_version,
std::vector<base::FilePath>* older_dirs) {
@@ -293,9 +293,10 @@ CrxComponent PnaclComponentInstaller::GetCrxComponent() {
namespace {
-void FinishPnaclUpdateRegistration(const Version& current_version,
- const std::string& current_fingerprint,
- PnaclComponentInstaller* pci) {
+void FinishPnaclUpdateRegistration(
+ const Version& current_version,
+ const std::string& current_fingerprint,
+ const scoped_refptr<PnaclComponentInstaller>& pci) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
pci->set_current_version(current_version);
CheckVersionCompatiblity(current_version);
@@ -312,7 +313,8 @@ void FinishPnaclUpdateRegistration(const Version& current_version,
// Check if there is an existing version on disk first to know when
// a hosted version is actually newer.
-void StartPnaclUpdateRegistration(PnaclComponentInstaller* pci) {
+void StartPnaclUpdateRegistration(
+ const scoped_refptr<PnaclComponentInstaller>& pci) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
base::FilePath path = pci->GetPnaclBaseDirectory();
if (!base::PathExists(path)) {
@@ -365,9 +367,9 @@ void StartPnaclUpdateRegistration(PnaclComponentInstaller* pci) {
void PnaclComponentInstaller::RegisterPnaclComponent(
ComponentUpdateService* cus) {
cus_ = cus;
- BrowserThread::PostTask(BrowserThread::FILE,
- FROM_HERE,
- base::Bind(&StartPnaclUpdateRegistration, this));
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
+ base::Bind(&StartPnaclUpdateRegistration, make_scoped_refptr(this)));
}
} // namespace component_updater

Powered by Google App Engine
This is Rietveld 408576698