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

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

Issue 1799163002: Remove swapped out state from RenderFrameHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on ToT to pick up couple of related removal CLs. Created 4 years, 9 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/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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 const GURL& url, 607 const GURL& url,
608 SiteInstance* source_site_instance, 608 SiteInstance* source_site_instance,
609 const Referrer& referrer, 609 const Referrer& referrer,
610 WindowOpenDisposition disposition, 610 WindowOpenDisposition disposition,
611 bool should_replace_current_entry, 611 bool should_replace_current_entry,
612 bool user_gesture) { 612 bool user_gesture) {
613 // This call only makes sense for subframes if OOPIFs are possible. 613 // This call only makes sense for subframes if OOPIFs are possible.
614 DCHECK(!render_frame_host->GetParent() || 614 DCHECK(!render_frame_host->GetParent() ||
615 SiteIsolationPolicy::AreCrossProcessFramesPossible()); 615 SiteIsolationPolicy::AreCrossProcessFramesPossible());
616 616
617 // If this came from a swapped out RenderFrameHost, we only allow the request
618 // if we are still in the same BrowsingInstance.
619 SiteInstance* current_site_instance = render_frame_host->frame_tree_node() 617 SiteInstance* current_site_instance = render_frame_host->frame_tree_node()
620 ->current_frame_host() 618 ->current_frame_host()
621 ->GetSiteInstance(); 619 ->GetSiteInstance();
622 if (render_frame_host->is_swapped_out() &&
623 !render_frame_host->GetSiteInstance()->IsRelatedSiteInstance(
624 current_site_instance)) {
625 return;
626 }
627 620
628 // TODO(creis): Pass the redirect_chain into this method to support client 621 // TODO(creis): Pass the redirect_chain into this method to support client
629 // redirects. http://crbug.com/311721. 622 // redirects. http://crbug.com/311721.
630 std::vector<GURL> redirect_chain; 623 std::vector<GURL> redirect_chain;
631 624
632 GURL dest_url(url); 625 GURL dest_url(url);
633 if (!GetContentClient()->browser()->ShouldAllowOpenURL( 626 if (!GetContentClient()->browser()->ShouldAllowOpenURL(
634 current_site_instance, url)) { 627 current_site_instance, url)) {
635 dest_url = GURL(url::kAboutBlankURL); 628 dest_url = GURL(url::kAboutBlankURL);
636 } 629 }
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 if (pending_entry != controller_->GetVisibleEntry() || 1114 if (pending_entry != controller_->GetVisibleEntry() ||
1122 !should_preserve_entry) { 1115 !should_preserve_entry) {
1123 controller_->DiscardPendingEntry(true); 1116 controller_->DiscardPendingEntry(true);
1124 1117
1125 // Also force the UI to refresh. 1118 // Also force the UI to refresh.
1126 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); 1119 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL);
1127 } 1120 }
1128 } 1121 }
1129 1122
1130 } // namespace content 1123 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698