diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-26 14:38:15 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-26 14:38:15 +0000 |
commit | 9a3b349b671809ce7d790a6e0218689cabb7d9b2 (patch) | |
tree | dcd1702b0523c9fc84e3ba61ada19ebad84d6b70 /content/browser/resource_context_impl.cc | |
parent | bc00d9ca499e3c51f00c01e51ed9c17b43d8b594 (diff) | |
download | chromium_src-9a3b349b671809ce7d790a6e0218689cabb7d9b2.zip chromium_src-9a3b349b671809ce7d790a6e0218689cabb7d9b2.tar.gz chromium_src-9a3b349b671809ce7d790a6e0218689cabb7d9b2.tar.bz2 |
Have content cancel requests for ResourceContexts when they shutdown, instead of depending on the embedder to do this.
I ran into DCHECKs in tests that were running as browser_tests but should have been running as unittests instead. I made them unittests which should also make them faster and remove the flakiness.
BUG=98716,115188,115150,115307
Review URL: https://chromiumcodereview.appspot.com/9836066
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128909 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/resource_context_impl.cc')
-rw-r--r-- | content/browser/resource_context_impl.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/content/browser/resource_context_impl.cc b/content/browser/resource_context_impl.cc index a3768db..fa3fa7e 100644 --- a/content/browser/resource_context_impl.cc +++ b/content/browser/resource_context_impl.cc @@ -12,6 +12,7 @@ #include "content/browser/in_process_webkit/indexed_db_context_impl.h" #include "content/browser/net/view_blob_internals_job_factory.h" #include "content/browser/net/view_http_cache_job_factory.h" +#include "content/browser/renderer_host/resource_dispatcher_host_impl.h" #include "content/browser/renderer_host/resource_request_info_impl.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" @@ -165,6 +166,11 @@ AppCacheService* ResourceContext::GetAppCacheService(ResourceContext* context) { context, kAppCacheServicKeyName); } +ResourceContext::~ResourceContext() { + if (ResourceDispatcherHostImpl::Get()) + ResourceDispatcherHostImpl::Get()->CancelRequestsForContext(this); +} + BlobStorageController* GetBlobStorageControllerForResourceContext( ResourceContext* resource_context) { return GetChromeBlobStorageContextForResourceContext(resource_context)-> |