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

Unified Diff: content/browser/frame_host/render_frame_host_manager.h

Issue 379143002: PlzNavigate: implement RequestNavigation in the no live renderer case (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed speculative rfh + no pending_navigation_entry dependency Created 6 years, 4 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_manager.h
diff --git a/content/browser/frame_host/render_frame_host_manager.h b/content/browser/frame_host/render_frame_host_manager.h
index 38914e86aaad9949af682704b480d394959bfbd9..ce032140ad6c3498f499e1e2e88ac563cfc9107c 100644
--- a/content/browser/frame_host/render_frame_host_manager.h
+++ b/content/browser/frame_host/render_frame_host_manager.h
@@ -18,6 +18,7 @@
#include "content/public/common/referrer.h"
struct FrameHostMsg_BeginNavigation_Params;
+struct FrameMsg_Navigate_Params;
namespace content {
class BrowserContext;
@@ -41,6 +42,7 @@ class RenderWidgetHostDelegate;
class RenderWidgetHostView;
class TestWebContents;
class WebUIImpl;
+struct NavigationBeforeCommitInfo;
// Manages RenderFrameHosts for a FrameTreeNode. This class acts as a state
// machine to make cross-process navigations in a frame possible.
@@ -55,6 +57,11 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver {
// There is additional complexity that some of the functions we need in
// WebContentsImpl are inherited and non-virtual. These are named with
// "RenderManager" so that the duplicate implementation of them will be clear.
+ //
+ // Functions and parameters whose description are prefixed by PlzNavigate are
+ // part of a navigation refactoring project, currently behind the
+ // enable-browser-side-navigation flag. The idea is to move the logic behind
+ // driving navigations from the renderer to the browser.
class CONTENT_EXPORT Delegate {
public:
// Initializes the given renderer if necessary and creates the view ID
@@ -191,6 +198,12 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver {
// could not be created.
RenderFrameHostImpl* Navigate(const NavigationEntryImpl& entry);
+ // PlzNavigate: sends a RequestNavigation IPC to the renderer to ask it to
+ // navigate. If no live renderer is present, then the navigation request will
+ // be sent directly to the ResourceDispatcherHost.
+ bool RequestNavigation(const NavigationEntryImpl& entry,
+ const FrameMsg_Navigate_Params& navigate_params);
+
// Instructs the various live views to stop. Called when the user directed the
// page to stop loading.
void Stop();
@@ -250,7 +263,6 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver {
// Helper method to create and initialize a RenderFrameHost. If |swapped_out|
// is true, it will be initially placed on the swapped out hosts list.
- // Otherwise, it will be used for a pending cross-site navigation.
// Returns the routing id of the *view* associated with the frame.
int CreateRenderFrame(SiteInstance* instance,
int opener_route_id,
@@ -311,14 +323,18 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver {
// of WebContentsImpl.
void ResetProxyHosts();
- // Used to start a navigation, part of browser-side navigation project.
- void OnBeginNavigation(const FrameHostMsg_BeginNavigation_Params& params);
+ // PlzNavigate: Used to start a navigation.
Charlie Reis 2014/08/08 20:25:29 Let's explain whether this happens before or after
clamy 2014/08/12 12:13:16 Done.
+ void OnBeginNavigation(const FrameHostMsg_BeginNavigation_Params& params,
+ const NavigationEntryImpl& entry);
// Returns the routing id for a RenderFrameHost or RenderFrameHostProxy
// that has the given SiteInstance and is associated with this
// RenderFrameHostManager. Returns MSG_ROUTING_NONE if none is found.
int GetRoutingIdForSiteInstance(SiteInstance* site_instance);
+ // PlzNavigate: Used to signal the commit of a navigation request.
Charlie Reis 2014/08/08 20:25:29 In retrospect, this comment isn't very clear, part
clamy 2014/08/12 12:13:16 Is the comment now clearer?
+ void CommitNavigation(const NavigationBeforeCommitInfo& info);
+
private:
friend class RenderFrameHostManagerTest;
friend class TestWebContents;
@@ -402,15 +418,27 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver {
const NavigationEntry* current_entry,
const NavigationEntryImpl* new_entry) const;
- // Returns an appropriate SiteInstance object for the given NavigationEntry,
- // possibly reusing the current SiteInstance. If --process-per-tab is used,
- // this is only called when ShouldSwapBrowsingInstancesForNavigation returns
- // true.
+ // Returns the SiteInstance to use for the navigation.
+ SiteInstance* GetSiteInstanceForNavigation(const NavigationEntryImpl& entry);
+
+ // Helper function that returns an appropriate SiteInstance object for the
+ // given NavigationEntry, possibly reusing the current SiteInstance. If
+ // --process-per-tab is used, this is only called when
+ // ShouldSwapBrowsingInstancesForNavigation returns true. Caller should use
+ // GetSiteInstanceForNavigation.
SiteInstance* GetSiteInstanceForEntry(
const NavigationEntryImpl& entry,
SiteInstance* current_instance,
bool force_browsing_instance_swap);
+ // Creates a new RenderFrameHostImpl for the |new_instance| while respecting
+ // the opener route if needed and stores it in pending_render_frame_host_.
+ // Also returns a pointer to the newly created RFH.
+ RenderFrameHostImpl* CreateRenderFrameHostForNewSiteInstance(
+ SiteInstance* old_instance,
+ SiteInstance* new_instance,
+ bool is_main_frame);
+
// Creates a RenderFrameHost and corresponding RenderViewHost if necessary.
scoped_ptr<RenderFrameHostImpl> CreateRenderFrameHost(SiteInstance* instance,
int view_routing_id,
@@ -434,6 +462,11 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver {
// above.
bool InitRenderFrame(RenderFrameHost* render_frame_host);
+ // Initializes |dest_render_frame_host| and |render_frame_host_| if necessary
+ // before navigating.
+ bool InitRenderFrameHostsBeforeNavigation(
+ RenderFrameHostImpl* dest_render_frame_host);
+
// Sets the pending RenderFrameHost/WebUI to be the active one. Note that this
// doesn't require the pending render_frame_host_ pointer to be non-NULL,
// since there could be Web UI switching as well. Call this for every commit.
@@ -525,7 +558,8 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver {
NotificationRegistrar registrar_;
- // Owns a navigation request that originated in that frame until it commits.
+ // PlzNavigate: Owns a navigation request that originated in that frame until
+ // it commits.
scoped_ptr<NavigationRequest> navigation_request_;
base::WeakPtrFactory<RenderFrameHostManager> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698