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/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 const Referrer& referrer, | 620 const Referrer& referrer, |
621 WindowOpenDisposition disposition, | 621 WindowOpenDisposition disposition, |
622 bool should_replace_current_entry, | 622 bool should_replace_current_entry, |
623 bool user_gesture) { | 623 bool user_gesture) { |
624 // This call only makes sense for subframes if OOPIFs are possible. | 624 // This call only makes sense for subframes if OOPIFs are possible. |
625 DCHECK(!render_frame_host->GetParent() || | 625 DCHECK(!render_frame_host->GetParent() || |
626 SiteIsolationPolicy::AreCrossProcessFramesPossible()); | 626 SiteIsolationPolicy::AreCrossProcessFramesPossible()); |
627 | 627 |
628 // If this came from a swapped out RenderFrameHost, we only allow the request | 628 // If this came from a swapped out RenderFrameHost, we only allow the request |
629 // if we are still in the same BrowsingInstance. | 629 // if we are still in the same BrowsingInstance. |
630 // TODO(creis): Move this to RenderFrameProxyHost::OpenURL. | |
631 SiteInstance* current_site_instance = render_frame_host->frame_tree_node() | 630 SiteInstance* current_site_instance = render_frame_host->frame_tree_node() |
632 ->current_frame_host() | 631 ->current_frame_host() |
633 ->GetSiteInstance(); | 632 ->GetSiteInstance(); |
634 if (render_frame_host->is_swapped_out() && | 633 if (render_frame_host->is_swapped_out() && |
635 !render_frame_host->GetSiteInstance()->IsRelatedSiteInstance( | 634 !render_frame_host->GetSiteInstance()->IsRelatedSiteInstance( |
636 current_site_instance)) { | 635 current_site_instance)) { |
637 return; | 636 return; |
638 } | 637 } |
639 | 638 |
640 // TODO(creis): Pass the redirect_chain into this method to support client | 639 // TODO(creis): Pass the redirect_chain into this method to support client |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 params.is_renderer_initiated = false; | 685 params.is_renderer_initiated = false; |
687 } | 686 } |
688 | 687 |
689 if (delegate_) | 688 if (delegate_) |
690 delegate_->RequestOpenURL(render_frame_host, params); | 689 delegate_->RequestOpenURL(render_frame_host, params); |
691 } | 690 } |
692 | 691 |
693 void NavigatorImpl::RequestTransferURL( | 692 void NavigatorImpl::RequestTransferURL( |
694 RenderFrameHostImpl* render_frame_host, | 693 RenderFrameHostImpl* render_frame_host, |
695 const GURL& url, | 694 const GURL& url, |
| 695 SiteInstance* source_site_instance, |
696 const std::vector<GURL>& redirect_chain, | 696 const std::vector<GURL>& redirect_chain, |
697 const Referrer& referrer, | 697 const Referrer& referrer, |
698 ui::PageTransition page_transition, | 698 ui::PageTransition page_transition, |
699 const GlobalRequestID& transferred_global_request_id, | 699 const GlobalRequestID& transferred_global_request_id, |
700 bool should_replace_current_entry) { | 700 bool should_replace_current_entry) { |
701 // This call only makes sense for subframes if OOPIFs are possible. | 701 // This call only makes sense for subframes if OOPIFs are possible. |
702 DCHECK(!render_frame_host->GetParent() || | 702 DCHECK(!render_frame_host->GetParent() || |
703 SiteIsolationPolicy::AreCrossProcessFramesPossible()); | 703 SiteIsolationPolicy::AreCrossProcessFramesPossible()); |
704 | 704 |
705 // Allow the delegate to cancel the transfer. | 705 // Allow the delegate to cancel the transfer. |
(...skipping 24 matching lines...) Expand all Loading... |
730 // want web sites to see a referrer of "chrome://blah" (and some | 730 // want web sites to see a referrer of "chrome://blah" (and some |
731 // chrome: URLs might have search terms or other stuff we don't want to | 731 // chrome: URLs might have search terms or other stuff we don't want to |
732 // send to the site), so we send no referrer. | 732 // send to the site), so we send no referrer. |
733 referrer_to_use = Referrer(); | 733 referrer_to_use = Referrer(); |
734 | 734 |
735 // Navigations in Web UI pages count as browser-initiated navigations. | 735 // Navigations in Web UI pages count as browser-initiated navigations. |
736 is_renderer_initiated = false; | 736 is_renderer_initiated = false; |
737 } | 737 } |
738 | 738 |
739 NavigationController::LoadURLParams load_url_params(dest_url); | 739 NavigationController::LoadURLParams load_url_params(dest_url); |
740 // The source_site_instance only matters for navigations via RenderFrameProxy, | 740 // The source_site_instance may matter for navigations via RenderFrameProxy. |
741 // which go through RequestOpenURL. | 741 load_url_params.source_site_instance = source_site_instance; |
742 load_url_params.source_site_instance = nullptr; | |
743 load_url_params.transition_type = page_transition; | 742 load_url_params.transition_type = page_transition; |
744 load_url_params.frame_tree_node_id = node->frame_tree_node_id(); | 743 load_url_params.frame_tree_node_id = node->frame_tree_node_id(); |
745 load_url_params.referrer = referrer_to_use; | 744 load_url_params.referrer = referrer_to_use; |
746 load_url_params.redirect_chain = redirect_chain; | 745 load_url_params.redirect_chain = redirect_chain; |
747 load_url_params.is_renderer_initiated = is_renderer_initiated; | 746 load_url_params.is_renderer_initiated = is_renderer_initiated; |
748 load_url_params.transferred_global_request_id = transferred_global_request_id; | 747 load_url_params.transferred_global_request_id = transferred_global_request_id; |
749 load_url_params.should_replace_current_entry = should_replace_current_entry; | 748 load_url_params.should_replace_current_entry = should_replace_current_entry; |
750 | 749 |
751 controller_->LoadURLWithParams(load_url_params); | 750 controller_->LoadURLWithParams(load_url_params); |
752 } | 751 } |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 entry->set_should_replace_entry(pending_entry->should_replace_entry()); | 1076 entry->set_should_replace_entry(pending_entry->should_replace_entry()); |
1078 entry->SetRedirectChain(pending_entry->GetRedirectChain()); | 1077 entry->SetRedirectChain(pending_entry->GetRedirectChain()); |
1079 } | 1078 } |
1080 controller_->SetPendingEntry(std::move(entry)); | 1079 controller_->SetPendingEntry(std::move(entry)); |
1081 if (delegate_) | 1080 if (delegate_) |
1082 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 1081 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
1083 } | 1082 } |
1084 } | 1083 } |
1085 | 1084 |
1086 } // namespace content | 1085 } // namespace content |
OLD | NEW |