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

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: add a DCHECK to async_resource_handler Created 8 years, 4 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/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..d5a7e5b1aaa391b290df973ccb5d1bb7e8b359d4 100644
--- a/content/browser/renderer_host/async_resource_handler.cc
+++ b/content/browser/renderer_host/async_resource_handler.cc
@@ -309,9 +309,29 @@ bool AsyncResourceHandler::OnResponseCompleted(
sent_received_response_msg_);
TimeTicks completion_time = TimeTicks::Now();
+
+ int error_code = status.error();
+ if (status.status() == net::URLRequestStatus::IO_PENDING)
darin (slow to review) 2012/08/30 16:15:18 It should not be possible for status.status() to b
mkosiba (inactive) 2012/08/31 14:45:10 Done.
+ error_code = net::ERR_IO_PENDING;
+ else 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;
darin (slow to review) 2012/08/30 16:15:18 I think you should take error_code from status.err
mkosiba (inactive) 2012/08/31 14:45:10 This only fixes up cases where code uses URLReques
+
+ ResourceRequestInfoImpl* info =
+ ResourceRequestInfoImpl::ForRequest(request_);
+ // If this check fails, then we're in an inconsistent state because all
mkosiba (inactive) 2012/08/30 15:29:43 not sure if this is the best place to put the chec
+ // requests ignored by the handler should be canceled (which should result in
+ // the ERR_ABORTED error code.
+ DCHECK(!info || !info->WasIgnoredByHandler() ||
darin (slow to review) 2012/08/30 16:15:18 I recommend saving WasIgnoredByHandler to a variab
mkosiba (inactive) 2012/08/31 14:45:10 Done.
+ error_code == net::ERR_ABORTED);
+
filter_->Send(new ResourceMsg_RequestComplete(routing_id_,
request_id,
- status,
+ error_code,
+ info->WasIgnoredByHandler(),
security_info,
completion_time));

Powered by Google App Engine
This is Rietveld 408576698