| 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 <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1214 int request_id, | 1214 int request_id, |
| 1215 const ResourceRequest& request_data, | 1215 const ResourceRequest& request_data, |
| 1216 int route_id, | 1216 int route_id, |
| 1217 mojom::URLLoaderAssociatedRequest mojo_request, | 1217 mojom::URLLoaderAssociatedRequest mojo_request, |
| 1218 mojom::URLLoaderClientAssociatedPtr url_loader_client) { | 1218 mojom::URLLoaderClientAssociatedPtr url_loader_client) { |
| 1219 DCHECK(requester_info->IsRenderer()); | 1219 DCHECK(requester_info->IsRenderer()); |
| 1220 // Caller should ensure that |request_data| is associated with a transfer. | 1220 // Caller should ensure that |request_data| is associated with a transfer. |
| 1221 DCHECK(request_data.transferred_request_child_id != -1 || | 1221 DCHECK(request_data.transferred_request_child_id != -1 || |
| 1222 request_data.transferred_request_request_id != -1); | 1222 request_data.transferred_request_request_id != -1); |
| 1223 | 1223 |
| 1224 bool is_navigational_request = | 1224 if (!IsResourceTypeFrame(request_data.resource_type)) { |
| 1225 request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME || | |
| 1226 request_data.resource_type == RESOURCE_TYPE_SUB_FRAME; | |
| 1227 if (!is_navigational_request) { | |
| 1228 // Transfers apply only to navigational requests - the renderer seems to | 1225 // Transfers apply only to navigational requests - the renderer seems to |
| 1229 // have sent bogus IPC data. | 1226 // have sent bogus IPC data. |
| 1230 bad_message::ReceivedBadMessage( | 1227 bad_message::ReceivedBadMessage( |
| 1231 requester_info->filter(), | 1228 requester_info->filter(), |
| 1232 bad_message::RDH_TRANSFERRING_NONNAVIGATIONAL_REQUEST); | 1229 bad_message::RDH_TRANSFERRING_NONNAVIGATIONAL_REQUEST); |
| 1233 return; | 1230 return; |
| 1234 } | 1231 } |
| 1235 | 1232 |
| 1236 // Attempt to find a loader associated with the deferred transfer request. | 1233 // Attempt to find a loader associated with the deferred transfer request. |
| 1237 LoaderMap::iterator it = pending_loaders_.find( | 1234 LoaderMap::iterator it = pending_loaders_.find( |
| (...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2826 &throttles); | 2823 &throttles); |
| 2827 if (!throttles.empty()) { | 2824 if (!throttles.empty()) { |
| 2828 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, | 2825 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, |
| 2829 std::move(throttles))); | 2826 std::move(throttles))); |
| 2830 } | 2827 } |
| 2831 } | 2828 } |
| 2832 return handler; | 2829 return handler; |
| 2833 } | 2830 } |
| 2834 | 2831 |
| 2835 } // namespace content | 2832 } // namespace content |
| OLD | NEW |