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

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

Issue 2735183003: PlzNavigate: stop navigations when opening a document for write (Closed)
Patch Set: Rebase + fixed compilation error Created 3 years, 9 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 63139feef696ecaa24f4b8f8e9b8afea9667c8f6..5a5154466673cc29bf3fa27509b2a19cd18128fe 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -784,6 +784,7 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {
IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding)
IPC_MESSAGE_HANDLER(FrameHostMsg_BeginNavigation,
OnBeginNavigation)
+ IPC_MESSAGE_HANDLER(FrameHostMsg_AbortNavigation, OnAbortNavigation)
IPC_MESSAGE_HANDLER(FrameHostMsg_DispatchLoad, OnDispatchLoad)
IPC_MESSAGE_HANDLER(FrameHostMsg_TextSurroundingSelectionResponse,
OnTextSurroundingSelectionResponse)
@@ -2044,6 +2045,16 @@ void RenderFrameHostImpl::OnBeginNavigation(
frame_tree_node(), validated_params, validated_begin_params);
}
+void RenderFrameHostImpl::OnAbortNavigation() {
+ if (!IsBrowserSideNavigationEnabled()) {
+ NOTREACHED();
+ return;
+ }
+ if (!is_active())
+ return;
+ frame_tree_node()->navigator()->OnAbortNavigation(frame_tree_node());
+}
+
void RenderFrameHostImpl::OnDispatchLoad() {
CHECK(SiteIsolationPolicy::AreCrossProcessFramesPossible());
@@ -2641,7 +2652,7 @@ void RenderFrameHostImpl::DispatchBeforeUnload(bool for_navigation,
if (IsBrowserSideNavigationEnabled() && !for_navigation) {
// Cancel any pending navigations, to avoid their navigation commit/fail
// event from wiping out the is_waiting_for_beforeunload_ack_ state.
- frame_tree_node_->ResetNavigationRequest(false);
+ frame_tree_node_->ResetNavigationRequest(false, true);
}
// TODO(creis): Support beforeunload on subframes. For now just pretend that
@@ -2852,7 +2863,7 @@ void RenderFrameHostImpl::FailedNavigation(
// An error page is expected to commit, hence why is_loading_ is set to true.
is_loading_ = true;
- frame_tree_node_->ResetNavigationRequest(true);
+ frame_tree_node_->ResetNavigationRequest(true, true);
}
void RenderFrameHostImpl::SetUpMojoIfNeeded() {

Powered by Google App Engine
This is Rietveld 408576698