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

Unified Diff: content/browser/renderer_host/render_view_host_impl.h

Issue 30323002: [DRAFT] Create RenderFrameHostManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Misc fixes Created 7 years 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/renderer_host/render_view_host_impl.h
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
index 18c643f08ff70ff8809bdafa1c0dbff759791989..fc70d85827c2a3c670d4ce893da1b8fd589195d8 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -227,6 +227,14 @@ class CONTENT_EXPORT RenderViewHostImpl
delegate_ = d;
}
+ // Map renderer-specific frame IDs to browser-global FrameTreeNode IDs.
+ // TODO(creis): Call Unregister.
+ void RegisterFrameID(int64 frame_id, int64 frame_tree_node_id);
+ void UnregisterFrameID(int64 frame_id);
+ bool HasFrameID(int64 frame_id) const;
+ int64 GetFrameTreeNodeID(int64 frame_id);
+ int64 GetFrameIDForTesting(int64 frame_tree_node_id) const;
+
// Set up the RenderView child process. Virtual because it is overridden by
// TestRenderViewHost. If the |frame_name| parameter is non-empty, it is used
// as the name of the new top-level frame.
@@ -429,12 +437,6 @@ class CONTENT_EXPORT RenderViewHostImpl
is_subframe_ = is_subframe;
}
- // TODO(creis): Remove this when we replace frame IDs with RenderFrameHost
- // routing IDs.
- int64 main_frame_id() const {
- return main_frame_id_;
- }
-
// Set the opener to null in the renderer process.
void DisownOpener();
@@ -487,6 +489,7 @@ class CONTENT_EXPORT RenderViewHostImpl
//
// TODO(ajwong): Remove once RenderViewHost no longer owns the main frame
// RenderFrameHost.
+ // TODO(creis): Remove this in favor of FrameTree::ResetForMainFrameSwap.
void AttachToFrameTree();
// The following IPC handlers are public so RenderFrameHost can call them,
@@ -618,6 +621,8 @@ class CONTENT_EXPORT RenderViewHostImpl
FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, BasicRenderFrameHost);
FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, RoutingIdSane);
+ typedef base::hash_map<int64, int64> FrameIDMap;
+
// Sets whether this RenderViewHost is swapped out in favor of another,
// and clears any waiting state that is no longer relevant.
void SetSwappedOut(bool is_swapped_out);
@@ -632,6 +637,9 @@ class CONTENT_EXPORT RenderViewHostImpl
// over time.
scoped_refptr<SiteInstanceImpl> instance_;
+ // Map of renderer-specific frame IDs to browser-global FrameTreeNode IDs.
+ FrameIDMap frame_id_map_;
+
// true if we are currently waiting for a response for drag context
// information.
bool waiting_for_drag_context_response_;
@@ -666,13 +674,8 @@ class CONTENT_EXPORT RenderViewHostImpl
// different process from its parent page.
bool is_subframe_;
- // The frame id of the main (top level) frame. This value is set on the
- // initial navigation of a RenderView and reset when the RenderView's
- // process is terminated (in RenderProcessGone).
- // TODO(creis): Remove this when we switch to routing IDs for frames.
- int64 main_frame_id_;
-
// Routing ID for the main frame's RenderFrameHost.
+ // TODO(creis): Does this need to be updated on a crash?
int main_frame_routing_id_;
// If we were asked to RunModal, then this will hold the reply_msg that we
« no previous file with comments | « content/browser/loader/cross_site_resource_handler.cc ('k') | content/browser/renderer_host/render_view_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698