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

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

Issue 1608283002: PlzNavigate: Use WebNavigationPolicyHandledByClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@change-did-start-loading-logic
Patch Set: Created 4 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/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 b2384228de290448ec156508a2c5d961444895c1..77eb148e9f6d58bee7bf2fd06c151813685fe760 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1042,8 +1042,15 @@ void RenderFrameHostImpl::OnDidCommitProvisionalLoad(const IPC::Message& msg) {
}
// PlzNavigate
- if (IsBrowserSideNavigationEnabled())
+ if (IsBrowserSideNavigationEnabled()) {
+ // PlzNavigate: synchronous loads happen in the renderer, and the browser
+ // has not been notified about the start of the load yet. Do it now.
+ if (!is_loading()) {
nasko 2016/02/03 22:28:14 Why not put this in the same section above, where
clamy 2016/02/10 16:39:35 Done.
+ is_loading_ = true;
+ frame_tree_node()->DidStartLoading(true, false);
+ }
pending_commit_ = false;
+ }
}
void RenderFrameHostImpl::OnUpdateState(const PageState& state) {
@@ -1694,6 +1701,11 @@ void RenderFrameHostImpl::OnToggleFullscreen(bool enter_fullscreen) {
}
void RenderFrameHostImpl::OnDidStartLoading(bool to_different_document) {
+ // PlzNavigate: the browser is responsible for knowing the start of all
+ // non-synchronous navigations.
+ if (IsBrowserSideNavigationEnabled() && to_different_document)
+ return;
carlosk 2016/02/03 12:41:56 Instead of ignoring shouldn't we stop it from bein
clamy 2016/02/10 16:39:35 Done.
+
bool was_previously_loading = frame_tree_node_->frame_tree()->IsLoading();
is_loading_ = true;
frame_tree_node_->DidStartLoading(to_different_document,

Powered by Google App Engine
This is Rietveld 408576698