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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 const GURL& url, | 608 const GURL& url, |
609 SiteInstance* source_site_instance, | 609 SiteInstance* source_site_instance, |
610 const Referrer& referrer, | 610 const Referrer& referrer, |
611 WindowOpenDisposition disposition, | 611 WindowOpenDisposition disposition, |
612 bool should_replace_current_entry, | 612 bool should_replace_current_entry, |
613 bool user_gesture) { | 613 bool user_gesture) { |
614 // This call only makes sense for subframes if OOPIFs are possible. | 614 // This call only makes sense for subframes if OOPIFs are possible. |
615 DCHECK(!render_frame_host->GetParent() || | 615 DCHECK(!render_frame_host->GetParent() || |
616 SiteIsolationPolicy::AreCrossProcessFramesPossible()); | 616 SiteIsolationPolicy::AreCrossProcessFramesPossible()); |
617 | 617 |
618 // If this came from a swapped out RenderFrameHost, we only allow the request | |
619 // if we are still in the same BrowsingInstance. | |
620 SiteInstance* current_site_instance = render_frame_host->frame_tree_node() | 618 SiteInstance* current_site_instance = render_frame_host->frame_tree_node() |
621 ->current_frame_host() | 619 ->current_frame_host() |
622 ->GetSiteInstance(); | 620 ->GetSiteInstance(); |
623 if (render_frame_host->is_swapped_out() && | |
624 !render_frame_host->GetSiteInstance()->IsRelatedSiteInstance( | |
625 current_site_instance)) { | |
626 return; | |
627 } | |
628 | 621 |
629 // TODO(creis): Pass the redirect_chain into this method to support client | 622 // TODO(creis): Pass the redirect_chain into this method to support client |
630 // redirects. http://crbug.com/311721. | 623 // redirects. http://crbug.com/311721. |
631 std::vector<GURL> redirect_chain; | 624 std::vector<GURL> redirect_chain; |
632 | 625 |
633 GURL dest_url(url); | 626 GURL dest_url(url); |
634 if (!GetContentClient()->browser()->ShouldAllowOpenURL( | 627 if (!GetContentClient()->browser()->ShouldAllowOpenURL( |
635 current_site_instance, url)) { | 628 current_site_instance, url)) { |
636 dest_url = GURL(url::kAboutBlankURL); | 629 dest_url = GURL(url::kAboutBlankURL); |
637 } | 630 } |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 if (pending_entry != controller_->GetVisibleEntry() || | 1124 if (pending_entry != controller_->GetVisibleEntry() || |
1132 !should_preserve_entry) { | 1125 !should_preserve_entry) { |
1133 controller_->DiscardPendingEntry(true); | 1126 controller_->DiscardPendingEntry(true); |
1134 | 1127 |
1135 // Also force the UI to refresh. | 1128 // Also force the UI to refresh. |
1136 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); | 1129 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); |
1137 } | 1130 } |
1138 } | 1131 } |
1139 | 1132 |
1140 } // namespace content | 1133 } // namespace content |
OLD | NEW |