| OLD | NEW |
| 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 // new navigating RenderFrameHost. | 449 // new navigating RenderFrameHost. |
| 450 transferring_render_frame_host->set_is_loading(false); | 450 transferring_render_frame_host->set_is_loading(false); |
| 451 | 451 |
| 452 // Treat the last URL in the chain as the destination and the remainder as | 452 // Treat the last URL in the chain as the destination and the remainder as |
| 453 // the redirect chain. | 453 // the redirect chain. |
| 454 CHECK(transfer_url_chain.size()); | 454 CHECK(transfer_url_chain.size()); |
| 455 GURL transfer_url = transfer_url_chain.back(); | 455 GURL transfer_url = transfer_url_chain.back(); |
| 456 std::vector<GURL> rest_of_chain = transfer_url_chain; | 456 std::vector<GURL> rest_of_chain = transfer_url_chain; |
| 457 rest_of_chain.pop_back(); | 457 rest_of_chain.pop_back(); |
| 458 | 458 |
| 459 // |extra_headers| passed to RequestTransferURL below are always empty for |
| 460 // now, because there are no known scenarios where headers (from POST request |
| 461 // made from one renderer) need to be forwarded into the renderer where that |
| 462 // request ends up being transfered to. In particular, XSSAuditor doesn't |
| 463 // look at the headers (e.g. the Content-Type header) when analyzing the body |
| 464 // of the POST request. |
| 465 std::string extra_headers; |
| 466 |
| 459 transferring_render_frame_host->frame_tree_node() | 467 transferring_render_frame_host->frame_tree_node() |
| 460 ->navigator() | 468 ->navigator() |
| 461 ->RequestTransferURL( | 469 ->RequestTransferURL( |
| 462 transferring_render_frame_host, transfer_url, nullptr, rest_of_chain, | 470 transferring_render_frame_host, transfer_url, nullptr, rest_of_chain, |
| 463 referrer, page_transition, global_request_id, | 471 referrer, page_transition, global_request_id, |
| 464 should_replace_current_entry, | 472 should_replace_current_entry, |
| 465 transfer_navigation_handle_->IsPost() ? "POST" : "GET", | 473 transfer_navigation_handle_->IsPost() ? "POST" : "GET", |
| 466 transfer_navigation_handle_->resource_request_body()); | 474 transfer_navigation_handle_->resource_request_body(), extra_headers); |
| 467 | 475 |
| 468 // If the navigation continued, the NavigationHandle should have been | 476 // If the navigation continued, the NavigationHandle should have been |
| 469 // transfered to a RenderFrameHost. In the other cases, it should be cleared. | 477 // transfered to a RenderFrameHost. In the other cases, it should be cleared. |
| 470 // If the NavigationHandle wasn't claimed, this will lead to the cancelation | 478 // If the NavigationHandle wasn't claimed, this will lead to the cancelation |
| 471 // of the request in the network stack. | 479 // of the request in the network stack. |
| 472 transfer_navigation_handle_.reset(); | 480 transfer_navigation_handle_.reset(); |
| 473 | 481 |
| 474 // If the navigation in the new renderer did not start, inform the | 482 // If the navigation in the new renderer did not start, inform the |
| 475 // FrameTreeNode that it stopped loading. | 483 // FrameTreeNode that it stopped loading. |
| 476 if (!frame_tree_node_->IsLoading() && frame_tree_node_was_loading) | 484 if (!frame_tree_node_->IsLoading() && frame_tree_node_was_loading) |
| (...skipping 2214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2691 resolved_url)) { | 2699 resolved_url)) { |
| 2692 DCHECK(!dest_instance || | 2700 DCHECK(!dest_instance || |
| 2693 dest_instance == render_frame_host_->GetSiteInstance()); | 2701 dest_instance == render_frame_host_->GetSiteInstance()); |
| 2694 return false; | 2702 return false; |
| 2695 } | 2703 } |
| 2696 | 2704 |
| 2697 return true; | 2705 return true; |
| 2698 } | 2706 } |
| 2699 | 2707 |
| 2700 } // namespace content | 2708 } // namespace content |
| OLD | NEW |