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

Side by Side Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 2423233002: Preserving extra http request headers in OpenURL navigation path [relanding]. (Closed)
Patch Set: This patchset is copied from https://crrev.com/2355023002 Created 4 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "content/browser/frame_host/render_frame_host_manager.h" 5 #include "content/browser/frame_host/render_frame_host_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 // new navigating RenderFrameHost. 450 // new navigating RenderFrameHost.
451 transferring_render_frame_host->set_is_loading(false); 451 transferring_render_frame_host->set_is_loading(false);
452 452
453 // Treat the last URL in the chain as the destination and the remainder as 453 // Treat the last URL in the chain as the destination and the remainder as
454 // the redirect chain. 454 // the redirect chain.
455 CHECK(transfer_url_chain.size()); 455 CHECK(transfer_url_chain.size());
456 GURL transfer_url = transfer_url_chain.back(); 456 GURL transfer_url = transfer_url_chain.back();
457 std::vector<GURL> rest_of_chain = transfer_url_chain; 457 std::vector<GURL> rest_of_chain = transfer_url_chain;
458 rest_of_chain.pop_back(); 458 rest_of_chain.pop_back();
459 459
460 // |extra_headers| passed to RequestTransferURL below are always empty for
461 // now, because there are no known scenarios where headers (from POST request
462 // made from one renderer) need to be forwarded into the renderer where that
463 // request ends up being transfered to. In particular, XSSAuditor doesn't
464 // look at the headers (e.g. the Content-Type header) when analyzing the body
465 // of the POST request.
466 std::string extra_headers;
467
460 transferring_render_frame_host->frame_tree_node() 468 transferring_render_frame_host->frame_tree_node()
461 ->navigator() 469 ->navigator()
462 ->RequestTransferURL( 470 ->RequestTransferURL(
463 transferring_render_frame_host, transfer_url, nullptr, rest_of_chain, 471 transferring_render_frame_host, transfer_url, nullptr, rest_of_chain,
464 referrer, page_transition, global_request_id, 472 referrer, page_transition, global_request_id,
465 should_replace_current_entry, 473 should_replace_current_entry,
466 transfer_navigation_handle_->IsPost() ? "POST" : "GET", 474 transfer_navigation_handle_->IsPost() ? "POST" : "GET",
467 transfer_navigation_handle_->resource_request_body()); 475 transfer_navigation_handle_->resource_request_body(), extra_headers);
468 476
469 // If the navigation continued, the NavigationHandle should have been 477 // If the navigation continued, the NavigationHandle should have been
470 // transfered to a RenderFrameHost. In the other cases, it should be cleared. 478 // transfered to a RenderFrameHost. In the other cases, it should be cleared.
471 // If the NavigationHandle wasn't claimed, this will lead to the cancelation 479 // If the NavigationHandle wasn't claimed, this will lead to the cancelation
472 // of the request in the network stack. 480 // of the request in the network stack.
473 transfer_navigation_handle_.reset(); 481 transfer_navigation_handle_.reset();
474 482
475 // If the navigation in the new renderer did not start, inform the 483 // If the navigation in the new renderer did not start, inform the
476 // FrameTreeNode that it stopped loading. 484 // FrameTreeNode that it stopped loading.
477 if (!frame_tree_node_->IsLoading() && frame_tree_node_was_loading) 485 if (!frame_tree_node_->IsLoading() && frame_tree_node_was_loading)
(...skipping 2231 matching lines...) Expand 10 before | Expand all | Expand 10 after
2709 resolved_url)) { 2717 resolved_url)) {
2710 DCHECK(!dest_instance || 2718 DCHECK(!dest_instance ||
2711 dest_instance == render_frame_host_->GetSiteInstance()); 2719 dest_instance == render_frame_host_->GetSiteInstance());
2712 return false; 2720 return false;
2713 } 2721 }
2714 2722
2715 return true; 2723 return true;
2716 } 2724 }
2717 2725
2718 } // namespace content 2726 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/frame_host/render_frame_proxy_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698