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

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: Rebase + addressed comments Created 4 years, 10 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
« no previous file with comments | « content/browser/frame_host/navigator_impl.cc ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 da776a76cc40d1c9227f7ec94827ea3a85f1be49..0a83f2234d80ea18e6b4a5c99a5574386aa6ef6a 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1028,6 +1028,17 @@ void RenderFrameHostImpl::OnDidCommitProvisionalLoad(const IPC::Message& msg) {
true, // is_synchronous
false, // is_srcdoc
base::TimeTicks::Now());
+ // PlzNavigate
+ 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()) {
+ bool was_loading = frame_tree_node()->frame_tree()->IsLoading();
+ is_loading_ = true;
+ frame_tree_node()->DidStartLoading(true, was_loading);
+ }
+ pending_commit_ = false;
+ }
}
accessibility_reset_count_ = 0;
@@ -1045,10 +1056,6 @@ void RenderFrameHostImpl::OnDidCommitProvisionalLoad(const IPC::Message& msg) {
RenderWidgetHostImpl::From(GetView()->GetRenderWidgetHost())
->StartNewContentRenderingTimeout();
}
-
- // PlzNavigate
- if (IsBrowserSideNavigationEnabled())
- pending_commit_ = false;
}
void RenderFrameHostImpl::OnUpdateState(const PageState& state) {
@@ -1703,6 +1710,10 @@ void RenderFrameHostImpl::OnToggleFullscreen(bool enter_fullscreen) {
}
void RenderFrameHostImpl::OnDidStartLoading(bool to_different_document) {
+ if (IsBrowserSideNavigationEnabled() && to_different_document) {
+ bad_message::ReceivedBadMessage(GetProcess(),
+ bad_message::RFH_UNEXPECTED_LOAD_START);
nasko 2016/02/11 15:47:30 Do we want to proceed further in this method if th
clamy 2016/02/12 12:33:21 Done.
+ }
bool was_previously_loading = frame_tree_node_->frame_tree()->IsLoading();
is_loading_ = true;
« no previous file with comments | « content/browser/frame_host/navigator_impl.cc ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698