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

Side by Side Diff: content/browser/frame_host/render_frame_host_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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateToUniqueOrigin, 721 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateToUniqueOrigin,
722 OnUpdateToUniqueOrigin) 722 OnUpdateToUniqueOrigin)
723 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeSandboxFlags, 723 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeSandboxFlags,
724 OnDidChangeSandboxFlags) 724 OnDidChangeSandboxFlags)
725 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeFrameOwnerProperties, 725 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeFrameOwnerProperties,
726 OnDidChangeFrameOwnerProperties) 726 OnDidChangeFrameOwnerProperties)
727 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateTitle, OnUpdateTitle) 727 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateTitle, OnUpdateTitle)
728 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding) 728 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding)
729 IPC_MESSAGE_HANDLER(FrameHostMsg_BeginNavigation, 729 IPC_MESSAGE_HANDLER(FrameHostMsg_BeginNavigation,
730 OnBeginNavigation) 730 OnBeginNavigation)
731 IPC_MESSAGE_HANDLER(FrameHostMsg_AbortNavigation, OnAbortNavigation)
731 IPC_MESSAGE_HANDLER(FrameHostMsg_DispatchLoad, OnDispatchLoad) 732 IPC_MESSAGE_HANDLER(FrameHostMsg_DispatchLoad, OnDispatchLoad)
732 IPC_MESSAGE_HANDLER(FrameHostMsg_TextSurroundingSelectionResponse, 733 IPC_MESSAGE_HANDLER(FrameHostMsg_TextSurroundingSelectionResponse,
733 OnTextSurroundingSelectionResponse) 734 OnTextSurroundingSelectionResponse)
734 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents) 735 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents)
735 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_LocationChanges, 736 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_LocationChanges,
736 OnAccessibilityLocationChanges) 737 OnAccessibilityLocationChanges)
737 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_FindInPageResult, 738 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_FindInPageResult,
738 OnAccessibilityFindInPageResult) 739 OnAccessibilityFindInPageResult)
739 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_ChildFrameHitTestResult, 740 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_ChildFrameHitTestResult,
740 OnAccessibilityChildFrameHitTestResult) 741 OnAccessibilityChildFrameHitTestResult)
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1915 if (waiting_for_init_) { 1916 if (waiting_for_init_) {
1916 pendinging_navigate_ = base::MakeUnique<PendingNavigation>( 1917 pendinging_navigate_ = base::MakeUnique<PendingNavigation>(
1917 validated_params, validated_begin_params); 1918 validated_params, validated_begin_params);
1918 return; 1919 return;
1919 } 1920 }
1920 1921
1921 frame_tree_node()->navigator()->OnBeginNavigation( 1922 frame_tree_node()->navigator()->OnBeginNavigation(
1922 frame_tree_node(), validated_params, validated_begin_params); 1923 frame_tree_node(), validated_params, validated_begin_params);
1923 } 1924 }
1924 1925
1926 void RenderFrameHostImpl::OnAbortNavigation() {
1927 CHECK(IsBrowserSideNavigationEnabled());
1928 if (!is_active())
1929 return;
1930 frame_tree_node()->navigator()->OnAbortNavigation(frame_tree_node());
1931 }
1932
1925 void RenderFrameHostImpl::OnDispatchLoad() { 1933 void RenderFrameHostImpl::OnDispatchLoad() {
1926 CHECK(SiteIsolationPolicy::AreCrossProcessFramesPossible()); 1934 CHECK(SiteIsolationPolicy::AreCrossProcessFramesPossible());
1927 1935
1928 // Don't forward the load event if this RFH is pending deletion. This can 1936 // Don't forward the load event if this RFH is pending deletion. This can
1929 // happen in a race where this RenderFrameHost finishes loading just after 1937 // happen in a race where this RenderFrameHost finishes loading just after
1930 // the frame navigates away. See https://crbug.com/626802. 1938 // the frame navigates away. See https://crbug.com/626802.
1931 if (!is_active()) 1939 if (!is_active())
1932 return; 1940 return;
1933 1941
1934 // Only frames with an out-of-process parent frame should be sending this 1942 // Only frames with an out-of-process parent frame should be sending this
(...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after
3461 // There is no pending NavigationEntry in these cases, so pass 0 as the 3469 // There is no pending NavigationEntry in these cases, so pass 0 as the
3462 // pending_nav_entry_id. If the previous handle was a prematurely aborted 3470 // pending_nav_entry_id. If the previous handle was a prematurely aborted
3463 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. 3471 // navigation loaded via LoadDataWithBaseURL, propagate the entry id.
3464 return NavigationHandleImpl::Create( 3472 return NavigationHandleImpl::Create(
3465 params.url, params.redirects, frame_tree_node_, is_renderer_initiated, 3473 params.url, params.redirects, frame_tree_node_, is_renderer_initiated,
3466 params.was_within_same_page, base::TimeTicks::Now(), 3474 params.was_within_same_page, base::TimeTicks::Now(),
3467 entry_id_for_data_nav, false); // started_from_context_menu 3475 entry_id_for_data_nav, false); // started_from_context_menu
3468 } 3476 }
3469 3477
3470 } // namespace content 3478 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698