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

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

Issue 1271733002: [2/3 chromium] Support redirect option of Request and "opaqueredirect" response type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on 1272623002 Created 5 years, 4 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
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 <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 -1, // frame_tree_node_id 1274 -1, // frame_tree_node_id
1275 request_data.origin_pid, 1275 request_data.origin_pid,
1276 request_id, 1276 request_id,
1277 request_data.render_frame_id, 1277 request_data.render_frame_id,
1278 request_data.is_main_frame, 1278 request_data.is_main_frame,
1279 request_data.parent_is_main_frame, 1279 request_data.parent_is_main_frame,
1280 request_data.parent_render_frame_id, 1280 request_data.parent_render_frame_id,
1281 request_data.resource_type, 1281 request_data.resource_type,
1282 request_data.transition_type, 1282 request_data.transition_type,
1283 request_data.should_replace_current_entry, 1283 request_data.should_replace_current_entry,
1284 request_data.fetch_redirect_mode,
1284 false, // is download 1285 false, // is download
1285 false, // is stream 1286 false, // is stream
1286 allow_download, 1287 allow_download,
1287 request_data.has_user_gesture, 1288 request_data.has_user_gesture,
1288 request_data.enable_load_timing, 1289 request_data.enable_load_timing,
1289 request_data.enable_upload_progress, 1290 request_data.enable_upload_progress,
1290 do_not_prompt_for_login, 1291 do_not_prompt_for_login,
1291 request_data.referrer_policy, 1292 request_data.referrer_policy,
1292 request_data.visiblity_state, 1293 request_data.visiblity_state,
1293 resource_context, filter_->GetWeakPtr(), 1294 resource_context, filter_->GetWeakPtr(),
1294 !is_sync_load); 1295 !is_sync_load);
1295 // Request takes ownership. 1296 // Request takes ownership.
1296 extra_info->AssociateWithRequest(new_request.get()); 1297 extra_info->AssociateWithRequest(new_request.get());
1297 1298
1298 if (new_request->url().SchemeIs(url::kBlobScheme)) { 1299 if (new_request->url().SchemeIs(url::kBlobScheme)) {
1299 // Hang on to a reference to ensure the blob is not released prior 1300 // Hang on to a reference to ensure the blob is not released prior
1300 // to the job being started. 1301 // to the job being started.
1301 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( 1302 storage::BlobProtocolHandler::SetRequestedBlobDataHandle(
1302 new_request.get(), 1303 new_request.get(),
1303 filter_->blob_storage_context()->context()->GetBlobDataFromPublicURL( 1304 filter_->blob_storage_context()->context()->GetBlobDataFromPublicURL(
1304 new_request->url())); 1305 new_request->url()));
1305 } 1306 }
1306 1307
1307 // Initialize the service worker handler for the request. We don't use 1308 // Initialize the service worker handler for the request. We don't use
1308 // ServiceWorker for synchronous loads to avoid renderer deadlocks. 1309 // ServiceWorker for synchronous loads to avoid renderer deadlocks.
1309 ServiceWorkerRequestHandler::InitializeHandler( 1310 ServiceWorkerRequestHandler::InitializeHandler(
1310 new_request.get(), 1311 new_request.get(), filter_->service_worker_context(), blob_context,
1311 filter_->service_worker_context(), 1312 child_id, request_data.service_worker_provider_id,
1312 blob_context,
1313 child_id,
1314 request_data.service_worker_provider_id,
1315 request_data.skip_service_worker || is_sync_load, 1313 request_data.skip_service_worker || is_sync_load,
1316 request_data.fetch_request_mode, 1314 request_data.fetch_request_mode, request_data.fetch_credentials_mode,
1317 request_data.fetch_credentials_mode, 1315 request_data.fetch_redirect_mode, request_data.resource_type,
1318 request_data.resource_type, 1316 request_data.fetch_request_context_type, request_data.fetch_frame_type,
1319 request_data.fetch_request_context_type,
1320 request_data.fetch_frame_type,
1321 request_data.request_body); 1317 request_data.request_body);
1322 1318
1323 // Have the appcache associate its extra info with the request. 1319 // Have the appcache associate its extra info with the request.
1324 AppCacheInterceptor::SetExtraRequestInfo( 1320 AppCacheInterceptor::SetExtraRequestInfo(
1325 new_request.get(), filter_->appcache_service(), child_id, 1321 new_request.get(), filter_->appcache_service(), child_id,
1326 request_data.appcache_host_id, request_data.resource_type, 1322 request_data.appcache_host_id, request_data.resource_type,
1327 request_data.should_reset_appcache); 1323 request_data.should_reset_appcache);
1328 1324
1329 scoped_ptr<ResourceHandler> handler( 1325 scoped_ptr<ResourceHandler> handler(
1330 CreateResourceHandler( 1326 CreateResourceHandler(
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 -1, // frame_tree_node_id 1529 -1, // frame_tree_node_id
1534 0, 1530 0,
1535 request_id_, 1531 request_id_,
1536 MSG_ROUTING_NONE, // render_frame_id 1532 MSG_ROUTING_NONE, // render_frame_id
1537 false, // is_main_frame 1533 false, // is_main_frame
1538 false, // parent_is_main_frame 1534 false, // parent_is_main_frame
1539 -1, // parent_render_frame_id 1535 -1, // parent_render_frame_id
1540 RESOURCE_TYPE_SUB_RESOURCE, 1536 RESOURCE_TYPE_SUB_RESOURCE,
1541 ui::PAGE_TRANSITION_LINK, 1537 ui::PAGE_TRANSITION_LINK,
1542 false, // should_replace_current_entry 1538 false, // should_replace_current_entry
1539 FETCH_REDIRECT_MODE_FOLLOW,
1543 download, // is_download 1540 download, // is_download
1544 false, // is_stream 1541 false, // is_stream
1545 download, // allow_download 1542 download, // allow_download
1546 false, // has_user_gesture 1543 false, // has_user_gesture
1547 false, // enable_load_timing 1544 false, // enable_load_timing
1548 false, // enable_upload_progress 1545 false, // enable_upload_progress
1549 false, // do_not_prompt_for_login 1546 false, // do_not_prompt_for_login
1550 blink::WebReferrerPolicyDefault, 1547 blink::WebReferrerPolicyDefault,
1551 blink::WebPageVisibilityStateVisible, 1548 blink::WebPageVisibilityStateVisible,
1552 context, 1549 context,
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1973 request_id_, 1970 request_id_,
1974 -1, // request_data.render_frame_id, 1971 -1, // request_data.render_frame_id,
1975 info.is_main_frame, 1972 info.is_main_frame,
1976 info.parent_is_main_frame, 1973 info.parent_is_main_frame,
1977 -1, // request_data.parent_render_frame_id, 1974 -1, // request_data.parent_render_frame_id,
1978 resource_type, 1975 resource_type,
1979 info.common_params.transition, 1976 info.common_params.transition,
1980 // should_replace_current_entry. This was only maintained at layer for 1977 // should_replace_current_entry. This was only maintained at layer for
1981 // request transfers and isn't needed for browser-side navigations. 1978 // request transfers and isn't needed for browser-side navigations.
1982 false, 1979 false,
1980 FETCH_REDIRECT_MODE_FOLLOW,
1983 false, // is download 1981 false, // is download
1984 false, // is stream 1982 false, // is stream
1985 info.common_params.allow_download, 1983 info.common_params.allow_download,
1986 info.begin_params.has_user_gesture, 1984 info.begin_params.has_user_gesture,
1987 true, // enable_load_timing 1985 true, // enable_load_timing
1988 false, // enable_upload_progress 1986 false, // enable_upload_progress
1989 false, // do_not_prompt_for_login 1987 false, // do_not_prompt_for_login
1990 info.common_params.referrer.policy, 1988 info.common_params.referrer.policy,
1991 // TODO(davidben): This is only used for prerenders. Replace 1989 // TODO(davidben): This is only used for prerenders. Replace
1992 // is_showing with something for that. Or maybe it just comes from the 1990 // is_showing with something for that. Or maybe it just comes from the
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
2354 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) 2352 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS)
2355 && !policy->CanReadRawCookies(child_id)) { 2353 && !policy->CanReadRawCookies(child_id)) {
2356 VLOG(1) << "Denied unauthorized request for raw headers"; 2354 VLOG(1) << "Denied unauthorized request for raw headers";
2357 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; 2355 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS;
2358 } 2356 }
2359 2357
2360 return load_flags; 2358 return load_flags;
2361 } 2359 }
2362 2360
2363 } // namespace content 2361 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698