Chromium Code Reviews| 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..084125fb45514f79c92a572f118aff0b57c36446 100644 |
| --- a/content/browser/renderer_host/async_resource_handler.cc |
| +++ b/content/browser/renderer_host/async_resource_handler.cc |
| @@ -309,9 +309,30 @@ 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) |
|
darin (slow to review)
2012/08/31 16:15:51
nit: indentation... realize you are probably align
mkosiba (inactive)
2012/09/06 18:30:22
no idea how the indent ended up this way, certainl
|
| + error_code = net::ERR_ABORTED; |
| + else if (status.status() == net::URLRequestStatus::FAILED && |
| + error_code == net::OK) |
| + error_code = net::ERR_FAILED; |
|
mmenke
2012/08/31 16:17:23
Random nit: Should also use brackets when the pre
darin (slow to review)
2012/08/31 16:55:51
Agreed. I had a similar thought, but didn't reali
mkosiba (inactive)
2012/09/06 18:30:22
Done.
|
| + |
| filter_->Send(new ResourceMsg_RequestComplete(routing_id_, |
| request_id, |
| - status, |
| + error_code, |
| + was_ignored_by_handler, |
| security_info, |
| completion_time)); |