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

Unified Diff: content/browser/resource_context_impl.cc

Issue 10389030: Fixed CHECKs for use of canceled ResourceContexts in ResourceDispatcherHostImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed compile errors. Created 8 years, 7 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: content/browser/resource_context_impl.cc
diff --git a/content/browser/resource_context_impl.cc b/content/browser/resource_context_impl.cc
index db1baeb342e99ca8688f2e10dbbeb93f5979de55..40d95890da55e875e0cabe9fb280400420b64bcb 100644
--- a/content/browser/resource_context_impl.cc
+++ b/content/browser/resource_context_impl.cc
@@ -180,9 +180,17 @@ AppCacheService* ResourceContext::GetAppCacheService(ResourceContext* context) {
context, kAppCacheServicKeyName);
}
-ResourceContext::~ResourceContext() {
+ResourceContext::ResourceContext() {
if (ResourceDispatcherHostImpl::Get())
- ResourceDispatcherHostImpl::Get()->CancelRequestsForContext(this);
+ ResourceDispatcherHostImpl::Get()->AddResourceContext(this);
+}
+
+ResourceContext::~ResourceContext() {
+ ResourceDispatcherHostImpl* rdhi = ResourceDispatcherHostImpl::Get();
+ if (rdhi) {
+ rdhi->CancelRequestsForContext(this);
+ rdhi->RemoveResourceContext(this);
+ }
}
BlobStorageController* GetBlobStorageControllerForResourceContext(
« no previous file with comments | « content/browser/renderer_host/resource_dispatcher_host_impl.cc ('k') | content/public/browser/resource_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698