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 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 child_id, | 895 child_id, |
896 route_id, | 896 route_id, |
897 is_continuation_of_transferred_request, | 897 is_continuation_of_transferred_request, |
898 &throttles); | 898 &throttles); |
899 if (!throttles.empty()) { | 899 if (!throttles.empty()) { |
900 handler = new ThrottlingResourceHandler(this, handler, child_id, | 900 handler = new ThrottlingResourceHandler(this, handler, child_id, |
901 request_id, throttles.Pass()); | 901 request_id, throttles.Pass()); |
902 } | 902 } |
903 } | 903 } |
904 | 904 |
| 905 bool allow_download = request_data.allow_download && |
| 906 ResourceType::IsFrame(request_data.resource_type); |
905 // Make extra info and read footer (contains request ID). | 907 // Make extra info and read footer (contains request ID). |
906 ResourceRequestInfoImpl* extra_info = | 908 ResourceRequestInfoImpl* extra_info = |
907 new ResourceRequestInfoImpl( | 909 new ResourceRequestInfoImpl( |
908 handler, | 910 handler, |
909 process_type, | 911 process_type, |
910 child_id, | 912 child_id, |
911 route_id, | 913 route_id, |
912 request_data.origin_pid, | 914 request_data.origin_pid, |
913 request_id, | 915 request_id, |
914 request_data.is_main_frame, | 916 request_data.is_main_frame, |
915 request_data.frame_id, | 917 request_data.frame_id, |
916 request_data.parent_is_main_frame, | 918 request_data.parent_is_main_frame, |
917 request_data.parent_frame_id, | 919 request_data.parent_frame_id, |
918 request_data.resource_type, | 920 request_data.resource_type, |
919 request_data.transition_type, | 921 request_data.transition_type, |
920 upload_size, | 922 upload_size, |
921 false, // is download | 923 false, // is download |
922 ResourceType::IsFrame(request_data.resource_type), // allow_download | 924 allow_download, |
923 request_data.has_user_gesture, | 925 request_data.has_user_gesture, |
924 request_data.referrer_policy, | 926 request_data.referrer_policy, |
925 resource_context); | 927 resource_context); |
926 extra_info->AssociateWithRequest(request); // Request takes ownership. | 928 extra_info->AssociateWithRequest(request); // Request takes ownership. |
927 | 929 |
928 if (request->url().SchemeIs(chrome::kBlobScheme)) { | 930 if (request->url().SchemeIs(chrome::kBlobScheme)) { |
929 // Hang on to a reference to ensure the blob is not released prior | 931 // Hang on to a reference to ensure the blob is not released prior |
930 // to the job being started. | 932 // to the job being started. |
931 webkit_blob::BlobStorageController* controller = | 933 webkit_blob::BlobStorageController* controller = |
932 GetBlobStorageControllerForResourceContext(resource_context); | 934 GetBlobStorageControllerForResourceContext(resource_context); |
(...skipping 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2334 return allow_cross_origin_auth_prompt_; | 2336 return allow_cross_origin_auth_prompt_; |
2335 } | 2337 } |
2336 | 2338 |
2337 bool ResourceDispatcherHostImpl::IsTransferredNavigation( | 2339 bool ResourceDispatcherHostImpl::IsTransferredNavigation( |
2338 const GlobalRequestID& transferred_request_id) const { | 2340 const GlobalRequestID& transferred_request_id) const { |
2339 return transferred_navigations_.find(transferred_request_id) != | 2341 return transferred_navigations_.find(transferred_request_id) != |
2340 transferred_navigations_.end(); | 2342 transferred_navigations_.end(); |
2341 } | 2343 } |
2342 | 2344 |
2343 } // namespace content | 2345 } // namespace content |
OLD | NEW |