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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 88503002: Have the unload event execute in background on cross-site navigations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + addressed some of Nasko's comments Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 3bc565d3f9c06b493478cba0be7f1a5beaac296a..b8a8dbdd3725925a10970ebf856be73b2c2536e4 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2712,7 +2712,8 @@ void WebContentsImpl::RenderViewCreated(RenderViewHost* render_view_host) {
// Don't send notifications if we are just creating a swapped-out RVH for
// the opener chain. These won't be used for view-source or WebUI, so it's
// ok to return early.
- if (static_cast<RenderViewHostImpl*>(render_view_host)->is_swapped_out())
+ if (static_cast<RenderViewHostImpl*>(render_view_host)->rvh_state() ==
+ RenderViewHostImpl::STATE_SWAPPED_OUT)
return;
if (delegate_)
@@ -3133,7 +3134,8 @@ void WebContentsImpl::RequestOpenURL(RenderViewHost* rvh,
bool user_gesture) {
// If this came from a swapped out RenderViewHost, we only allow the request
// if we are still in the same BrowsingInstance.
- if (static_cast<RenderViewHostImpl*>(rvh)->is_swapped_out() &&
+ if (static_cast<RenderViewHostImpl*>(rvh)->rvh_state() ==
+ RenderViewHostImpl::STATE_SWAPPED_OUT &&
!rvh->GetSiteInstance()->IsRelatedSiteInstance(GetSiteInstance())) {
return;
}
@@ -3303,7 +3305,8 @@ void WebContentsImpl::RunJavaScriptMessage(
// showing an interstitial as it's shown over the previous page and we don't
// want the hidden page's dialogs to interfere with the interstitial.
bool suppress_this_message =
- static_cast<RenderViewHostImpl*>(rvh)->is_swapped_out() ||
+ static_cast<RenderViewHostImpl*>(rvh)->rvh_state() ==
+ RenderViewHostImpl::STATE_SWAPPED_OUT ||
ShowingInterstitialPage() ||
!delegate_ ||
delegate_->ShouldSuppressDialogs() ||
@@ -3348,7 +3351,7 @@ void WebContentsImpl::RunBeforeUnloadConfirm(RenderViewHost* rvh,
delegate_->WillRunBeforeUnloadConfirm();
bool suppress_this_message =
- rvhi->is_swapped_out() ||
+ rvhi->rvh_state() != RenderViewHostImpl::STATE_LIVE ||
!delegate_ ||
delegate_->ShouldSuppressDialogs() ||
!delegate_->GetJavaScriptDialogManager();

Powered by Google App Engine
This is Rietveld 408576698