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

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

Issue 30323002: [DRAFT] Create RenderFrameHostManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 1 month 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_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..e8fc3feb06fe3b7d339dd6196cd740655b88cccd 100644
--- a/content/browser/frame_host/render_view_host_manager.h
+++ b/content/browser/frame_host/render_view_host_manager.h
@@ -23,6 +23,7 @@ class InterstitialPageImpl;
class NavigationControllerImpl;
class NavigationEntry;
class NavigationEntryImpl;
+class RenderFrameHostImpl;
class RenderViewHost;
class RenderViewHostImpl;
class RenderViewHostManagerTest;
@@ -130,13 +131,18 @@ 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;
// Returns the current committed Web UI or NULL if none applies.
@@ -185,10 +191,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 +240,13 @@ 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 IsOnSwappedOutList(RenderFrameHostImpl* rfh) const;
// Returns the swapped out RenderViewHost for the given SiteInstance, if any.
RenderViewHostImpl* GetSwappedOutRenderViewHost(SiteInstance* instance);
+ RenderFrameHostImpl* GetSwappedOutRenderFrameHost(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
@@ -315,58 +322,64 @@ 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);
// 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 +391,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).
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/frame_host/render_view_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698