Move NavigationRequest creation to NavigationController: 1/3
This Cl is the first in a 3 CL series to move the NavigationRequest
creation to the NavigationController. The end goal is to have Navigator
take a NavigationRequest as an argument to Navigate instead of the
pending NavigationEntry.
Summary of the changes in this CL:
1) Navigator
- NavigatorImpl::RequestTransferURL becomes NavigateFromFrameProxy. It calls
NavigationControllerImpl::NavigateFromFrameProxy instead of creating a
NavigationEntry and navigating to it directly.
- NavigatorImpl::NavigateNewChildFrame becomes
StartHistoryNavigationInNewChild. It calls
NavigationControllerImpl::StartHistoryNavigationInNewChild instead of creating
a NavigationEntry and navigating to it directly.
2) NavigationController:
- StartHistoryNavigationInNewChild is a new function that contains code that
used to be in NavigatorImpl::NavigateNewChildFrame. It is called when creating
a subframe during a history navigation. It will try to perform a history
navigation in the child frame.
- NavigateFromFrameProxy is a new function that contains code moved from
NavigatorImpl::RequestTransferURL. It creates a NavigationEntry and a
NavigationRequest for the navigation, and asks the Navigator to perform them.
Bug: 803859
Change-Id: I45891c21dc8f1e86e3f1bc1829ee3a92af1a5bfb
Reviewed-on: https://chromium-review.googlesource.com/959012
Commit-Queue: Camille Lamy <[email protected]>
Reviewed-by: Alex Moshchuk <[email protected]>
Reviewed-by: Charlie Reis <[email protected]>
Cr-Commit-Position: refs/heads/master@{#555791}
diff --git a/content/browser/frame_host/navigator_impl.h b/content/browser/frame_host/navigator_impl.h
index b1bb76b..99aeea9e 100644
--- a/content/browser/frame_host/navigator_impl.h
+++ b/content/browser/frame_host/navigator_impl.h
@@ -63,8 +63,19 @@
ReloadType reload_type,
bool is_same_document_history_load,
std::unique_ptr<NavigationUIData> navigation_ui_data) override;
- bool NavigateNewChildFrame(RenderFrameHostImpl* render_frame_host,
- const GURL& default_url) override;
+ bool NavigateToEntry(
+ FrameTreeNode* frame_tree_node,
+ const FrameNavigationEntry& frame_entry,
+ const NavigationEntryImpl& entry,
+ ReloadType reload_type,
+ bool is_same_document_history_load,
+ bool is_history_navigation_in_new_child,
+ bool is_pending_entry,
+ const scoped_refptr<network::ResourceRequestBody>& post_body,
+ std::unique_ptr<NavigationUIData> navigation_ui_data) override;
+ bool StartHistoryNavigationInNewSubframe(
+ RenderFrameHostImpl* render_frame_host,
+ const GURL& default_url) override;
void RequestOpenURL(
RenderFrameHostImpl* render_frame_host,
const GURL& url,
@@ -77,14 +88,12 @@
bool user_gesture,
blink::WebTriggeringEventInfo triggering_event_info,
const base::Optional<std::string>& suggested_filename) override;
- void RequestTransferURL(
+ void NavigateFromFrameProxy(
RenderFrameHostImpl* render_frame_host,
const GURL& url,
SiteInstance* source_site_instance,
- const std::vector<GURL>& redirect_chain,
const Referrer& referrer,
ui::PageTransition page_transition,
- const GlobalRequestID& transferred_global_request_id,
bool should_replace_current_entry,
const std::string& method,
scoped_refptr<network::ResourceRequestBody> post_body,
@@ -118,20 +127,6 @@
friend class NavigatorTestWithBrowserSideNavigation;
~NavigatorImpl() override;
- // Navigates to the given entry, which might be the pending entry (if
- // |is_pending_entry| is true). Private because all callers should use either
- // NavigateToPendingEntry or NavigateToNewChildFrame.
- bool NavigateToEntry(
- FrameTreeNode* frame_tree_node,
- const FrameNavigationEntry& frame_entry,
- const NavigationEntryImpl& entry,
- ReloadType reload_type,
- bool is_same_document_history_load,
- bool is_history_navigation_in_new_child,
- bool is_pending_entry,
- const scoped_refptr<network::ResourceRequestBody>& post_body,
- std::unique_ptr<NavigationUIData> navigation_ui_data);
-
// If needed, sends a BeforeUnload IPC to the renderer to ask it to execute
// the beforeUnload event. Otherwise, the navigation request will be started.
void RequestNavigation(