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

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

Issue 995007: Fix a crash due to UserScriptListener unregistering notifications on the wrong (Closed)
Patch Set: Created 10 years, 9 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/user_script_listener.cc
diff --git a/chrome/browser/extensions/user_script_listener.cc b/chrome/browser/extensions/user_script_listener.cc
index aec615cb74fdee7d89b7ed2350a68c5f6dbb1bef..aba4a6b89477f8f5a3a64bbd1b0ac4f2552142a7 100644
--- a/chrome/browser/extensions/user_script_listener.cc
+++ b/chrome/browser/extensions/user_script_listener.cc
@@ -16,6 +16,7 @@
UserScriptListener::UserScriptListener(ResourceQueue* resource_queue)
: resource_queue_(resource_queue),
user_scripts_ready_(false) {
+ DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
DCHECK(resource_queue_);
registrar_.Add(this, NotificationType::EXTENSION_LOADED,
@@ -26,6 +27,11 @@ UserScriptListener::UserScriptListener(ResourceQueue* resource_queue)
NotificationService::AllSources());
}
+void UserScriptListener::ShutdownMainThread() {
+ DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ registrar_.RemoveAll();
+}
+
bool UserScriptListener::ShouldDelayRequest(
URLRequest* request,
const ResourceDispatcherHostRequestInfo& request_info,

Powered by Google App Engine
This is Rietveld 408576698