| Index: content/browser/frame_host/render_view_host_manager.h
|
| diff --git a/content/browser/frame_host/render_view_host_manager.h b/content/browser/frame_host/render_view_host_manager.h
|
| index 377758f882843a67510a74187f12c1a07910826e..6f70d6d1658a4576dfc3142bc0c8e81c049d3e3a 100644
|
| --- a/content/browser/frame_host/render_view_host_manager.h
|
| +++ b/content/browser/frame_host/render_view_host_manager.h
|
| @@ -19,10 +19,12 @@
|
|
|
| namespace content {
|
| class BrowserContext;
|
| +class FrameTreeNode;
|
| class InterstitialPageImpl;
|
| class NavigationControllerImpl;
|
| class NavigationEntry;
|
| class NavigationEntryImpl;
|
| +class RenderFrameHostImpl;
|
| class RenderViewHost;
|
| class RenderViewHostImpl;
|
| class RenderViewHostManagerTest;
|
| @@ -114,6 +116,7 @@ class CONTENT_EXPORT RenderViewHostManager
|
| //
|
| // You must call Init() before using this class.
|
| RenderViewHostManager(
|
| + FrameTreeNode* frame_tree_node,
|
| RenderViewHostDelegate* render_view_delegate,
|
| RenderWidgetHostDelegate* render_widget_delegate,
|
| Delegate* delegate);
|
| @@ -130,14 +133,20 @@ class CONTENT_EXPORT RenderViewHostManager
|
| // This will be non-NULL between Init() and Shutdown(). You may want to NULL
|
| // check it in many cases, however. Windows can send us messages during the
|
| // destruction process after it has been shut down.
|
| + // TODO(creis): Change to RenderFrameHostImpl.
|
| RenderViewHostImpl* current_host() const;
|
| + RenderFrameHostImpl* current_frame() const {
|
| + return render_frame_host_;
|
| + }
|
|
|
| // Returns the view associated with the current RenderViewHost, or NULL if
|
| // there is no current one.
|
| RenderWidgetHostView* GetRenderWidgetHostView() const;
|
|
|
| // Returns the pending render view host, or NULL if there is no pending one.
|
| + // TODO(creis): Change to RenderFrameHostImpl.
|
| RenderViewHostImpl* pending_render_view_host() const;
|
| + RenderFrameHostImpl* pending_render_frame_host() const;
|
|
|
| // Returns the current committed Web UI or NULL if none applies.
|
| WebUIImpl* web_ui() const { return web_ui_.get(); }
|
| @@ -176,6 +185,10 @@ class CONTENT_EXPORT RenderViewHostManager
|
| // network response and allow the pending RenderViewHost to commit.
|
| void SwappedOut(RenderViewHost* render_view_host);
|
|
|
| + // The RenderFrameHost has been swapped out, so we should resume the pending
|
| + // network response and allow the pending RenderFrameHost to commit.
|
| + void SwappedOutFrame(RenderFrameHostImpl* render_frame_host);
|
| +
|
| // Called when a renderer's main frame navigates.
|
| void DidNavigateMainFrame(RenderViewHost* render_view_host);
|
|
|
| @@ -185,10 +198,10 @@ class CONTENT_EXPORT RenderViewHostManager
|
| // Helper method to create a RenderViewHost. 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.
|
| - int CreateRenderView(SiteInstance* instance,
|
| - int opener_route_id,
|
| - bool swapped_out,
|
| - bool hidden);
|
| + int CreateRenderFrame(SiteInstance* instance,
|
| + int opener_route_id,
|
| + bool swapped_out,
|
| + bool hidden);
|
|
|
| // Called when a provisional load on the given renderer is aborted.
|
| void RendererAbortedProvisionalLoad(RenderViewHost* render_view_host);
|
| @@ -234,12 +247,15 @@ class CONTENT_EXPORT RenderViewHostManager
|
| // Called when a RenderViewHost is about to be deleted.
|
| void RenderViewDeleted(RenderViewHost* rvh);
|
|
|
| - // Returns whether the given RenderViewHost is on the list of swapped out
|
| - // RenderViewHosts.
|
| - bool IsOnSwappedOutList(RenderViewHost* rvh) const;
|
| + // Returns whether the given RenderFrameHost is on the list of swapped out
|
| + // RenderFrameHosts.
|
| + bool IsRVHOnSwappedOutList(RenderViewHostImpl* rvh) const;
|
| + bool IsOnSwappedOutList(RenderFrameHostImpl* rfh) const;
|
|
|
| // Returns the swapped out RenderViewHost for the given SiteInstance, if any.
|
| - RenderViewHostImpl* GetSwappedOutRenderViewHost(SiteInstance* instance);
|
| + RenderViewHostImpl* GetSwappedOutRenderViewHost(SiteInstance* instance) const;
|
| + RenderFrameHostImpl* GetSwappedOutRenderFrameHost(
|
| + SiteInstance* instance) const;
|
|
|
| // Runs the unload handler in the current page, when we know that a pending
|
| // cross-process navigation is going to commit. We may initiate a transfer
|
| @@ -315,58 +331,69 @@ class CONTENT_EXPORT RenderViewHostManager
|
| SiteInstance* curr_instance);
|
|
|
| // Sets up the necessary state for a new RenderViewHost with the given opener.
|
| - bool InitRenderView(RenderViewHost* render_view_host, int opener_route_id);
|
| -
|
| - // Sets the pending RenderViewHost/WebUI to be the active one. Note that this
|
| - // doesn't require the pending render_view_host_ pointer to be non-NULL, since
|
| - // there could be Web UI switching as well. Call this for every commit.
|
| + // This also initializes the RenderView if necessary.
|
| + // TODO(creis): opener_route_id is currently for the RenderView but should be
|
| + // the RenderFrame, since frames can have openers.
|
| + bool InitRenderView(RenderViewHost* render_view_host,
|
| + int opener_route_id);
|
| +
|
| + // 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.
|
| void CommitPending();
|
|
|
| - // Shutdown all RenderViewHosts in a SiteInstance. This is called
|
| - // to shutdown views when all the views in a SiteInstance are
|
| - // confirmed to be swapped out.
|
| - void ShutdownRenderViewHostsInSiteInstance(int32 site_instance_id);
|
| + // Shutdown all RenderFrameHosts in a SiteInstance. This is called to shutdown
|
| + // frames when all the views in a SiteInstance are confirmed to be swapped
|
| + // out.
|
| + void ShutdownRenderFrameHostsInSiteInstance(int32 site_instance_id);
|
|
|
| // Helper method to terminate the pending RenderViewHost.
|
| void CancelPending();
|
|
|
| - RenderViewHostImpl* UpdateRendererStateForNavigate(
|
| + RenderFrameHostImpl* UpdateRendererStateForNavigate(
|
| const NavigationEntryImpl& entry);
|
|
|
| // Called when a renderer process is starting to close. We should not
|
| - // schedule new navigations in its swapped out RenderViewHosts after this.
|
| + // schedule new navigations in its swapped out RenderFrameHosts after this.
|
| void RendererProcessClosing(RenderProcessHost* render_process_host);
|
|
|
| + // For use in creating RenderFrameHosts.
|
| + // TODO(creis): Feels awkward to have pointers in both directions. Maybe use
|
| + // an ID here instead?
|
| + FrameTreeNode* frame_tree_node_;
|
| +
|
| // Our delegate, not owned by us. Guaranteed non-NULL.
|
| Delegate* delegate_;
|
|
|
| - // Whether a navigation requiring different RenderView's is pending. This is
|
| - // either cross-site request is (in the new process model), or when required
|
| - // for the view type (like view source versus not).
|
| + // Whether a navigation requiring different RenderFrames is pending. This is
|
| + // either for cross-site requests or when required for the view type (like
|
| + // WebUI).
|
| bool cross_navigation_pending_;
|
|
|
| - // Implemented by the owner of this class, these delegates are installed into
|
| + // Implemented by the owner of this class. These delegates are installed into
|
| // all the RenderViewHosts that we create.
|
| RenderViewHostDelegate* render_view_delegate_;
|
| RenderWidgetHostDelegate* render_widget_delegate_;
|
|
|
| - // Our RenderView host and its associated Web UI (if any, will be NULL for
|
| - // non-DOM-UI pages). This object is responsible for all communication with
|
| - // a child RenderView instance.
|
| - RenderViewHostImpl* render_view_host_;
|
| + // Our RenderFrameHost and its associated Web UI (if any, will be NULL for
|
| + // non-Web-UI pages). This object is responsible for all communication with
|
| + // a child RenderFrame instance.
|
| + // For now, RenderFrameHost keeps a RenderViewHost in its SiteInstance alive.
|
| + // Eventually, RenderViewHost will be replaced with a page context.
|
| + RenderFrameHostImpl* render_frame_host_;
|
| scoped_ptr<WebUIImpl> web_ui_;
|
|
|
| - // A RenderViewHost used to load a cross-site page. This remains hidden
|
| + // A RenderFrameHost used to load a cross-site page. This remains hidden
|
| // while a cross-site request is pending until it calls DidNavigate. It may
|
| // have an associated Web UI, in which case the Web UI pointer will be non-
|
| // NULL.
|
| //
|
| // The |pending_web_ui_| may be non-NULL even when the
|
| // |pending_render_view_host_| is NULL. This will happen when we're
|
| - // transitioning between two Web UI pages: the RVH won't be swapped, so the
|
| + // 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.
|
| - RenderViewHostImpl* pending_render_view_host_;
|
| + RenderFrameHostImpl* pending_render_frame_host_;
|
|
|
| // Tracks information about any current pending cross-process navigation.
|
| scoped_ptr<PendingNavigationParams> pending_nav_params_;
|
| @@ -378,10 +405,10 @@ class CONTENT_EXPORT RenderViewHostManager
|
| scoped_ptr<WebUIImpl> pending_web_ui_;
|
| base::WeakPtr<WebUIImpl> pending_and_current_web_ui_;
|
|
|
| - // A map of site instance ID to swapped out RenderViewHosts. This may include
|
| - // pending_render_view_host_ for navigations to existing entries.
|
| - typedef base::hash_map<int32, RenderViewHostImpl*> RenderViewHostMap;
|
| - RenderViewHostMap swapped_out_hosts_;
|
| + // A map of site instance ID to swapped out RenderFrameHosts. This may
|
| + // include pending_render_frame_host_ for navigations to existing entries.
|
| + typedef base::hash_map<int32, RenderFrameHostImpl*> RenderFrameHostMap;
|
| + RenderFrameHostMap swapped_out_hosts_;
|
|
|
| // The intersitial page currently shown if any, not own by this class
|
| // (the InterstitialPage is self-owned, it deletes itself when hidden).
|
|
|