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

Unified Diff: content/browser/renderer_host/resource_dispatcher_host.cc

Issue 6995118: Set isCancelling flag on WebURLError when request has net::ERR_ABORTED as an error_code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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
« no previous file with comments | « no previous file | webkit/glue/weburlloader_impl.cc » ('j') | webkit/glue/weburlloader_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/resource_dispatcher_host.cc
diff --git a/content/browser/renderer_host/resource_dispatcher_host.cc b/content/browser/renderer_host/resource_dispatcher_host.cc
index e6f4191c52ae924f38f2a5db6046a1c3003dcbbb..e5a55ad656c93988512165f5ef8adf77a561fda6 100644
--- a/content/browser/renderer_host/resource_dispatcher_host.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host.cc
@@ -144,6 +144,29 @@ void AbortRequestBeforeItStarts(ResourceMessageFilter* filter,
}
}
+// Aborts a request before an URLRequest has actually been created.
+void CancelRequestBeforeItStarts(ResourceMessageFilter* filter,
gavinp 2011/06/15 15:31:23 Instead of writing this function, add a bool or en
+ IPC::Message* sync_result,
+ int route_id,
+ int request_id) {
+ net::URLRequestStatus status(net::URLRequestStatus::CANCELED,
+ net::ERR_ABORTED);
+ if (sync_result) {
+ SyncLoadResult result;
+ result.status = status;
+ ResourceHostMsg_SyncLoad::WriteReplyParams(sync_result, result);
+ filter->Send(sync_result);
+ } else {
+ // Tell the renderer that this request was disallowed.
+ filter->Send(new ResourceMsg_RequestComplete(
+ route_id,
+ request_id,
+ status,
+ std::string(), // No security info needed, connection was not
+ base::Time())); // established.
+ }
+}
+
GURL MaybeStripReferrer(const GURL& possible_referrer) {
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoReferrers))
return GURL();
@@ -397,7 +420,7 @@ void ResourceDispatcherHost::BeginRequest(
request_data,
resource_context,
referrer)) {
- AbortRequestBeforeItStarts(filter_, sync_result, route_id, request_id);
+ CancelRequestBeforeItStarts(filter_, sync_result, route_id, request_id);
return;
}
« no previous file with comments | « no previous file | webkit/glue/weburlloader_impl.cc » ('j') | webkit/glue/weburlloader_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698