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 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1171 IncrementOutstandingRequestsMemory(-1, *info); | 1171 IncrementOutstandingRequestsMemory(-1, *info); |
1172 bool should_update_count = info->counted_as_in_flight_request(); | 1172 bool should_update_count = info->counted_as_in_flight_request(); |
1173 if (should_update_count) | 1173 if (should_update_count) |
1174 IncrementOutstandingRequestsCount(-1, info); | 1174 IncrementOutstandingRequestsCount(-1, info); |
1175 pending_loaders_.erase(old_request_id); | 1175 pending_loaders_.erase(old_request_id); |
1176 | 1176 |
1177 // ResourceHandlers should always get state related to the request from the | 1177 // ResourceHandlers should always get state related to the request from the |
1178 // ResourceRequestInfo rather than caching it locally. This lets us update | 1178 // ResourceRequestInfo rather than caching it locally. This lets us update |
1179 // the info object when a transfer occurs. | 1179 // the info object when a transfer occurs. |
1180 info->UpdateForTransfer(child_id, route_id, request_data.origin_pid, | 1180 info->UpdateForTransfer(child_id, route_id, request_data.origin_pid, |
1181 request_id, request_data.parent_render_frame_id, | 1181 request_id, filter_->GetWeakPtr()); |
1182 filter_->GetWeakPtr()); | |
1183 | 1182 |
1184 // Update maps that used the old IDs, if necessary. Some transfers in tests | 1183 // Update maps that used the old IDs, if necessary. Some transfers in tests |
1185 // do not actually use a different ID, so not all maps need to be updated. | 1184 // do not actually use a different ID, so not all maps need to be updated. |
1186 pending_loaders_[new_request_id] = loader; | 1185 pending_loaders_[new_request_id] = loader; |
1187 IncrementOutstandingRequestsMemory(1, *info); | 1186 IncrementOutstandingRequestsMemory(1, *info); |
1188 if (should_update_count) | 1187 if (should_update_count) |
1189 IncrementOutstandingRequestsCount(1, info); | 1188 IncrementOutstandingRequestsCount(1, info); |
1190 if (old_routing_id != new_routing_id) { | 1189 if (old_routing_id != new_routing_id) { |
1191 if (blocked_loaders_map_.find(old_routing_id) != | 1190 if (blocked_loaders_map_.find(old_routing_id) != |
1192 blocked_loaders_map_.end()) { | 1191 blocked_loaders_map_.end()) { |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1403 | 1402 |
1404 // Make extra info and read footer (contains request ID). | 1403 // Make extra info and read footer (contains request ID). |
1405 ResourceRequestInfoImpl* extra_info = new ResourceRequestInfoImpl( | 1404 ResourceRequestInfoImpl* extra_info = new ResourceRequestInfoImpl( |
1406 process_type, child_id, route_id, | 1405 process_type, child_id, route_id, |
1407 -1, // frame_tree_node_id | 1406 -1, // frame_tree_node_id |
1408 request_data.origin_pid, | 1407 request_data.origin_pid, |
1409 request_id, | 1408 request_id, |
1410 request_data.render_frame_id, | 1409 request_data.render_frame_id, |
1411 request_data.is_main_frame, | 1410 request_data.is_main_frame, |
1412 request_data.parent_is_main_frame, | 1411 request_data.parent_is_main_frame, |
1413 request_data.parent_render_frame_id, | |
1414 request_data.resource_type, | 1412 request_data.resource_type, |
1415 request_data.transition_type, | 1413 request_data.transition_type, |
1416 request_data.should_replace_current_entry, | 1414 request_data.should_replace_current_entry, |
1417 false, // is download | 1415 false, // is download |
1418 false, // is stream | 1416 false, // is stream |
1419 allow_download, | 1417 allow_download, |
1420 request_data.has_user_gesture, | 1418 request_data.has_user_gesture, |
1421 request_data.enable_load_timing, | 1419 request_data.enable_load_timing, |
1422 request_data.enable_upload_progress, | 1420 request_data.enable_upload_progress, |
1423 do_not_prompt_for_login, | 1421 do_not_prompt_for_login, |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1700 return new ResourceRequestInfoImpl( | 1698 return new ResourceRequestInfoImpl( |
1701 PROCESS_TYPE_RENDERER, | 1699 PROCESS_TYPE_RENDERER, |
1702 child_id, | 1700 child_id, |
1703 render_view_route_id, | 1701 render_view_route_id, |
1704 -1, // frame_tree_node_id | 1702 -1, // frame_tree_node_id |
1705 0, | 1703 0, |
1706 request_id_, | 1704 request_id_, |
1707 render_frame_route_id, | 1705 render_frame_route_id, |
1708 false, // is_main_frame | 1706 false, // is_main_frame |
1709 false, // parent_is_main_frame | 1707 false, // parent_is_main_frame |
1710 -1, // parent_render_frame_id | |
1711 RESOURCE_TYPE_SUB_RESOURCE, | 1708 RESOURCE_TYPE_SUB_RESOURCE, |
1712 ui::PAGE_TRANSITION_LINK, | 1709 ui::PAGE_TRANSITION_LINK, |
1713 false, // should_replace_current_entry | 1710 false, // should_replace_current_entry |
1714 download, // is_download | 1711 download, // is_download |
1715 false, // is_stream | 1712 false, // is_stream |
1716 download, // allow_download | 1713 download, // allow_download |
1717 false, // has_user_gesture | 1714 false, // has_user_gesture |
1718 false, // enable_load_timing | 1715 false, // enable_load_timing |
1719 false, // enable_upload_progress | 1716 false, // enable_upload_progress |
1720 false, // do_not_prompt_for_login | 1717 false, // do_not_prompt_for_login |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2140 // that IO thread -> UI thread hops will work. | 2137 // that IO thread -> UI thread hops will work. |
2141 ResourceRequestInfoImpl* extra_info = new ResourceRequestInfoImpl( | 2138 ResourceRequestInfoImpl* extra_info = new ResourceRequestInfoImpl( |
2142 PROCESS_TYPE_BROWSER, | 2139 PROCESS_TYPE_BROWSER, |
2143 -1, // child_id | 2140 -1, // child_id |
2144 -1, // route_id | 2141 -1, // route_id |
2145 info.frame_tree_node_id, | 2142 info.frame_tree_node_id, |
2146 -1, // request_data.origin_pid, | 2143 -1, // request_data.origin_pid, |
2147 request_id_, | 2144 request_id_, |
2148 -1, // request_data.render_frame_id, | 2145 -1, // request_data.render_frame_id, |
2149 info.is_main_frame, info.parent_is_main_frame, | 2146 info.is_main_frame, info.parent_is_main_frame, |
2150 -1, // request_data.parent_render_frame_id, | |
2151 resource_type, info.common_params.transition, | 2147 resource_type, info.common_params.transition, |
2152 // should_replace_current_entry. This was only maintained at layer for | 2148 // should_replace_current_entry. This was only maintained at layer for |
2153 // request transfers and isn't needed for browser-side navigations. | 2149 // request transfers and isn't needed for browser-side navigations. |
2154 false, | 2150 false, |
2155 false, // is download | 2151 false, // is download |
2156 false, // is stream | 2152 false, // is stream |
2157 info.common_params.allow_download, info.begin_params.has_user_gesture, | 2153 info.common_params.allow_download, info.begin_params.has_user_gesture, |
2158 true, // enable_load_timing | 2154 true, // enable_load_timing |
2159 false, // enable_upload_progress | 2155 false, // enable_upload_progress |
2160 false, // do_not_prompt_for_login | 2156 false, // do_not_prompt_for_login |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2531 load_flags |= net::LOAD_PREFETCH; | 2527 load_flags |= net::LOAD_PREFETCH; |
2532 } | 2528 } |
2533 | 2529 |
2534 if (is_sync_load) | 2530 if (is_sync_load) |
2535 load_flags |= net::LOAD_IGNORE_LIMITS; | 2531 load_flags |= net::LOAD_IGNORE_LIMITS; |
2536 | 2532 |
2537 return load_flags; | 2533 return load_flags; |
2538 } | 2534 } |
2539 | 2535 |
2540 } // namespace content | 2536 } // namespace content |
OLD | NEW |