| 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 6b3e7706856ae695d8ca4f5b78da5bc023248c94..3709943c1e1ffdd47c11040dd10576328fbd223c 100644
|
| --- a/content/browser/loader/resource_dispatcher_host_impl.cc
|
| +++ b/content/browser/loader/resource_dispatcher_host_impl.cc
|
| @@ -1806,26 +1806,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(
|
| @@ -2454,6 +2436,25 @@ 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);
|
| +
|
| + // 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) {
|
|
|