OLD | NEW |
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 <algorithm> | 9 #include <algorithm> |
10 #include <set> | 10 #include <set> |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 new_url)); | 812 new_url)); |
813 BrowserThread::PostTask( | 813 BrowserThread::PostTask( |
814 BrowserThread::UI, FROM_HERE, | 814 BrowserThread::UI, FROM_HERE, |
815 base::Bind( | 815 base::Bind( |
816 &NotifyRedirectOnUI, | 816 &NotifyRedirectOnUI, |
817 render_process_id, render_frame_host, base::Passed(&detail))); | 817 render_process_id, render_frame_host, base::Passed(&detail))); |
818 } | 818 } |
819 | 819 |
820 void ResourceDispatcherHostImpl::DidReceiveResponse(ResourceLoader* loader) { | 820 void ResourceDispatcherHostImpl::DidReceiveResponse(ResourceLoader* loader) { |
821 ResourceRequestInfoImpl* info = loader->GetRequestInfo(); | 821 ResourceRequestInfoImpl* info = loader->GetRequestInfo(); |
822 | 822 net::URLRequest* request = loader->request(); |
823 if (loader->request()->was_fetched_via_proxy() && | 823 if (request->was_fetched_via_proxy() && |
824 loader->request()->was_fetched_via_spdy() && | 824 request->was_fetched_via_spdy() && |
825 loader->request()->url().SchemeIs(url::kHttpScheme)) { | 825 request->url().SchemeIs(url::kHttpScheme)) { |
826 scheduler_->OnReceivedSpdyProxiedHttpResponse( | 826 scheduler_->OnReceivedSpdyProxiedHttpResponse( |
827 info->GetChildID(), info->GetRouteID()); | 827 info->GetChildID(), info->GetRouteID()); |
828 } | 828 } |
829 | 829 |
830 int render_process_id, render_frame_host; | 830 int render_process_id, render_frame_host; |
831 if (!info->GetAssociatedRenderFrame(&render_process_id, &render_frame_host)) | 831 if (!info->GetAssociatedRenderFrame(&render_process_id, &render_frame_host)) |
832 return; | 832 return; |
833 | 833 |
834 // Notify the observers on the UI thread. | 834 // Notify the observers on the UI thread. |
835 scoped_ptr<ResourceRequestDetails> detail(new ResourceRequestDetails( | 835 scoped_ptr<ResourceRequestDetails> detail(new ResourceRequestDetails( |
836 loader->request(), | 836 request, GetCertID(request, info->GetChildID()))); |
837 GetCertID(loader->request(), info->GetChildID()))); | |
838 BrowserThread::PostTask( | 837 BrowserThread::PostTask( |
839 BrowserThread::UI, FROM_HERE, | 838 BrowserThread::UI, FROM_HERE, |
840 base::Bind( | 839 base::Bind( |
841 &NotifyResponseOnUI, | 840 &NotifyResponseOnUI, |
842 render_process_id, render_frame_host, base::Passed(&detail))); | 841 render_process_id, render_frame_host, base::Passed(&detail))); |
843 } | 842 } |
844 | 843 |
845 void ResourceDispatcherHostImpl::DidFinishLoading(ResourceLoader* loader) { | 844 void ResourceDispatcherHostImpl::DidFinishLoading(ResourceLoader* loader) { |
846 ResourceRequestInfo* info = loader->GetRequestInfo(); | 845 ResourceRequestInfo* info = loader->GetRequestInfo(); |
847 | 846 |
(...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2366 | 2365 |
2367 // Add a flag to selectively bypass the data reduction proxy if the resource | 2366 // Add a flag to selectively bypass the data reduction proxy if the resource |
2368 // type is not an image. | 2367 // type is not an image. |
2369 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) | 2368 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) |
2370 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; | 2369 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; |
2371 | 2370 |
2372 return load_flags; | 2371 return load_flags; |
2373 } | 2372 } |
2374 | 2373 |
2375 } // namespace content | 2374 } // namespace content |
OLD | NEW |