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 fddfd9c8de20f9fb2a815d40584b8d0cbfc21ee9..804fda4ab2edfb9758f85b3ce3657cc4268b0597 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; |
@@ -40,6 +41,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. |
@@ -54,6 +56,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 |
@@ -187,6 +194,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(); |
@@ -246,12 +259,15 @@ 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. |
+ // Else if |is_speculative| is true, then it will used as a speculatively |
+ // spawned renderer in the PlzNavigate navigation refactoring project. |
// 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, |
bool swapped_out, |
- bool hidden); |
+ bool hidden, |
+ bool is_speculative); |
// Sets the passed passed interstitial as the currently showing interstitial. |
// |interstitial_page| should be non NULL (use the remove_interstitial_page |
@@ -302,9 +318,12 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver { |
// of WebContentsImpl. |
void ResetProxyHosts(); |
- // Used to start a navigation, part of browser-side navigation project. |
+ // PlzNavigate: Used to start a navigation. |
void OnBeginNavigation(const FrameHostMsg_BeginNavigation_Params& params); |
+ // PlzNavigate: Used to signal the commit of a navigation request. |
+ void CommitNavigation(const NavigationBeforeCommitInfo& info); |
+ |
private: |
friend class RenderFrameHostManagerTest; |
friend class TestWebContents; |
@@ -394,6 +413,16 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver { |
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. |
+ // PlzNavigate: If |is_speculative| is true, then the newly created RFH will |
+ // be stored in speculative_render_frame_host_. |
+ RenderFrameHostImpl* CreateRenderFrameHostForNewSiteInstance( |
+ SiteInstance* old_instance, |
+ SiteInstance* new_instance, |
+ bool is_speculative); |
+ |
// Creates a RenderFrameHost and corresponding RenderViewHost if necessary. |
scoped_ptr<RenderFrameHostImpl> CreateRenderFrameHost(SiteInstance* instance, |
int view_routing_id, |
@@ -413,6 +442,14 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver { |
int proxy_routing_id, |
bool for_main_frame); |
+ // Initializes |dest_render_frame_host| and |render_frame_host_| if necessary |
+ // before navigating. |
+ bool InitRenderFrameHostsBeforeNavigation( |
+ RenderFrameHostImpl* dest_render_frame_host); |
+ |
+ // Returns the SiteInstance to use for the navigation. |
Charlie Reis
2014/07/30 23:37:33
I see-- this is a wrapper for GetSiteInstanceForEn
clamy
2014/08/05 11:52:44
Done.
|
+ SiteInstance* GetSiteInstanceForNavigation(const NavigationEntryImpl& entry); |
+ |
// 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. |
@@ -473,6 +510,9 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver { |
// transitioning between two Web UI pages: the RFH won't be swapped, so the |
// pending pointer will be unused, but there will be a pending Web UI |
// associated with the navigation. |
+ // |
+ // PlzNavigate: The pending_render_frame_host_ mechanism will not exist |
+ // anymore. Instead the speculative_render_frame_host_ may be used. |
scoped_ptr<RenderFrameHostImpl> pending_render_frame_host_; |
// Tracks information about any current pending cross-process navigation. |
@@ -482,6 +522,11 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver { |
// headers. |
scoped_ptr<GlobalRequestID> response_started_id_; |
+ // PlzNavigate: A RenderFrameHost speculatively created when receiving a |
+ // navigation request. It should be used or deleted when the current |
+ // navigation request commits. |
+ scoped_ptr<RenderFrameHostImpl> speculative_render_frame_host_; |
+ |
// If either of these is non-NULL, the pending navigation is to a chrome: |
// page. The scoped_ptr is used if pending_web_ui_ != web_ui_, the WeakPtr is |
// used for when they reference the same object. If either is non-NULL, the |
@@ -504,7 +549,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_; |