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 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 IncrementOutstandingRequestsMemory(-1, *info); | 1108 IncrementOutstandingRequestsMemory(-1, *info); |
1109 bool should_update_count = info->counted_as_in_flight_request(); | 1109 bool should_update_count = info->counted_as_in_flight_request(); |
1110 if (should_update_count) | 1110 if (should_update_count) |
1111 IncrementOutstandingRequestsCount(-1, info); | 1111 IncrementOutstandingRequestsCount(-1, info); |
1112 pending_loaders_.erase(old_request_id); | 1112 pending_loaders_.erase(old_request_id); |
1113 | 1113 |
1114 // ResourceHandlers should always get state related to the request from the | 1114 // ResourceHandlers should always get state related to the request from the |
1115 // ResourceRequestInfo rather than caching it locally. This lets us update | 1115 // ResourceRequestInfo rather than caching it locally. This lets us update |
1116 // the info object when a transfer occurs. | 1116 // the info object when a transfer occurs. |
1117 info->UpdateForTransfer(child_id, route_id, request_data.origin_pid, | 1117 info->UpdateForTransfer(child_id, route_id, request_data.origin_pid, |
1118 request_id, request_data.parent_render_frame_id, | 1118 request_id, filter_->GetWeakPtr()); |
1119 filter_->GetWeakPtr()); | |
1120 | 1119 |
1121 // Update maps that used the old IDs, if necessary. Some transfers in tests | 1120 // Update maps that used the old IDs, if necessary. Some transfers in tests |
1122 // do not actually use a different ID, so not all maps need to be updated. | 1121 // do not actually use a different ID, so not all maps need to be updated. |
1123 pending_loaders_[new_request_id] = loader; | 1122 pending_loaders_[new_request_id] = loader; |
1124 IncrementOutstandingRequestsMemory(1, *info); | 1123 IncrementOutstandingRequestsMemory(1, *info); |
1125 if (should_update_count) | 1124 if (should_update_count) |
1126 IncrementOutstandingRequestsCount(1, info); | 1125 IncrementOutstandingRequestsCount(1, info); |
1127 if (old_routing_id != new_routing_id) { | 1126 if (old_routing_id != new_routing_id) { |
1128 if (blocked_loaders_map_.find(old_routing_id) != | 1127 if (blocked_loaders_map_.find(old_routing_id) != |
1129 blocked_loaders_map_.end()) { | 1128 blocked_loaders_map_.end()) { |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1334 | 1333 |
1335 // Make extra info and read footer (contains request ID). | 1334 // Make extra info and read footer (contains request ID). |
1336 ResourceRequestInfoImpl* extra_info = new ResourceRequestInfoImpl( | 1335 ResourceRequestInfoImpl* extra_info = new ResourceRequestInfoImpl( |
1337 process_type, child_id, route_id, | 1336 process_type, child_id, route_id, |
1338 -1, // frame_tree_node_id | 1337 -1, // frame_tree_node_id |
1339 request_data.origin_pid, | 1338 request_data.origin_pid, |
1340 request_id, | 1339 request_id, |
1341 request_data.render_frame_id, | 1340 request_data.render_frame_id, |
1342 request_data.is_main_frame, | 1341 request_data.is_main_frame, |
1343 request_data.parent_is_main_frame, | 1342 request_data.parent_is_main_frame, |
1344 request_data.parent_render_frame_id, | |
1345 request_data.resource_type, | 1343 request_data.resource_type, |
1346 request_data.transition_type, | 1344 request_data.transition_type, |
1347 request_data.should_replace_current_entry, | 1345 request_data.should_replace_current_entry, |
1348 false, // is download | 1346 false, // is download |
1349 false, // is stream | 1347 false, // is stream |
1350 allow_download, | 1348 allow_download, |
1351 request_data.has_user_gesture, | 1349 request_data.has_user_gesture, |
1352 request_data.enable_load_timing, | 1350 request_data.enable_load_timing, |
1353 request_data.enable_upload_progress, | 1351 request_data.enable_upload_progress, |
1354 do_not_prompt_for_login, | 1352 do_not_prompt_for_login, |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1621 return new ResourceRequestInfoImpl( | 1619 return new ResourceRequestInfoImpl( |
1622 PROCESS_TYPE_RENDERER, | 1620 PROCESS_TYPE_RENDERER, |
1623 child_id, | 1621 child_id, |
1624 render_view_route_id, | 1622 render_view_route_id, |
1625 -1, // frame_tree_node_id | 1623 -1, // frame_tree_node_id |
1626 0, | 1624 0, |
1627 request_id_, | 1625 request_id_, |
1628 render_frame_route_id, | 1626 render_frame_route_id, |
1629 false, // is_main_frame | 1627 false, // is_main_frame |
1630 false, // parent_is_main_frame | 1628 false, // parent_is_main_frame |
1631 -1, // parent_render_frame_id | |
1632 RESOURCE_TYPE_SUB_RESOURCE, | 1629 RESOURCE_TYPE_SUB_RESOURCE, |
1633 ui::PAGE_TRANSITION_LINK, | 1630 ui::PAGE_TRANSITION_LINK, |
1634 false, // should_replace_current_entry | 1631 false, // should_replace_current_entry |
1635 download, // is_download | 1632 download, // is_download |
1636 false, // is_stream | 1633 false, // is_stream |
1637 download, // allow_download | 1634 download, // allow_download |
1638 false, // has_user_gesture | 1635 false, // has_user_gesture |
1639 false, // enable_load_timing | 1636 false, // enable_load_timing |
1640 false, // enable_upload_progress | 1637 false, // enable_upload_progress |
1641 false, // do_not_prompt_for_login | 1638 false, // do_not_prompt_for_login |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2060 // that IO thread -> UI thread hops will work. | 2057 // that IO thread -> UI thread hops will work. |
2061 ResourceRequestInfoImpl* extra_info = new ResourceRequestInfoImpl( | 2058 ResourceRequestInfoImpl* extra_info = new ResourceRequestInfoImpl( |
2062 PROCESS_TYPE_BROWSER, | 2059 PROCESS_TYPE_BROWSER, |
2063 -1, // child_id | 2060 -1, // child_id |
2064 -1, // route_id | 2061 -1, // route_id |
2065 info.frame_tree_node_id, | 2062 info.frame_tree_node_id, |
2066 -1, // request_data.origin_pid, | 2063 -1, // request_data.origin_pid, |
2067 request_id_, | 2064 request_id_, |
2068 -1, // request_data.render_frame_id, | 2065 -1, // request_data.render_frame_id, |
2069 info.is_main_frame, info.parent_is_main_frame, | 2066 info.is_main_frame, info.parent_is_main_frame, |
2070 -1, // request_data.parent_render_frame_id, | |
2071 resource_type, info.common_params.transition, | 2067 resource_type, info.common_params.transition, |
2072 // should_replace_current_entry. This was only maintained at layer for | 2068 // should_replace_current_entry. This was only maintained at layer for |
2073 // request transfers and isn't needed for browser-side navigations. | 2069 // request transfers and isn't needed for browser-side navigations. |
2074 false, | 2070 false, |
2075 false, // is download | 2071 false, // is download |
2076 false, // is stream | 2072 false, // is stream |
2077 info.common_params.allow_download, info.begin_params.has_user_gesture, | 2073 info.common_params.allow_download, info.begin_params.has_user_gesture, |
2078 true, // enable_load_timing | 2074 true, // enable_load_timing |
2079 false, // enable_upload_progress | 2075 false, // enable_upload_progress |
2080 false, // do_not_prompt_for_login | 2076 false, // do_not_prompt_for_login |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2440 load_flags |= net::LOAD_PREFETCH; | 2436 load_flags |= net::LOAD_PREFETCH; |
2441 } | 2437 } |
2442 | 2438 |
2443 if (is_sync_load) | 2439 if (is_sync_load) |
2444 load_flags |= net::LOAD_IGNORE_LIMITS; | 2440 load_flags |= net::LOAD_IGNORE_LIMITS; |
2445 | 2441 |
2446 return load_flags; | 2442 return load_flags; |
2447 } | 2443 } |
2448 | 2444 |
2449 } // namespace content | 2445 } // namespace content |
OLD | NEW |