Index: trunk/src/content/browser/frame_host/render_frame_host_manager.h |
=================================================================== |
--- trunk/src/content/browser/frame_host/render_frame_host_manager.h (revision 241158) |
+++ trunk/src/content/browser/frame_host/render_frame_host_manager.h (working copy) |
@@ -20,12 +20,10 @@ |
namespace content { |
class BrowserContext; |
class InterstitialPageImpl; |
-class FrameTreeNode; |
class NavigationControllerImpl; |
class NavigationEntry; |
class NavigationEntryImpl; |
class RenderFrameHostDelegate; |
-class RenderFrameHostImpl; |
class RenderFrameHostManagerTest; |
class RenderViewHost; |
class RenderViewHostImpl; |
@@ -116,7 +114,6 @@ |
// |
// You must call Init() before using this class. |
RenderFrameHostManager( |
- FrameTreeNode* frame_tree_node, |
RenderFrameHostDelegate* render_frame_delegate, |
RenderViewHostDelegate* render_view_delegate, |
RenderWidgetHostDelegate* render_widget_delegate, |
@@ -126,31 +123,21 @@ |
// For arguments, see WebContentsImpl constructor. |
void Init(BrowserContext* browser_context, |
SiteInstance* site_instance, |
- int view_routing_id, |
- int frame_routing_id); |
+ int routing_id, |
+ int main_frame_routing_id); |
- // Returns the currently active RenderFrameHost. |
+ // Returns the currently active RenderViewHost. |
// |
// 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. |
- RenderFrameHostImpl* current_frame_host() const { |
- return render_frame_host_; |
- } |
- |
- // TODO(creis): Remove this when we no longer use RVH for navigation. |
RenderViewHostImpl* current_host() const; |
// Returns the view associated with the current RenderViewHost, or NULL if |
// there is no current one. |
RenderWidgetHostView* GetRenderWidgetHostView() const; |
- // Returns the pending RenderFrameHost, or NULL if there is no pending one. |
- RenderFrameHostImpl* pending_frame_host() const { |
- return pending_render_frame_host_; |
- } |
- |
- // TODO(creis): Remove this when we no longer use RVH for navigation. |
+ // Returns the pending render view host, or NULL if there is no pending one. |
RenderViewHostImpl* pending_render_view_host() const; |
// Returns the current committed Web UI or NULL if none applies. |
@@ -196,13 +183,13 @@ |
// Called when a renderer sets its opener to null. |
void DidDisownOpener(RenderViewHost* render_view_host); |
- // 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. |
- int CreateRenderFrame(SiteInstance* instance, |
- int opener_route_id, |
- bool swapped_out, |
- bool hidden); |
+ // 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); |
// Called when a provisional load on the given renderer is aborted. |
void RendererAbortedProvisionalLoad(RenderViewHost* render_view_host); |
@@ -249,16 +236,12 @@ |
// Called when a RenderViewHost is about to be deleted. |
void RenderViewDeleted(RenderViewHost* rvh); |
- // Returns whether the given RenderFrameHost (or its associated |
- // RenderViewHost) is on the list of swapped out RenderFrameHosts. |
- bool IsRVHOnSwappedOutList(RenderViewHostImpl* rvh) const; |
- bool IsOnSwappedOutList(RenderFrameHostImpl* rfh) const; |
+ // Returns whether the given RenderViewHost is on the list of swapped out |
+ // RenderViewHosts. |
+ bool IsOnSwappedOutList(RenderViewHost* rvh) const; |
- // Returns the swapped out RenderViewHost or RenderFrameHost for the given |
- // SiteInstance, if any. |
- RenderViewHostImpl* GetSwappedOutRenderViewHost(SiteInstance* instance) const; |
- RenderFrameHostImpl* GetSwappedOutRenderFrameHost( |
- SiteInstance* instance) const; |
+ // Returns the swapped out RenderViewHost for the given SiteInstance, if any. |
+ RenderViewHostImpl* GetSwappedOutRenderViewHost(SiteInstance* instance); |
// 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 |
@@ -270,7 +253,7 @@ |
friend class TestWebContents; |
// Tracks information about a navigation while a cross-process transition is |
- // in progress, in case we need to transfer it to a new RenderFrameHost. |
+ // in progress, in case we need to transfer it to a new RenderViewHost. |
struct PendingNavigationParams { |
PendingNavigationParams(); |
PendingNavigationParams(const GlobalRequestID& global_request_id, |
@@ -312,11 +295,6 @@ |
bool should_replace_current_entry; |
}; |
- // Used with FrameTree::ForEach to erase inactive RenderFrameHosts from a |
- // FrameTreeNode's RenderFrameHostManager. |
- static bool ClearSwappedOutRFHsInSiteInstance(int32 site_instance_id, |
- FrameTreeNode* node); |
- |
// Returns whether this tab should transition to a new renderer for |
// cross-site URLs. Enabled unless we see the --process-per-tab command line |
// switch. Can be overridden in unit tests. |
@@ -347,76 +325,60 @@ |
SiteInstance* current_instance, |
bool force_browsing_instance_swap); |
- // Creates a RenderFrameHost and corresponding RenderViewHost if necessary. |
- RenderFrameHostImpl* CreateRenderFrameHost(SiteInstance* instance, |
- int view_routing_id, |
- int frame_routing_id, |
- bool swapped_out, |
- bool hidden); |
- |
- // Sets up the necessary state for a new RenderViewHost with the given opener, |
- // if necessary. Returns early if the RenderViewHost has already been |
- // initialized for another RenderFrameHost. |
- // TODO(creis): opener_route_id is currently for the RenderViewHost but should |
- // be for the RenderFrame, since frames can have openers. |
+ // 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 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. |
+ // 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. |
void CommitPending(); |
- // Shutdown all RenderFrameHosts in a SiteInstance. This is called to shutdown |
- // frames when all the frames in a SiteInstance are confirmed to be swapped |
- // out. |
- void ShutdownRenderFrameHostsInSiteInstance(int32 site_instance_id); |
+ // 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); |
// Helper method to terminate the pending RenderViewHost. |
void CancelPending(); |
- RenderFrameHostImpl* UpdateRendererStateForNavigate( |
+ RenderViewHostImpl* UpdateRendererStateForNavigate( |
const NavigationEntryImpl& entry); |
// Called when a renderer process is starting to close. We should not |
- // schedule new navigations in its swapped out RenderFrameHosts after this. |
+ // schedule new navigations in its swapped out RenderViewHosts after this. |
void RendererProcessClosing(RenderProcessHost* render_process_host); |
- // For use in creating RenderFrameHosts. |
- FrameTreeNode* frame_tree_node_; |
- |
// Our delegate, not owned by us. Guaranteed non-NULL. |
Delegate* delegate_; |
- // Whether a navigation requiring different RenderFrameHosts is pending. This |
- // is either for cross-site requests or when required for the process type |
- // (like WebUI). |
+ // 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). |
bool cross_navigation_pending_; |
- // Implemented by the owner of this class. These delegates are installed into |
- // all the RenderFrameHosts that we create. |
+ // Implemented by the owner of this class, these delegates are installed into |
+ // all the RenderViewHosts that we create. |
RenderFrameHostDelegate* render_frame_delegate_; |
RenderViewHostDelegate* render_view_delegate_; |
RenderWidgetHostDelegate* render_widget_delegate_; |
- // Our RenderFrameHost and its associated Web UI (if any, will be NULL for |
- // non-WebUI 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_; |
+ // 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_; |
scoped_ptr<WebUIImpl> web_ui_; |
- // A RenderFrameHost used to load a cross-site page. This remains hidden |
+ // A RenderViewHost 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_frame_host_| is NULL. This will happen when we're |
- // transitioning between two Web UI pages: the RFH won't be swapped, so 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 |
// pending pointer will be unused, but there will be a pending Web UI |
// associated with the navigation. |
- RenderFrameHostImpl* pending_render_frame_host_; |
+ RenderViewHostImpl* pending_render_view_host_; |
// Tracks information about any current pending cross-process navigation. |
scoped_ptr<PendingNavigationParams> pending_nav_params_; |
@@ -428,10 +390,10 @@ |
scoped_ptr<WebUIImpl> pending_web_ui_; |
base::WeakPtr<WebUIImpl> pending_and_current_web_ui_; |
- // 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_; |
+ // 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_; |
// The intersitial page currently shown if any, not own by this class |
// (the InterstitialPage is self-owned, it deletes itself when hidden). |