Chromium Code Reviews| 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 bd9f1ec1336827b1b9008f886c11f9bba1f7bfd8..936d1d0c49e5ba5960ceabddb9277863e3cc4da3 100644 |
| --- a/content/browser/renderer_host/resource_dispatcher_host.cc |
| +++ b/content/browser/renderer_host/resource_dispatcher_host.cc |
| @@ -1170,14 +1170,17 @@ void ResourceDispatcherHost::CancelRequest(int child_id, |
| } |
| net::URLRequest* request = i->second; |
| const bool started_before_cancel = request->is_pending(); |
| - CancelRequestInternal(request, from_renderer); |
| - // If the request isn't in flight, then we won't get asyncronous notification, |
| - // so we have to signal ourselves to finish this request. |
| - if (!started_before_cancel) |
| + |
| + if (CancelRequestInternal(request, from_renderer) && |
| + !started_before_cancel) { |
| + // If the request isn't in flight, then we won't get asyncronous |
| + // notification, so we have to signal ourselves to finish this |
| + // request. |
| OnResponseCompleted(request); |
| + } |
| } |
| -void ResourceDispatcherHost::CancelRequestInternal(net::URLRequest* request, |
| +bool ResourceDispatcherHost::CancelRequestInternal(net::URLRequest* request, |
| bool from_renderer) { |
| VLOG(1) << "CancelRequest: " << request->url().spec(); |
| @@ -1196,11 +1199,13 @@ void ResourceDispatcherHost::CancelRequestInternal(net::URLRequest* request, |
| request->Cancel(); |
|
rvargas (doing something else)
2011/03/21 22:38:10
Did you considered moving the pending check to thi
asanka
2011/03/22 14:52:42
My concern was that request->is_pending() being fa
|
| // Our callers assume |request| is valid after we return. |
| DCHECK(IsValidRequest(request)); |
| + return true; |
| } |
| // Do not remove from the pending requests, as the request will still |
| // call AllDataReceived, and may even have more data before it does |
| // that. |
| + return false; |
| } |
| int ResourceDispatcherHost::IncrementOutstandingRequestsMemoryCost( |