| 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 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 IncrementOutstandingRequestsMemory(-1, *info); | 910 IncrementOutstandingRequestsMemory(-1, *info); |
| 911 OustandingRequestsStats empty_stats = { 0, 0 }; | 911 OustandingRequestsStats empty_stats = { 0, 0 }; |
| 912 OustandingRequestsStats old_stats = GetOutstandingRequestsStats(*info); | 912 OustandingRequestsStats old_stats = GetOutstandingRequestsStats(*info); |
| 913 UpdateOutstandingRequestsStats(*info, empty_stats); | 913 UpdateOutstandingRequestsStats(*info, empty_stats); |
| 914 pending_loaders_.erase(old_request_id); | 914 pending_loaders_.erase(old_request_id); |
| 915 | 915 |
| 916 // ResourceHandlers should always get state related to the request from the | 916 // ResourceHandlers should always get state related to the request from the |
| 917 // ResourceRequestInfo rather than caching it locally. This lets us update | 917 // ResourceRequestInfo rather than caching it locally. This lets us update |
| 918 // the info object when a transfer occurs. | 918 // the info object when a transfer occurs. |
| 919 info->UpdateForTransfer(child_id, route_id, request_data.origin_pid, | 919 info->UpdateForTransfer(child_id, route_id, request_data.origin_pid, |
| 920 request_id, request_data.frame_id, | 920 request_id, request_data.parent_render_frame_id, |
| 921 request_data.parent_frame_id, filter_->GetWeakPtr()); | 921 filter_->GetWeakPtr()); |
| 922 | 922 |
| 923 // Update maps that used the old IDs, if necessary. Some transfers in tests | 923 // Update maps that used the old IDs, if necessary. Some transfers in tests |
| 924 // do not actually use a different ID, so not all maps need to be updated. | 924 // do not actually use a different ID, so not all maps need to be updated. |
| 925 pending_loaders_[new_request_id] = loader; | 925 pending_loaders_[new_request_id] = loader; |
| 926 UpdateOutstandingRequestsStats(*info, old_stats); | 926 UpdateOutstandingRequestsStats(*info, old_stats); |
| 927 IncrementOutstandingRequestsMemory(1, *info); | 927 IncrementOutstandingRequestsMemory(1, *info); |
| 928 if (old_routing_id != new_routing_id) { | 928 if (old_routing_id != new_routing_id) { |
| 929 if (offline_policy_map_.find(old_routing_id) != offline_policy_map_.end()) { | 929 if (offline_policy_map_.find(old_routing_id) != offline_policy_map_.end()) { |
| 930 if (offline_policy_map_.find(new_routing_id) != | 930 if (offline_policy_map_.find(new_routing_id) != |
| 931 offline_policy_map_.end()) | 931 offline_policy_map_.end()) |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 // Make extra info and read footer (contains request ID). | 1089 // Make extra info and read footer (contains request ID). |
| 1090 ResourceRequestInfoImpl* extra_info = | 1090 ResourceRequestInfoImpl* extra_info = |
| 1091 new ResourceRequestInfoImpl( | 1091 new ResourceRequestInfoImpl( |
| 1092 process_type, | 1092 process_type, |
| 1093 child_id, | 1093 child_id, |
| 1094 route_id, | 1094 route_id, |
| 1095 request_data.origin_pid, | 1095 request_data.origin_pid, |
| 1096 request_id, | 1096 request_id, |
| 1097 request_data.render_frame_id, | 1097 request_data.render_frame_id, |
| 1098 request_data.is_main_frame, | 1098 request_data.is_main_frame, |
| 1099 request_data.frame_id, | |
| 1100 request_data.parent_is_main_frame, | 1099 request_data.parent_is_main_frame, |
| 1101 request_data.parent_frame_id, | 1100 request_data.parent_render_frame_id, |
| 1102 request_data.resource_type, | 1101 request_data.resource_type, |
| 1103 request_data.transition_type, | 1102 request_data.transition_type, |
| 1104 request_data.should_replace_current_entry, | 1103 request_data.should_replace_current_entry, |
| 1105 false, // is download | 1104 false, // is download |
| 1106 false, // is stream | 1105 false, // is stream |
| 1107 allow_download, | 1106 allow_download, |
| 1108 request_data.has_user_gesture, | 1107 request_data.has_user_gesture, |
| 1109 request_data.referrer_policy, | 1108 request_data.referrer_policy, |
| 1110 request_data.visiblity_state, | 1109 request_data.visiblity_state, |
| 1111 resource_context, | 1110 resource_context, |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1287 bool download, | 1286 bool download, |
| 1288 ResourceContext* context) { | 1287 ResourceContext* context) { |
| 1289 return new ResourceRequestInfoImpl( | 1288 return new ResourceRequestInfoImpl( |
| 1290 PROCESS_TYPE_RENDERER, | 1289 PROCESS_TYPE_RENDERER, |
| 1291 child_id, | 1290 child_id, |
| 1292 route_id, | 1291 route_id, |
| 1293 0, | 1292 0, |
| 1294 request_id_, | 1293 request_id_, |
| 1295 MSG_ROUTING_NONE, // render_frame_id | 1294 MSG_ROUTING_NONE, // render_frame_id |
| 1296 false, // is_main_frame | 1295 false, // is_main_frame |
| 1297 -1, // frame_id | |
| 1298 false, // parent_is_main_frame | 1296 false, // parent_is_main_frame |
| 1299 -1, // parent_frame_id | 1297 -1, // parent_render_frame_id |
| 1300 ResourceType::SUB_RESOURCE, | 1298 ResourceType::SUB_RESOURCE, |
| 1301 PAGE_TRANSITION_LINK, | 1299 PAGE_TRANSITION_LINK, |
| 1302 false, // should_replace_current_entry | 1300 false, // should_replace_current_entry |
| 1303 download, // is_download | 1301 download, // is_download |
| 1304 false, // is_stream | 1302 false, // is_stream |
| 1305 download, // allow_download | 1303 download, // allow_download |
| 1306 false, // has_user_gesture | 1304 false, // has_user_gesture |
| 1307 blink::WebReferrerPolicyDefault, | 1305 blink::WebReferrerPolicyDefault, |
| 1308 blink::WebPageVisibilityStateVisible, | 1306 blink::WebPageVisibilityStateVisible, |
| 1309 context, | 1307 context, |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1996 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) | 1994 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) |
| 1997 && !policy->CanReadRawCookies(child_id)) { | 1995 && !policy->CanReadRawCookies(child_id)) { |
| 1998 VLOG(1) << "Denied unauthorized request for raw headers"; | 1996 VLOG(1) << "Denied unauthorized request for raw headers"; |
| 1999 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; | 1997 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; |
| 2000 } | 1998 } |
| 2001 | 1999 |
| 2002 return load_flags; | 2000 return load_flags; |
| 2003 } | 2001 } |
| 2004 | 2002 |
| 2005 } // namespace content | 2003 } // namespace content |
| OLD | NEW |