Index: content/browser/loader/resource_message_filter.cc |
diff --git a/content/browser/loader/resource_message_filter.cc b/content/browser/loader/resource_message_filter.cc |
index 958b7d035f4cd4885b2a33a8e76e9e9adb7037bb..994b8b746514df922b666dfb1376511a9f447c49 100644 |
--- a/content/browser/loader/resource_message_filter.cc |
+++ b/content/browser/loader/resource_message_filter.cc |
@@ -46,6 +46,12 @@ bool ResourceMessageFilter::OnMessageReceived(const IPC::Message& message) { |
return ResourceDispatcherHostImpl::Get()->OnMessageReceived(message, this); |
} |
+void ResourceMessageFilter::OnDestruct() const { |
+ // Destroy the filter on the IO thread since that's where its weak pointers |
+ // are being used. |
+ BrowserThread::DeleteOnIOThread::Destruct(this); |
+} |
+ |
void ResourceMessageFilter::GetContexts( |
ResourceType resource_type, |
ResourceContext** resource_context, |
@@ -55,6 +61,7 @@ void ResourceMessageFilter::GetContexts( |
} |
base::WeakPtr<ResourceMessageFilter> ResourceMessageFilter::GetWeakPtr() { |
+ DCHECK_CURRENTLY_ON(BrowserThread::IO); |
return weak_ptr_factory_.GetWeakPtr(); |
} |