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

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

Issue 10640019: Remove the HANDLED_EXTERNALLY status code. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase + fix nits Created 8 years, 3 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 | « chrome/renderer/security_filter_peer.cc ('k') | content/browser/renderer_host/buffered_resource_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/async_resource_handler.cc
diff --git a/content/browser/renderer_host/async_resource_handler.cc b/content/browser/renderer_host/async_resource_handler.cc
index 85103f57d28d30bbc1f3d5dd269a6023b65de75c..e77a9817507413fd04b17fac2f93cd27e43a846d 100644
--- a/content/browser/renderer_host/async_resource_handler.cc
+++ b/content/browser/renderer_host/async_resource_handler.cc
@@ -309,9 +309,31 @@ bool AsyncResourceHandler::OnResponseCompleted(
sent_received_response_msg_);
TimeTicks completion_time = TimeTicks::Now();
+
+ int error_code = status.error();
+ bool was_ignored_by_handler =
+ ResourceRequestInfoImpl::ForRequest(request_)->WasIgnoredByHandler();
+
+ DCHECK(status.status() != net::URLRequestStatus::IO_PENDING);
+ // If this check fails, then we're in an inconsistent state because all
+ // requests ignored by the handler should be canceled (which should result in
+ // the ERR_ABORTED error code).
+ DCHECK(!was_ignored_by_handler || error_code == net::ERR_ABORTED);
+
+ // TODO(mkosiba): Fix up cases where we create a URLRequestStatus
+ // with a status() != SUCCESS and an error_code() == net::OK.
+ if (status.status() == net::URLRequestStatus::CANCELED &&
+ error_code == net::OK) {
+ error_code = net::ERR_ABORTED;
+ } else if (status.status() == net::URLRequestStatus::FAILED &&
+ error_code == net::OK) {
+ error_code = net::ERR_FAILED;
+ }
+
filter_->Send(new ResourceMsg_RequestComplete(routing_id_,
request_id,
- status,
+ error_code,
+ was_ignored_by_handler,
security_info,
completion_time));
« no previous file with comments | « chrome/renderer/security_filter_peer.cc ('k') | content/browser/renderer_host/buffered_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698