Index: chrome/browser/extensions/webstore_standalone_installer.cc |
diff --git a/chrome/browser/extensions/webstore_standalone_installer.cc b/chrome/browser/extensions/webstore_standalone_installer.cc |
index 91662ea6750c4fd732d894f2b803da64b3c321f8..c8adc3b200226b343a31ccc71eb88c12fb1958f6 100644 |
--- a/chrome/browser/extensions/webstore_standalone_installer.cc |
+++ b/chrome/browser/extensions/webstore_standalone_installer.cc |
@@ -212,9 +212,6 @@ void WebstoreStandaloneInstaller::OnWebstoreParseSuccess( |
ShowInstallUI(); |
// Control flow finishes up in InstallUIProceed or InstallUIAbort. |
} else { |
- // Balanced in InstallUIAbort or indirectly in InstallUIProceed via |
- // OnExtensionInstallSuccess or OnExtensionInstallFailure. |
- AddRef(); |
InstallUIProceed(); |
} |
} |
@@ -272,14 +269,12 @@ void WebstoreStandaloneInstaller::InstallUIProceed() { |
void WebstoreStandaloneInstaller::InstallUIAbort(bool user_initiated) { |
CompleteInstall(kUserCancelledError); |
- Release(); // Balanced in ShowInstallUI. |
} |
void WebstoreStandaloneInstaller::OnExtensionInstallSuccess( |
const std::string& id) { |
CHECK_EQ(id_, id); |
CompleteInstall(std::string()); |
- Release(); // Balanced in ShowInstallUI. |
} |
void WebstoreStandaloneInstaller::OnExtensionInstallFailure( |
@@ -288,16 +283,16 @@ void WebstoreStandaloneInstaller::OnExtensionInstallFailure( |
WebstoreInstaller::FailureReason cancelled) { |
CHECK_EQ(id_, id); |
CompleteInstall(error); |
- Release(); // Balanced in ShowInstallUI. |
} |
void WebstoreStandaloneInstaller::AbortInstall() { |
callback_.Reset(); |
+ |
// Abort any in-progress fetches. |
- if (webstore_data_fetcher_) { |
+ if (webstore_data_fetcher_) |
webstore_data_fetcher_.reset(); |
- Release(); // Matches the AddRef in BeginInstall. |
- } |
+ |
+ Release(); // Matches the AddRef in BeginInstall. |
} |
void WebstoreStandaloneInstaller::InvokeCallback(const std::string& error) { |
@@ -310,8 +305,7 @@ void WebstoreStandaloneInstaller::CompleteInstall(const std::string& error) { |
Release(); // Matches the AddRef in BeginInstall. |
} |
-void |
-WebstoreStandaloneInstaller::ShowInstallUI() { |
+void WebstoreStandaloneInstaller::ShowInstallUI() { |
std::string error; |
localized_extension_for_display_ = |
ExtensionInstallPrompt::GetLocalizedExtensionForDisplay( |
@@ -326,11 +320,6 @@ WebstoreStandaloneInstaller::ShowInstallUI() { |
return; |
} |
- // Keep this alive as long as the install prompt lives. |
- // Balanced in InstallUIAbort or indirectly in InstallUIProceed via |
- // OnExtensionInstallSuccess or OnExtensionInstallFailure. |
- AddRef(); |
- |
install_ui_ = CreateInstallUI(); |
install_ui_->ConfirmStandaloneInstall( |
this, localized_extension_for_display_.get(), &icon_, *install_prompt_); |