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

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: Addressed commemts 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 25b0981b8add729c72c965957f605cda04e14c78..e45acd1073e2a2cca3802358d54bc2e82cbee45e 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());
@@ -2642,7 +2653,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
@@ -2853,7 +2864,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() {
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/frame_host/render_frame_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698