Chromium Code Reviews| Index: content/browser/loader/resource_dispatcher_host_impl.cc |
| diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc |
| index 16be639f7207a921d5403da720bf1ea16cb5d07e..7e6dac0eb53f88f781d285bd3b3427cd23407268 100644 |
| --- a/content/browser/loader/resource_dispatcher_host_impl.cc |
| +++ b/content/browser/loader/resource_dispatcher_host_impl.cc |
| @@ -1805,26 +1805,8 @@ bool ResourceDispatcherHostImpl::Send(IPC::Message* message) { |
| return false; |
| } |
| -// Note that this cancel is subtly different from the other |
| -// CancelRequest methods in this file, which also tear down the loader. |
| void ResourceDispatcherHostImpl::OnCancelRequest(int request_id) { |
| - int child_id = filter_->child_id(); |
| - |
| - // When the old renderer dies, it sends a message to us to cancel its |
| - // requests. |
| - if (IsTransferredNavigation(GlobalRequestID(child_id, request_id))) |
| - return; |
| - |
| - ResourceLoader* loader = GetLoader(child_id, request_id); |
| - |
| - // It is possible that the request has been completed and removed from the |
| - // loader queue but the client has not processed the request completed message |
| - // before issuing a cancel. This happens frequently for beacons which are |
| - // canceled in the response received handler. |
| - if (!loader) |
| - return; |
| - |
| - loader->CancelRequest(true); |
| + CancelRequestFromRenderer(GlobalRequestID(filter_->child_id(), request_id)); |
| } |
| ResourceRequestInfoImpl* ResourceDispatcherHostImpl::CreateRequestInfo( |
| @@ -2453,6 +2435,26 @@ int ResourceDispatcherHostImpl::MakeRequestID() { |
| return --request_id_; |
| } |
| +void ResourceDispatcherHostImpl::CancelRequestFromRenderer( |
| + GlobalRequestID request_id) { |
| + // When the old renderer dies, it sends a message to us to cancel its |
| + // requests. |
| + if (IsTransferredNavigation(request_id)) |
| + return; |
| + |
| + ResourceLoader* loader = |
| + GetLoader(request_id.child_id, request_id.request_id); |
|
mmenke
2016/11/03 18:17:41
nit: GetLoader(request_id) (There's an overload t
yhirano
2016/11/08 11:52:23
Done.
|
| + |
| + // It is possible that the request has been completed and removed from the |
| + // loader queue but the client has not processed the request completed message |
| + // before issuing a cancel. This happens frequently for beacons which are |
| + // canceled in the response received handler. |
| + if (!loader) |
| + return; |
| + |
| + loader->CancelRequest(true); |
| +} |
| + |
| void ResourceDispatcherHostImpl::StartLoading( |
| ResourceRequestInfoImpl* info, |
| std::unique_ptr<ResourceLoader> loader) { |