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 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 IncrementOutstandingRequestsMemory(-1, *info); | 1099 IncrementOutstandingRequestsMemory(-1, *info); |
1100 bool should_update_count = info->counted_as_in_flight_request(); | 1100 bool should_update_count = info->counted_as_in_flight_request(); |
1101 if (should_update_count) | 1101 if (should_update_count) |
1102 IncrementOutstandingRequestsCount(-1, info); | 1102 IncrementOutstandingRequestsCount(-1, info); |
1103 pending_loaders_.erase(old_request_id); | 1103 pending_loaders_.erase(old_request_id); |
1104 | 1104 |
1105 // ResourceHandlers should always get state related to the request from the | 1105 // ResourceHandlers should always get state related to the request from the |
1106 // ResourceRequestInfo rather than caching it locally. This lets us update | 1106 // ResourceRequestInfo rather than caching it locally. This lets us update |
1107 // the info object when a transfer occurs. | 1107 // the info object when a transfer occurs. |
1108 info->UpdateForTransfer(child_id, route_id, request_data.origin_pid, | 1108 info->UpdateForTransfer(child_id, route_id, request_data.origin_pid, |
1109 request_id, request_data.parent_render_frame_id, | 1109 request_id, filter_->GetWeakPtr()); |
1110 filter_->GetWeakPtr()); | |
1111 | 1110 |
1112 // Update maps that used the old IDs, if necessary. Some transfers in tests | 1111 // Update maps that used the old IDs, if necessary. Some transfers in tests |
1113 // do not actually use a different ID, so not all maps need to be updated. | 1112 // do not actually use a different ID, so not all maps need to be updated. |
1114 pending_loaders_[new_request_id] = loader; | 1113 pending_loaders_[new_request_id] = loader; |
1115 IncrementOutstandingRequestsMemory(1, *info); | 1114 IncrementOutstandingRequestsMemory(1, *info); |
1116 if (should_update_count) | 1115 if (should_update_count) |
1117 IncrementOutstandingRequestsCount(1, info); | 1116 IncrementOutstandingRequestsCount(1, info); |
1118 if (old_routing_id != new_routing_id) { | 1117 if (old_routing_id != new_routing_id) { |
1119 if (blocked_loaders_map_.find(old_routing_id) != | 1118 if (blocked_loaders_map_.find(old_routing_id) != |
1120 blocked_loaders_map_.end()) { | 1119 blocked_loaders_map_.end()) { |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1324 | 1323 |
1325 // Make extra info and read footer (contains request ID). | 1324 // Make extra info and read footer (contains request ID). |
1326 ResourceRequestInfoImpl* extra_info = new ResourceRequestInfoImpl( | 1325 ResourceRequestInfoImpl* extra_info = new ResourceRequestInfoImpl( |
1327 process_type, child_id, route_id, | 1326 process_type, child_id, route_id, |
1328 -1, // frame_tree_node_id | 1327 -1, // frame_tree_node_id |
1329 request_data.origin_pid, | 1328 request_data.origin_pid, |
1330 request_id, | 1329 request_id, |
1331 request_data.render_frame_id, | 1330 request_data.render_frame_id, |
1332 request_data.is_main_frame, | 1331 request_data.is_main_frame, |
1333 request_data.parent_is_main_frame, | 1332 request_data.parent_is_main_frame, |
1334 request_data.parent_render_frame_id, | |
1335 request_data.resource_type, | 1333 request_data.resource_type, |
1336 request_data.transition_type, | 1334 request_data.transition_type, |
1337 request_data.should_replace_current_entry, | 1335 request_data.should_replace_current_entry, |
1338 false, // is download | 1336 false, // is download |
1339 false, // is stream | 1337 false, // is stream |
1340 allow_download, | 1338 allow_download, |
1341 request_data.has_user_gesture, | 1339 request_data.has_user_gesture, |
1342 request_data.enable_load_timing, | 1340 request_data.enable_load_timing, |
1343 request_data.enable_upload_progress, | 1341 request_data.enable_upload_progress, |
1344 do_not_prompt_for_login, | 1342 do_not_prompt_for_login, |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1609 return new ResourceRequestInfoImpl( | 1607 return new ResourceRequestInfoImpl( |
1610 PROCESS_TYPE_RENDERER, | 1608 PROCESS_TYPE_RENDERER, |
1611 child_id, | 1609 child_id, |
1612 render_view_route_id, | 1610 render_view_route_id, |
1613 -1, // frame_tree_node_id | 1611 -1, // frame_tree_node_id |
1614 0, | 1612 0, |
1615 request_id_, | 1613 request_id_, |
1616 render_frame_route_id, | 1614 render_frame_route_id, |
1617 false, // is_main_frame | 1615 false, // is_main_frame |
1618 false, // parent_is_main_frame | 1616 false, // parent_is_main_frame |
1619 -1, // parent_render_frame_id | |
1620 RESOURCE_TYPE_SUB_RESOURCE, | 1617 RESOURCE_TYPE_SUB_RESOURCE, |
1621 ui::PAGE_TRANSITION_LINK, | 1618 ui::PAGE_TRANSITION_LINK, |
1622 false, // should_replace_current_entry | 1619 false, // should_replace_current_entry |
1623 download, // is_download | 1620 download, // is_download |
1624 false, // is_stream | 1621 false, // is_stream |
1625 download, // allow_download | 1622 download, // allow_download |
1626 false, // has_user_gesture | 1623 false, // has_user_gesture |
1627 false, // enable_load_timing | 1624 false, // enable_load_timing |
1628 false, // enable_upload_progress | 1625 false, // enable_upload_progress |
1629 false, // do_not_prompt_for_login | 1626 false, // do_not_prompt_for_login |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2049 ResourceRequestInfoImpl* extra_info = new ResourceRequestInfoImpl( | 2046 ResourceRequestInfoImpl* extra_info = new ResourceRequestInfoImpl( |
2050 PROCESS_TYPE_BROWSER, | 2047 PROCESS_TYPE_BROWSER, |
2051 -1, // child_id | 2048 -1, // child_id |
2052 -1, // route_id | 2049 -1, // route_id |
2053 info.frame_tree_node_id, | 2050 info.frame_tree_node_id, |
2054 -1, // request_data.origin_pid, | 2051 -1, // request_data.origin_pid, |
2055 request_id_, | 2052 request_id_, |
2056 -1, // request_data.render_frame_id, | 2053 -1, // request_data.render_frame_id, |
2057 info.is_main_frame, | 2054 info.is_main_frame, |
2058 info.parent_is_main_frame, | 2055 info.parent_is_main_frame, |
2059 -1, // request_data.parent_render_frame_id, | |
2060 resource_type, | 2056 resource_type, |
2061 info.common_params.transition, | 2057 info.common_params.transition, |
2062 // should_replace_current_entry. This was only maintained at layer for | 2058 // should_replace_current_entry. This was only maintained at layer for |
2063 // request transfers and isn't needed for browser-side navigations. | 2059 // request transfers and isn't needed for browser-side navigations. |
2064 false, | 2060 false, |
2065 false, // is download | 2061 false, // is download |
2066 false, // is stream | 2062 false, // is stream |
2067 info.common_params.allow_download, | 2063 info.common_params.allow_download, |
2068 info.begin_params.has_user_gesture, | 2064 info.begin_params.has_user_gesture, |
2069 true, // enable_load_timing | 2065 true, // enable_load_timing |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2426 load_flags |= net::LOAD_PREFETCH; | 2422 load_flags |= net::LOAD_PREFETCH; |
2427 } | 2423 } |
2428 | 2424 |
2429 if (is_sync_load) | 2425 if (is_sync_load) |
2430 load_flags |= net::LOAD_IGNORE_LIMITS; | 2426 load_flags |= net::LOAD_IGNORE_LIMITS; |
2431 | 2427 |
2432 return load_flags; | 2428 return load_flags; |
2433 } | 2429 } |
2434 | 2430 |
2435 } // namespace content | 2431 } // namespace content |
OLD | NEW |