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 d4cc6f50c5f352ef7c908d8f5601785b97335ec6..62cdfc284d1a3149504c54e2f6eea1d5522caab4 100644 |
--- a/content/browser/frame_host/render_frame_host_impl.cc |
+++ b/content/browser/frame_host/render_frame_host_impl.cc |
@@ -150,6 +150,7 @@ RenderFrameHostImpl::RenderFrameHostImpl(SiteInstance* site_instance, |
is_waiting_for_beforeunload_ack_(false), |
unload_ack_is_for_navigation_(false), |
is_loading_(false), |
+ pending_commit_(false), |
accessibility_reset_token_(0), |
accessibility_reset_count_(0), |
no_create_browser_accessibility_manager_for_testing_(false), |
@@ -839,6 +840,14 @@ void RenderFrameHostImpl::OnDidCommitProvisionalLoad(const IPC::Message& msg) { |
accessibility_reset_count_ = 0; |
frame_tree_node()->navigator()->DidNavigate(this, validated_params); |
+ |
+ // PlzNavigate |
+ // Check that a commit is expected. |
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableBrowserSideNavigation)) { |
+ DCHECK(pending_commit_); |
Charlie Reis
2015/04/07 17:04:47
This doesn't seem right to me.
If the renderer pr
clamy
2015/04/08 11:56:23
I think we want to inform the browser that we're d
Charlie Reis
2015/04/08 16:45:27
Ok, so the renderer will tell the browser via Begi
clamy
2015/04/10 14:40:15
No that it is not implemented yet. We do not curre
Charlie Reis
2015/04/10 23:04:01
Ok. If you're expecting this check to fail, pleas
clamy
2015/04/14 14:14:16
Considering that the DCHECK may fail for a certain
|
+ pending_commit_ = false; |
+ } |
} |
void RenderFrameHostImpl::OnDidDropNavigation() { |
@@ -938,6 +947,13 @@ void RenderFrameHostImpl::SwapOut( |
if (!GetParent()) |
delegate_->SwappedOut(this); |
+ |
+ // PlzNavigate |
+ // A commit is no longer expected as the frame is swapped out. |
Charlie Reis
2015/04/07 17:04:47
I don't understand how this would happen. When wo
clamy
2015/04/08 11:56:23
If the current RFH was supposed to commit a naviga
Charlie Reis
2015/04/08 16:45:27
I thought that the DidCommitProvisionalLoad IPC wa
clamy
2015/04/10 14:40:15
No the DidCommitProvisionalLoad IPC is sent when t
Charlie Reis
2015/04/10 23:04:01
Oh. Wouldn't all sorts of things potentially canc
clamy
2015/04/14 14:14:16
Good point. I removed the DCHECK, and I wont reset
|
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableBrowserSideNavigation)) { |
+ pending_commit_ = false; |
+ } |
} |
void RenderFrameHostImpl::OnBeforeUnloadACK( |
@@ -1714,6 +1730,7 @@ void RenderFrameHostImpl::CommitNavigation( |
// TODO(clamy): Release the stream handle once the renderer has finished |
// reading it. |
stream_handle_ = body.Pass(); |
+ pending_commit_ = true; |
} |
void RenderFrameHostImpl::SetUpMojoIfNeeded() { |