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 eb1993b59568c008f73f741a8e158a7613d235a0..b14afa1b422f2602d44f3b393d8e08844a75e0a3 100644 |
--- a/content/browser/loader/resource_message_filter.cc |
+++ b/content/browser/loader/resource_message_filter.cc |
@@ -49,6 +49,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, |
@@ -64,6 +70,7 @@ const HostZoomMap* ResourceMessageFilter::GetHostZoomMap() const { |
} |
base::WeakPtr<ResourceMessageFilter> ResourceMessageFilter::GetWeakPtr() { |
+ DCHECK_CURRENTLY_ON(BrowserThread::IO); |
return weak_ptr_factory_.GetWeakPtr(); |
} |