Chromium Code Reviews| 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, |
| 837 GetCertID(loader->request(), info->GetChildID()))); | 837 GetCertID(request, info->GetChildID()))); |
|
mmenke
2015/06/18 14:47:15
optional: Could merge this with the above line, n
Adam Rice
2015/06/19 07:00:23
Done.
| |
| 838 BrowserThread::PostTask( | 838 BrowserThread::PostTask( |
| 839 BrowserThread::UI, FROM_HERE, | 839 BrowserThread::UI, FROM_HERE, |
| 840 base::Bind( | 840 base::Bind( |
| 841 &NotifyResponseOnUI, | 841 &NotifyResponseOnUI, |
| 842 render_process_id, render_frame_host, base::Passed(&detail))); | 842 render_process_id, render_frame_host, base::Passed(&detail))); |
| 843 } | 843 } |
| 844 | 844 |
| 845 void ResourceDispatcherHostImpl::DidFinishLoading(ResourceLoader* loader) { | 845 void ResourceDispatcherHostImpl::DidFinishLoading(ResourceLoader* loader) { |
| 846 ResourceRequestInfo* info = loader->GetRequestInfo(); | 846 ResourceRequestInfo* info = loader->GetRequestInfo(); |
| 847 | 847 |
| (...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2366 | 2366 |
| 2367 // Add a flag to selectively bypass the data reduction proxy if the resource | 2367 // Add a flag to selectively bypass the data reduction proxy if the resource |
| 2368 // type is not an image. | 2368 // type is not an image. |
| 2369 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) | 2369 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) |
| 2370 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; | 2370 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; |
| 2371 | 2371 |
| 2372 return load_flags; | 2372 return load_flags; |
| 2373 } | 2373 } |
| 2374 | 2374 |
| 2375 } // namespace content | 2375 } // namespace content |
| OLD | NEW |