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

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

Issue 753173002: Preparation steps for adding speculative renderer creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address a new round of CR comments: renames, comments and minor changes. Created 6 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
« no previous file with comments | « content/browser/frame_host/frame_tree.cc ('k') | content/browser/frame_host/render_frame_host_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c40cac4db9e694ea8fe43b6cb7bbe78ca7336497..ae8d9f9ddc4ff6cd18c405da388ebe0e6334e09a 100644
--- a/content/browser/frame_host/render_frame_host_manager.h
+++ b/content/browser/frame_host/render_frame_host_manager.h
@@ -26,14 +26,13 @@ namespace content {
class BrowserContext;
class CrossProcessFrameConnector;
class CrossSiteTransferringRequest;
-class InterstitialPageImpl;
class FrameTreeNode;
+class InterstitialPageImpl;
class NavigationControllerImpl;
class NavigationEntry;
class NavigationEntryImpl;
class RenderFrameHost;
class RenderFrameHostDelegate;
-class RenderFrameHost;
class RenderFrameHostImpl;
class RenderFrameHostManagerTest;
class RenderFrameProxyHost;
@@ -148,7 +147,8 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver {
// Creates a WebUI object for the given URL if one applies. Ownership of the
// returned pointer will be passed to the caller. If no WebUI applies,
// returns NULL.
- virtual WebUIImpl* CreateWebUIForRenderManager(const GURL& url) = 0;
+ virtual scoped_ptr<WebUIImpl> CreateWebUIForRenderManager(
+ const GURL& url) = 0;
// Returns the navigation entry of the current navigation, or NULL if there
// is none.
@@ -231,10 +231,6 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver {
pending_and_current_web_ui_.get();
}
- // Sets the pending Web UI for the pending navigation, ensuring that the
- // bindings are appropriate compared to |bindings|.
- void SetPendingWebUI(const GURL& url, int bindings);
-
// Called when we want to instruct the renderer to navigate to the given
// navigation entry. It may create a new RenderFrameHost or re-use an existing
// one. The RenderFrameHost to navigate will be returned. Returns NULL if one
@@ -297,11 +293,22 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver {
// Called when a renderer sets its opener to null.
void DidDisownOpener(RenderFrameHost* render_frame_host);
- // Helper method to create and initialize a RenderFrameHost. If |flags|
- // has the CREATE_RF_SWAPPED_OUT bit set from the CreateRenderFrameFlags
- // enum, it will initially be placed on the swapped out hosts list.
- // Returns the routing id of the *view* associated with the frame.
- int CreateRenderFrame(SiteInstance* instance, int opener_route_id, int flags);
+ // Sets the pending Web UI for the pending navigation, ensuring that the
+ // bindings are appropriate compared to |bindings|.
+ void SetPendingWebUI(const GURL& url, int bindings);
+
+ // Creates and initializes a RenderFrameHost. The |web_ui| is an optional
+ // input parameter used to double check bindings when swapping back in a
+ // previously existing RenderFrameHost. If |flags| has the
+ // CREATE_RF_SWAPPED_OUT bit set from the CreateRenderFrameFlags enum, it will
+ // initially be placed on the swapped out hosts list. If |view_routing_id_ptr|
+ // is not nullptr it will be set to the routing id of the view associated with
+ // the frame.
+ scoped_ptr<RenderFrameHostImpl> CreateRenderFrame(SiteInstance* instance,
+ WebUIImpl* web_ui,
+ int opener_route_id,
+ int flags,
+ int* view_routing_id_ptr);
// Helper method to create and initialize a RenderFrameProxyHost and return
// its routing id.
@@ -401,6 +408,10 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver {
const GURL& new_effective_url,
bool new_is_view_source_mode) const;
+ // Creates a new Web UI, ensuring that the bindings are appropriate compared
+ // to |bindings|.
+ scoped_ptr<WebUIImpl> CreateWebUI(const GURL& url, int bindings);
+
// Returns true if it is safe to reuse the current WebUI when navigating from
// |current_entry| to |new_url|.
bool ShouldReuseWebUI(
@@ -435,12 +446,19 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver {
SiteInstance* current_instance,
NavigationEntry* current_entry);
- // Creates a new RenderFrameHostImpl for the |new_instance| while respecting
- // the opener route if needed and stores it in pending_render_frame_host_.
- void CreateRenderFrameHostForNewSiteInstance(
- SiteInstance* old_instance,
- SiteInstance* new_instance,
- bool is_main_frame);
+ // Creates a new RenderFrameHostImpl for the |new_instance| and assign it to
+ // |pending_render_frame_host_| while respecting the opener route if needed
+ // and stores it in pending_render_frame_host_.
+ void CreatePendingRenderFrameHost(SiteInstance* old_instance,
+ SiteInstance* new_instance,
+ bool is_main_frame);
+
+ // Ensure that we have created RFHs for the new RFH's opener chain if
+ // we are staying in the same BrowsingInstance. This allows the new RFH
+ // to send cross-process script calls to its opener(s). Returns the opener
+ // route ID to be used for the new RenderView to be created.
+ int CreateOpenerRenderViewsIfNeeded(SiteInstance* old_instance,
+ SiteInstance* new_instance);
// Creates a RenderFrameHost and corresponding RenderViewHost if necessary.
scoped_ptr<RenderFrameHostImpl> CreateRenderFrameHost(SiteInstance* instance,
@@ -474,6 +492,10 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver {
// deleted or put on the pending delete list during this call.
void SwapOutOldFrame(scoped_ptr<RenderFrameHostImpl> old_render_frame_host);
+ // Discards a RenderFrameHost that was never made active (for active ones
+ // SwapOutOldFrame is used instead).
+ void DiscardUnusedFrame(scoped_ptr<RenderFrameHostImpl> render_frame_host);
+
// Holds |render_frame_host| until it can be deleted when its swap out ACK
// arrives.
void MoveToPendingDeleteHosts(
« no previous file with comments | « content/browser/frame_host/frame_tree.cc ('k') | content/browser/frame_host/render_frame_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698