Index: content/browser/renderer_host/resource_dispatcher_host_impl.cc |
diff --git a/content/browser/renderer_host/resource_dispatcher_host_impl.cc b/content/browser/renderer_host/resource_dispatcher_host_impl.cc |
index a74a4389b913e68f4470df548a5a18b74d656e3b..a5fe3371108c8e72521d38335002403d7c8feb96 100644 |
--- a/content/browser/renderer_host/resource_dispatcher_host_impl.cc |
+++ b/content/browser/renderer_host/resource_dispatcher_host_impl.cc |
@@ -371,12 +371,22 @@ void ResourceDispatcherHostImpl::SetAllowCrossOriginAuthPrompt(bool value) { |
allow_cross_origin_auth_prompt_ = value; |
} |
+void ResourceDispatcherHostImpl::AddResourceContext(ResourceContext* context) { |
+ active_resource_contexts_.insert(context); |
+} |
+ |
+void ResourceDispatcherHostImpl::RemoveResourceContext( |
+ ResourceContext* context) { |
+ CHECK(ContainsKey(active_resource_contexts_, context)); |
+ active_resource_contexts_.erase(context); |
+} |
+ |
void ResourceDispatcherHostImpl::CancelRequestsForContext( |
ResourceContext* context) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
DCHECK(context); |
- canceled_resource_contexts_.insert(context); |
+ CHECK(ContainsKey(active_resource_contexts_, context)); |
// Note that request cancellation has side effects. Therefore, we gather all |
// the requests to cancel first, and then we start cancelling. We assert at |
@@ -481,7 +491,7 @@ net::Error ResourceDispatcherHostImpl::BeginDownload( |
char url_buf[128]; |
base::strlcpy(url_buf, url.spec().c_str(), arraysize(url_buf)); |
base::debug::Alias(url_buf); |
- CHECK(!ContainsKey(canceled_resource_contexts_, context)); |
+ CHECK(ContainsKey(active_resource_contexts_, context)); |
const net::URLRequestContext* request_context = context->GetRequestContext(); |
request->set_referrer(MaybeStripReferrer(GURL(request->referrer())).spec()); |
@@ -754,7 +764,7 @@ void ResourceDispatcherHostImpl::BeginRequest( |
ResourceContext* resource_context = filter_->resource_context(); |
// http://crbug.com/90971 |
- CHECK(!ContainsKey(canceled_resource_contexts_, resource_context)); |
+ CHECK(ContainsKey(active_resource_contexts_, resource_context)); |
// Might need to resolve the blob references in the upload data. |
if (request_data.upload_data) { |
@@ -1160,7 +1170,7 @@ void ResourceDispatcherHostImpl::BeginSaveFile( |
char url_buf[128]; |
base::strlcpy(url_buf, url.spec().c_str(), arraysize(url_buf)); |
base::debug::Alias(url_buf); |
- CHECK(!ContainsKey(canceled_resource_contexts_, context)); |
+ CHECK(ContainsKey(active_resource_contexts_, context)); |
scoped_refptr<ResourceHandler> handler( |
new SaveFileResourceHandler(child_id, |