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

Unified Diff: content/browser/frame_host/navigator_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
« no previous file with comments | « content/browser/frame_host/navigator_impl.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 32e73c34ffe283726c4bbdfe351306dce218ecc0..d8e9e313c0f58451e9e49b47d324e33bb8bbb211 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -968,7 +968,7 @@ void NavigatorImpl::OnBeforeUnloadACK(FrameTreeNode* frame_tree_node,
if (proceed)
navigation_request->BeginNavigation();
else
- CancelNavigation(frame_tree_node);
+ CancelNavigation(frame_tree_node, true);
}
// PlzNavigate
@@ -993,7 +993,7 @@ void NavigatorImpl::OnBeginNavigation(
.is_history_navigation_in_new_child) {
// Preemptively clear this local pointer before deleting the request.
ongoing_navigation_request = nullptr;
- frame_tree_node->ResetNavigationRequest(false);
+ frame_tree_node->ResetNavigationRequest(false, true);
}
// The renderer-initiated navigation request is ignored iff a) there is an
@@ -1041,10 +1041,23 @@ void NavigatorImpl::OnBeginNavigation(
navigation_request->BeginNavigation();
}
+void NavigatorImpl::OnAbortNavigation(FrameTreeNode* frame_tree_node) {
+ NavigationRequest* ongoing_navigation_request =
+ frame_tree_node->navigation_request();
+ if (!ongoing_navigation_request ||
+ ongoing_navigation_request->browser_initiated()) {
+ return;
+ }
+
+ // Abort the renderer-initiated navigation request.
+ CancelNavigation(frame_tree_node, false);
+}
+
// PlzNavigate
-void NavigatorImpl::CancelNavigation(FrameTreeNode* frame_tree_node) {
+void NavigatorImpl::CancelNavigation(FrameTreeNode* frame_tree_node,
+ bool inform_renderer) {
CHECK(IsBrowserSideNavigationEnabled());
- frame_tree_node->ResetNavigationRequest(false);
+ frame_tree_node->ResetNavigationRequest(false, inform_renderer);
if (frame_tree_node->IsMainFrame())
navigation_data_.reset();
}
« no previous file with comments | « content/browser/frame_host/navigator_impl.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698