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

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

Issue 162183002: Don't attempt to unload the same extension twice if multiple ExtensionHost instances existed for th… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index db32e5a39c86f6bd2326edeb6d1e80bef818cc13..da17f664bbc18a77662e4e064ab66e7b95eaaddf 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -2356,6 +2356,7 @@ const Extension* ExtensionService::GetPendingExtensionUpdate(
void ExtensionService::TrackTerminatedExtension(const Extension* extension) {
// No need to check for duplicates; inserting a duplicate is a no-op.
registry_->AddTerminated(make_scoped_refptr(extension));
+ extensions_being_terminated_.erase(extension->id());
UnloadExtension(extension->id(), UnloadedExtensionInfo::REASON_TERMINATE);
}
@@ -2536,6 +2537,11 @@ void ExtensionService::Observe(int type,
extensions::ExtensionHost* host =
content::Details<extensions::ExtensionHost>(details).ptr();
+ // If the extension is already being terminated, there is nothing left to
+ // do.
+ if (!extensions_being_terminated_.insert(host->extension_id()).second)
+ break;
+
// Mark the extension as terminated and Unload it. We want it to
// be in a consistent state: either fully working or not loaded
// at all, but never half-crashed. We do it in a PostTask so
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698