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

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

Issue 2741433002: Fix ResourceDispatcherHostDelegate::OnResponseStarted not getting called for navigation requests (Closed)
Patch Set: fix mojo unittests Created 3 years, 9 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
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 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 767
768 // Notify the observers on the UI thread. 768 // Notify the observers on the UI thread.
769 std::unique_ptr<ResourceRedirectDetails> detail(new ResourceRedirectDetails( 769 std::unique_ptr<ResourceRedirectDetails> detail(new ResourceRedirectDetails(
770 loader->request(), 770 loader->request(),
771 !!request->ssl_info().cert, 771 !!request->ssl_info().cert,
772 new_url)); 772 new_url));
773 loader_delegate_->DidGetRedirectForResourceRequest( 773 loader_delegate_->DidGetRedirectForResourceRequest(
774 info->GetWebContentsGetterForRequest(), std::move(detail)); 774 info->GetWebContentsGetterForRequest(), std::move(detail));
775 } 775 }
776 776
777 void ResourceDispatcherHostImpl::DidReceiveResponse(ResourceLoader* loader) { 777 void ResourceDispatcherHostImpl::DidReceiveResponse(
778 ResourceLoader* loader,
779 ResourceResponse* response) {
778 ResourceRequestInfoImpl* info = loader->GetRequestInfo(); 780 ResourceRequestInfoImpl* info = loader->GetRequestInfo();
779 net::URLRequest* request = loader->request(); 781 net::URLRequest* request = loader->request();
780 if (request->was_fetched_via_proxy() && 782 if (request->was_fetched_via_proxy() &&
781 request->was_fetched_via_spdy() && 783 request->was_fetched_via_spdy() &&
782 request->url().SchemeIs(url::kHttpScheme)) { 784 request->url().SchemeIs(url::kHttpScheme)) {
783 scheduler_->OnReceivedSpdyProxiedHttpResponse( 785 scheduler_->OnReceivedSpdyProxiedHttpResponse(
784 info->GetChildID(), info->GetRouteID()); 786 info->GetChildID(), info->GetRouteID());
785 } 787 }
786 788
787 if (request->response_info().async_revalidation_required) { 789 if (request->response_info().async_revalidation_required) {
788 DCHECK(async_revalidation_manager_); 790 DCHECK(async_revalidation_manager_);
789 async_revalidation_manager_->BeginAsyncRevalidation(request, 791 async_revalidation_manager_->BeginAsyncRevalidation(request,
790 scheduler_.get()); 792 scheduler_.get());
791 } 793 }
792 794
793 ProcessRequestForLinkHeaders(request); 795 ProcessRequestForLinkHeaders(request);
794 796
795 int render_process_id, render_frame_host; 797 if (delegate_)
796 if (!info->GetAssociatedRenderFrame(&render_process_id, &render_frame_host)) 798 delegate_->OnResponseStarted(request, info->GetContext(), response);
797 return;
798 799
799 // Don't notify WebContents observers for requests known to be 800 // Don't notify WebContents observers for requests known to be
800 // downloads; they aren't really associated with the Webcontents. 801 // downloads; they aren't really associated with the Webcontents.
801 // Note that not all downloads are known before content sniffing. 802 // Note that not all downloads are known before content sniffing.
802 if (info->IsDownload()) 803 if (info->IsDownload())
803 return; 804 return;
804 805
805 // Notify the observers on the UI thread. 806 // Notify the observers on the UI thread.
806 std::unique_ptr<ResourceRequestDetails> detail(new ResourceRequestDetails( 807 std::unique_ptr<ResourceRequestDetails> detail(new ResourceRequestDetails(
807 request, !!request->ssl_info().cert)); 808 request, !!request->ssl_info().cert));
(...skipping 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after
2791 &throttles); 2792 &throttles);
2792 if (!throttles.empty()) { 2793 if (!throttles.empty()) {
2793 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, 2794 handler.reset(new ThrottlingResourceHandler(std::move(handler), request,
2794 std::move(throttles))); 2795 std::move(throttles)));
2795 } 2796 }
2796 } 2797 }
2797 return handler; 2798 return handler;
2798 } 2799 }
2799 2800
2800 } // namespace content 2801 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.h ('k') | content/browser/loader/resource_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698