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

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

Issue 2883057: Add debuggin CHECK to help track down ExtensionHost crasher (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: cr comment Created 10 years, 4 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_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extensions_service.cc
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index 0e723b6e08f7bfce387a08290071ba07d9d6277e..3d7dfc0fd258adaa6ce2381cc00d4b43945a217c 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -1167,9 +1167,24 @@ void ExtensionsService::Observe(NotificationType type,
case NotificationType::EXTENSION_PROCESS_TERMINATED: {
DCHECK_EQ(profile_, Source<Profile>(source).ptr());
+ ExtensionHost* host = Details<ExtensionHost>(details).ptr();
+
+ // TODO(rafaelw): Remove this check and ExtensionHost::recently_deleted().
+ // This is only here to help track down crbug.com/49114.
+ ExtensionHost::HostPointerList::iterator iter =
+ ExtensionHost::recently_deleted()->begin();
+ for (; iter != ExtensionHost::recently_deleted()->end(); iter++) {
+ if (*iter == host) {
+ CHECK(host->GetURL().spec().size() + 2 != 0);
+ break;
+ }
+ }
+ if (iter == ExtensionHost::recently_deleted()->end())
+ CHECK(host->GetURL().spec().size() + 1 != 0);
+
// Unload the entire extension. We want it to be in a consistent state:
// either fully working or not loaded at all, but never half-crashed.
- UnloadExtension(Details<ExtensionHost>(details).ptr()->extension()->id());
+ UnloadExtension(host->extension()->id());
break;
}
« no previous file with comments | « chrome/browser/extensions/extension_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698