Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 141163002: Make PrerenderTracker's resource_throttle_io_thread_map_ use RenderFrame IDs instead of RenderView … (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: simplify code Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 ResourceMessageDelegate* delegate; 931 ResourceMessageDelegate* delegate;
932 while ((delegate = del_it.GetNext()) != NULL) { 932 while ((delegate = del_it.GetNext()) != NULL) {
933 delegate->set_request_id(new_request_id); 933 delegate->set_request_id(new_request_id);
934 } 934 }
935 // Now store the observer list under the new request ID. 935 // Now store the observer list under the new request ID.
936 delegate_map_[new_request_id] = delegate_map_[old_request_id]; 936 delegate_map_[new_request_id] = delegate_map_[old_request_id];
937 delegate_map_.erase(old_request_id); 937 delegate_map_.erase(old_request_id);
938 } 938 }
939 } 939 }
940 940
941 // Notify the delegate to allow it to update state as well.
942 if (delegate_) {
943 delegate_->WillTransferRequestToNewProcess(old_routing_id.child_id,
944 old_routing_id.route_id,
945 old_request_id.request_id,
946 child_id,
947 route_id,
948 request_id);
949 }
950
951 // We should have a CrossSiteResourceHandler to finish the transfer. 941 // We should have a CrossSiteResourceHandler to finish the transfer.
952 DCHECK(info->cross_site_handler()); 942 DCHECK(info->cross_site_handler());
953 } 943 }
954 944
955 void ResourceDispatcherHostImpl::BeginRequest( 945 void ResourceDispatcherHostImpl::BeginRequest(
956 int request_id, 946 int request_id,
957 const ResourceHostMsg_Request& request_data, 947 const ResourceHostMsg_Request& request_data,
958 IPC::Message* sync_result, // only valid for sync 948 IPC::Message* sync_result, // only valid for sync
959 int route_id) { 949 int route_id) {
960 int process_type = filter_->process_type(); 950 int process_type = filter_->process_type();
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 request_data.parent_is_main_frame, 1080 request_data.parent_is_main_frame,
1091 request_data.parent_frame_id, 1081 request_data.parent_frame_id,
1092 request_data.resource_type, 1082 request_data.resource_type,
1093 request_data.transition_type, 1083 request_data.transition_type,
1094 request_data.should_replace_current_entry, 1084 request_data.should_replace_current_entry,
1095 false, // is download 1085 false, // is download
1096 false, // is stream 1086 false, // is stream
1097 allow_download, 1087 allow_download,
1098 request_data.has_user_gesture, 1088 request_data.has_user_gesture,
1099 request_data.referrer_policy, 1089 request_data.referrer_policy,
1090 request_data.visiblity_state,
1100 resource_context, 1091 resource_context,
1101 filter_->GetWeakPtr(), 1092 filter_->GetWeakPtr(),
1102 !is_sync_load); 1093 !is_sync_load);
1103 extra_info->AssociateWithRequest(request); // Request takes ownership. 1094 extra_info->AssociateWithRequest(request); // Request takes ownership.
1104 1095
1105 if (request->url().SchemeIs(chrome::kBlobScheme)) { 1096 if (request->url().SchemeIs(chrome::kBlobScheme)) {
1106 // Hang on to a reference to ensure the blob is not released prior 1097 // Hang on to a reference to ensure the blob is not released prior
1107 // to the job being started. 1098 // to the job being started.
1108 webkit_blob::BlobProtocolHandler::SetRequestedBlobDataHandle( 1099 webkit_blob::BlobProtocolHandler::SetRequestedBlobDataHandle(
1109 request, 1100 request,
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 false, // parent_is_main_frame 1277 false, // parent_is_main_frame
1287 -1, // parent_frame_id 1278 -1, // parent_frame_id
1288 ResourceType::SUB_RESOURCE, 1279 ResourceType::SUB_RESOURCE,
1289 PAGE_TRANSITION_LINK, 1280 PAGE_TRANSITION_LINK,
1290 false, // should_replace_current_entry 1281 false, // should_replace_current_entry
1291 download, // is_download 1282 download, // is_download
1292 false, // is_stream 1283 false, // is_stream
1293 download, // allow_download 1284 download, // allow_download
1294 false, // has_user_gesture 1285 false, // has_user_gesture
1295 blink::WebReferrerPolicyDefault, 1286 blink::WebReferrerPolicyDefault,
1287 blink::WebPageVisibilityStateVisible,
1296 context, 1288 context,
1297 base::WeakPtr<ResourceMessageFilter>(), // filter 1289 base::WeakPtr<ResourceMessageFilter>(), // filter
1298 true); // is_async 1290 true); // is_async
1299 } 1291 }
1300 1292
1301 void ResourceDispatcherHostImpl::OnRenderViewHostCreated( 1293 void ResourceDispatcherHostImpl::OnRenderViewHostCreated(
1302 int child_id, 1294 int child_id,
1303 int route_id) { 1295 int route_id) {
1304 scheduler_->OnClientCreated(child_id, route_id); 1296 scheduler_->OnClientCreated(child_id, route_id);
1305 } 1297 }
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
1976 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) 1968 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS)
1977 && !policy->CanReadRawCookies(child_id)) { 1969 && !policy->CanReadRawCookies(child_id)) {
1978 VLOG(1) << "Denied unauthorized request for raw headers"; 1970 VLOG(1) << "Denied unauthorized request for raw headers";
1979 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; 1971 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS;
1980 } 1972 }
1981 1973
1982 return load_flags; 1974 return load_flags;
1983 } 1975 }
1984 1976
1985 } // namespace content 1977 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698