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

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 2303733004: Eliminate spurious request cancelations (Closed)
Patch Set: Fixed dispatcher unit test Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/child/resource_dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" 7 #include "content/browser/loader/resource_dispatcher_host_impl.h"
8 8
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after
1755 // CancelRequest methods in this file, which also tear down the loader. 1755 // CancelRequest methods in this file, which also tear down the loader.
1756 void ResourceDispatcherHostImpl::OnCancelRequest(int request_id) { 1756 void ResourceDispatcherHostImpl::OnCancelRequest(int request_id) {
1757 int child_id = filter_->child_id(); 1757 int child_id = filter_->child_id();
1758 1758
1759 // When the old renderer dies, it sends a message to us to cancel its 1759 // When the old renderer dies, it sends a message to us to cancel its
1760 // requests. 1760 // requests.
1761 if (IsTransferredNavigation(GlobalRequestID(child_id, request_id))) 1761 if (IsTransferredNavigation(GlobalRequestID(child_id, request_id)))
1762 return; 1762 return;
1763 1763
1764 ResourceLoader* loader = GetLoader(child_id, request_id); 1764 ResourceLoader* loader = GetLoader(child_id, request_id);
1765 if (!loader) { 1765
1766 // We probably want to remove this warning eventually, but I wanted to be 1766 // It is possible that the request has been completed and removed from the
1767 // able to notice when this happens during initial development since it 1767 // loader queue but the client has not processed the request completed message
1768 // should be rare and may indicate a bug. 1768 // before issuing a cancel. This happens frequently for beacons which are
1769 DVLOG(1) << "Canceling a request that wasn't found"; 1769 // canceled in the response received handler.
1770 if (!loader)
1770 return; 1771 return;
1771 }
1772 1772
1773 loader->CancelRequest(true); 1773 loader->CancelRequest(true);
1774 } 1774 }
1775 1775
1776 ResourceRequestInfoImpl* ResourceDispatcherHostImpl::CreateRequestInfo( 1776 ResourceRequestInfoImpl* ResourceDispatcherHostImpl::CreateRequestInfo(
1777 int child_id, 1777 int child_id,
1778 int render_view_route_id, 1778 int render_view_route_id,
1779 int render_frame_route_id, 1779 int render_frame_route_id,
1780 bool download, 1780 bool download,
1781 ResourceContext* context) { 1781 ResourceContext* context) {
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
2705 request_info->GetRouteID(), is_content_initiated, true, &throttles); 2705 request_info->GetRouteID(), is_content_initiated, true, &throttles);
2706 if (!throttles.empty()) { 2706 if (!throttles.empty()) {
2707 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, 2707 handler.reset(new ThrottlingResourceHandler(std::move(handler), request,
2708 std::move(throttles))); 2708 std::move(throttles)));
2709 } 2709 }
2710 } 2710 }
2711 return handler; 2711 return handler;
2712 } 2712 }
2713 2713
2714 } // namespace content 2714 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/child/resource_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698