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

Unified Diff: chrome/browser/extensions/extension_install_checker.cc

Issue 381553002: Update the CrxInstaller and UnpackedInstaller to use the ExtensionInstallChecker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved include to correct file Created 6 years, 5 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/extensions/extension_install_checker.cc
diff --git a/chrome/browser/extensions/extension_install_checker.cc b/chrome/browser/extensions/extension_install_checker.cc
index 5aab44d791dbd41ee0fdea06fc7994e40a6599ad..bd02b7100ade59c1cdeb7ee0622f426953d575e9 100644
--- a/chrome/browser/extensions/extension_install_checker.cc
+++ b/chrome/browser/extensions/extension_install_checker.cc
@@ -163,8 +163,12 @@ void ExtensionInstallChecker::MaybeInvokeCallback() {
running_checks_ = 0;
++current_sequence_number_;
- callback_.Run(failed_mask);
+ Callback callback_copy = callback_;
callback_.Reset();
+
+ // This instance may be owned by the callback recipient and deleted here,
+ // so reset |callback_| first and invoke a copy of the callback.
+ callback_copy.Run(failed_mask);
}
}
« no previous file with comments | « chrome/browser/extensions/crx_installer_browsertest.cc ('k') | chrome/browser/extensions/extension_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698