| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 render_frame_host_->GetProcess()->GetID(); | 642 render_frame_host_->GetProcess()->GetID(); |
| 643 DCHECK_EQ(process_id, global_request_id.child_id); | 643 DCHECK_EQ(process_id, global_request_id.child_id); |
| 644 | 644 |
| 645 // Treat the last URL in the chain as the destination and the remainder as | 645 // Treat the last URL in the chain as the destination and the remainder as |
| 646 // the redirect chain. | 646 // the redirect chain. |
| 647 CHECK(transfer_url_chain.size()); | 647 CHECK(transfer_url_chain.size()); |
| 648 GURL transfer_url = transfer_url_chain.back(); | 648 GURL transfer_url = transfer_url_chain.back(); |
| 649 std::vector<GURL> rest_of_chain = transfer_url_chain; | 649 std::vector<GURL> rest_of_chain = transfer_url_chain; |
| 650 rest_of_chain.pop_back(); | 650 rest_of_chain.pop_back(); |
| 651 | 651 |
| 652 // We don't know whether the original request had |user_action| set to true. | |
| 653 // However, since we force the navigation to be in the current tab, it | |
| 654 // doesn't matter. | |
| 655 pending_render_frame_host->frame_tree_node()->navigator()->RequestTransferURL( | 652 pending_render_frame_host->frame_tree_node()->navigator()->RequestTransferURL( |
| 656 pending_render_frame_host, transfer_url, nullptr, rest_of_chain, referrer, | 653 pending_render_frame_host, transfer_url, nullptr, rest_of_chain, referrer, |
| 657 page_transition, CURRENT_TAB, global_request_id, | 654 page_transition, CURRENT_TAB, global_request_id, |
| 658 should_replace_current_entry, true); | 655 should_replace_current_entry); |
| 659 | 656 |
| 660 // The transferring request was only needed during the RequestTransferURL | 657 // The transferring request was only needed during the RequestTransferURL |
| 661 // call, so it is safe to clear at this point. | 658 // call, so it is safe to clear at this point. |
| 662 cross_site_transferring_request_.reset(); | 659 cross_site_transferring_request_.reset(); |
| 663 | 660 |
| 664 // If the navigation continued, the NavigationHandle should have been | 661 // If the navigation continued, the NavigationHandle should have been |
| 665 // transfered to a RenderFrameHost. In the other cases, it should be cleared. | 662 // transfered to a RenderFrameHost. In the other cases, it should be cleared. |
| 666 transfer_navigation_handle_.reset(); | 663 transfer_navigation_handle_.reset(); |
| 667 } | 664 } |
| 668 | 665 |
| (...skipping 2014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2683 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { | 2680 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { |
| 2684 if (!frame_tree_node_->opener()) | 2681 if (!frame_tree_node_->opener()) |
| 2685 return MSG_ROUTING_NONE; | 2682 return MSG_ROUTING_NONE; |
| 2686 | 2683 |
| 2687 return frame_tree_node_->opener() | 2684 return frame_tree_node_->opener() |
| 2688 ->render_manager() | 2685 ->render_manager() |
| 2689 ->GetRoutingIdForSiteInstance(instance); | 2686 ->GetRoutingIdForSiteInstance(instance); |
| 2690 } | 2687 } |
| 2691 | 2688 |
| 2692 } // namespace content | 2689 } // namespace content |
| OLD | NEW |