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

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

Issue 2735183003: PlzNavigate: stop navigations when opening a document for write (Closed)
Patch Set: 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/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index b2533a84e915e1e3650933c5f2ec1a26d4289824..bf4a5fb8cb4341ed7e716060efd66bab9965dbaa 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -1008,7 +1008,7 @@ void NavigatorImpl::OnBeginNavigation(
RenderFrameHost* current_frame_host =
frame_tree_node->render_manager()->current_frame_host();
current_frame_host->Send(
- new FrameMsg_Stop(current_frame_host->GetRoutingID()));
+ new FrameMsg_DroppedNavigation(current_frame_host->GetRoutingID()));
return;
}
@@ -1043,6 +1043,20 @@ void NavigatorImpl::OnBeginNavigation(
navigation_request->BeginNavigation();
}
+void NavigatorImpl::OnAbortNavigation(FrameTreeNode* frame_tree_node) {
+ DCHECK(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);
+}
+
// PlzNavigate
void NavigatorImpl::CancelNavigation(FrameTreeNode* frame_tree_node) {
CHECK(IsBrowserSideNavigationEnabled());

Powered by Google App Engine
This is Rietveld 408576698