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

Unified Diff: content/public/browser/render_frame_host.h

Issue 1413543005: Use FrameTreeNode ID as frameId in extension APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improve port lifetime management, add tests Created 5 years, 2 months 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/public/browser/render_frame_host.h
diff --git a/content/public/browser/render_frame_host.h b/content/public/browser/render_frame_host.h
index 7e769cb154ad7754de70a7559025c733556dfd8f..26853765c8649e26c9a7ca835407ca53f5ad949f 100644
--- a/content/public/browser/render_frame_host.h
+++ b/content/public/browser/render_frame_host.h
@@ -35,6 +35,10 @@ class CONTENT_EXPORT RenderFrameHost : public IPC::Listener,
// Returns nullptr if the IDs do not correspond to a live RenderFrameHost.
static RenderFrameHost* FromID(int render_process_id, int render_frame_id);
+ // Returns the RenderFrameHost that hosts the frame identified by the given
+ // FrameTreeNode ID. Returns nullptr if not found.
+ static RenderFrameHost* FromFrameTreeNodeID(int frame_tree_node_id);
+
// Globally allows for injecting JavaScript into the main world. This feature
// is present only to support Android WebView and must not be used in other
// configurations.
@@ -64,6 +68,13 @@ class CONTENT_EXPORT RenderFrameHost : public IPC::Listener,
// current RenderFrameHost.
virtual RenderFrameHost* GetParent() = 0;
+ // Returns the RenderFrameHost for the given FrameTreeNode ID if it is the
Charlie Reis 2015/10/30 23:25:09 nit: the current RenderFrameHost (The same FrameTr
robwu 2015/11/02 19:08:34 Done.
+ // frame itself or a child of this frame.
Charlie Reis 2015/10/30 23:25:09 nit: or an immediate child (Is this what you inte
robwu 2015/10/31 00:10:45 My use case is finding a frame within a given tab,
robwu 2015/11/02 19:08:34 Done.
+ virtual RenderFrameHost* FindByFrameTreeNodeID(int frame_tree_node_id) = 0;
+
+ // Returns the FrameTreeNode ID for this frame.
+ virtual int GetFrameTreeNodeID() = 0;
+
// Returns the assigned name of the frame, the name of the iframe tag
// declaring it. For example, <iframe name="framename">[...]</iframe>. It is
// quite possible for a frame to have no name, in which case GetFrameName will

Powered by Google App Engine
This is Rietveld 408576698