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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 1163303003: PlzNavigate: Create the speculative renderer earlier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed clamy's comments; moved RFHM::BeginNavigation call into FTN::SetNavigationRequest. Created 5 years, 6 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/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index c8cc6470d22ab8354ec7efc73f3fe424d35e1d55..d35505afa73f26f3bc13c180b6d9edd38d0f2adb 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1681,8 +1681,9 @@ void RenderFrameHostImpl::Stop() {
void RenderFrameHostImpl::DispatchBeforeUnload(bool for_navigation) {
// TODO(creis): Support beforeunload on subframes. For now just pretend that
// the handler ran and allowed the navigation to proceed.
- if (GetParent() || !IsRenderFrameLive()) {
- // We don't have a live renderer, so just skip running beforeunload.
+ if (!ShouldDispatchBeforeUnload()) {
+ // We don't have a live renderer or are on a subframe, so just skip running
clamy 2015/06/09 16:01:30 If changing the comment, rephrase so that it does
carlosk 2015/06/10 11:53:09 Done.
+ // beforeunload.
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
clamy 2015/06/09 16:07:44 Now that I think about it, we should never end up
carlosk 2015/06/10 11:53:09 Done.
switches::kEnableBrowserSideNavigation)) {
frame_tree_node_->navigator()->OnBeforeUnloadACK(
@@ -1723,6 +1724,10 @@ void RenderFrameHostImpl::DispatchBeforeUnload(bool for_navigation) {
}
}
+bool RenderFrameHostImpl::ShouldDispatchBeforeUnload() {
clamy 2015/06/09 16:01:30 I think you may copy the TODO(creis): Support befo
carlosk 2015/06/10 11:53:09 Done.
+ return !GetParent() && IsRenderFrameLive();
+}
+
void RenderFrameHostImpl::DisownOpener() {
Send(new FrameMsg_DisownOpener(GetRoutingID()));
}

Powered by Google App Engine
This is Rietveld 408576698