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/renderer_host/resource_dispatcher_host_impl.h" | 7 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 child_id, | 880 child_id, |
881 route_id, | 881 route_id, |
882 is_continuation_of_transferred_request, | 882 is_continuation_of_transferred_request, |
883 &throttles); | 883 &throttles); |
884 if (!throttles.empty()) { | 884 if (!throttles.empty()) { |
885 handler = new ThrottlingResourceHandler(this, handler, child_id, | 885 handler = new ThrottlingResourceHandler(this, handler, child_id, |
886 request_id, throttles.Pass()); | 886 request_id, throttles.Pass()); |
887 } | 887 } |
888 } | 888 } |
889 | 889 |
| 890 bool allow_download = request_data.allow_download && |
| 891 ResourceType::IsFrame(request_data.resource_type); |
890 // Make extra info and read footer (contains request ID). | 892 // Make extra info and read footer (contains request ID). |
891 ResourceRequestInfoImpl* extra_info = | 893 ResourceRequestInfoImpl* extra_info = |
892 new ResourceRequestInfoImpl( | 894 new ResourceRequestInfoImpl( |
893 handler, | 895 handler, |
894 process_type, | 896 process_type, |
895 child_id, | 897 child_id, |
896 route_id, | 898 route_id, |
897 request_data.origin_pid, | 899 request_data.origin_pid, |
898 request_id, | 900 request_id, |
899 request_data.is_main_frame, | 901 request_data.is_main_frame, |
900 request_data.frame_id, | 902 request_data.frame_id, |
901 request_data.parent_is_main_frame, | 903 request_data.parent_is_main_frame, |
902 request_data.parent_frame_id, | 904 request_data.parent_frame_id, |
903 request_data.resource_type, | 905 request_data.resource_type, |
904 request_data.transition_type, | 906 request_data.transition_type, |
905 upload_size, | 907 upload_size, |
906 false, // is download | 908 false, // is download |
907 ResourceType::IsFrame(request_data.resource_type), // allow_download | 909 allow_download, |
908 request_data.has_user_gesture, | 910 request_data.has_user_gesture, |
909 request_data.referrer_policy, | 911 request_data.referrer_policy, |
910 resource_context); | 912 resource_context); |
911 extra_info->AssociateWithRequest(request); // Request takes ownership. | 913 extra_info->AssociateWithRequest(request); // Request takes ownership. |
912 | 914 |
913 if (request->url().SchemeIs(chrome::kBlobScheme)) { | 915 if (request->url().SchemeIs(chrome::kBlobScheme)) { |
914 // Hang on to a reference to ensure the blob is not released prior | 916 // Hang on to a reference to ensure the blob is not released prior |
915 // to the job being started. | 917 // to the job being started. |
916 webkit_blob::BlobStorageController* controller = | 918 webkit_blob::BlobStorageController* controller = |
917 GetBlobStorageControllerForResourceContext(resource_context); | 919 GetBlobStorageControllerForResourceContext(resource_context); |
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2293 return allow_cross_origin_auth_prompt_; | 2295 return allow_cross_origin_auth_prompt_; |
2294 } | 2296 } |
2295 | 2297 |
2296 bool ResourceDispatcherHostImpl::IsTransferredNavigation( | 2298 bool ResourceDispatcherHostImpl::IsTransferredNavigation( |
2297 const GlobalRequestID& transferred_request_id) const { | 2299 const GlobalRequestID& transferred_request_id) const { |
2298 return transferred_navigations_.find(transferred_request_id) != | 2300 return transferred_navigations_.find(transferred_request_id) != |
2299 transferred_navigations_.end(); | 2301 transferred_navigations_.end(); |
2300 } | 2302 } |
2301 | 2303 |
2302 } // namespace content | 2304 } // namespace content |
OLD | NEW |