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 0fcb180954337def1462781c229008164f893aa7..63e9ad7688a7748f8ae3353d4e2f8e00c384fb38 100644 |
--- a/content/public/browser/render_frame_host.h |
+++ b/content/public/browser/render_frame_host.h |
@@ -36,6 +36,15 @@ 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 is associated with the frame identified by |
Charlie Reis
2015/12/10 07:20:20
nit: Returns the current RenderFrameHost associate
robwu
2015/12/10 16:39:29
Done.
|
+ // the given FrameTreeNode ID. The returned RenderFrameHost can be different |
Charlie Reis
2015/12/10 07:20:20
nit: The frame may change its current RenderFrameH
robwu
2015/12/10 16:39:29
Done.
|
+ // from the RenderFrameHost that returned the ID via GetFrameTreeNodeId(). |
+ // See the documentation at GetFrameTreeNodeId for more details. |
Charlie Reis
2015/12/10 07:20:20
nit: See GetFrameTreeNodeId for more details.
robwu
2015/12/10 16:39:29
Done.
|
+ // Use WebContents::FindFrameByFrameTreeNodeId to find a RenderFrameHost in |
+ // a specific WebContents. |
+ // Returns nullptr if the frame does not exist. |
+ static RenderFrameHost* FromFrameTreeNodeId(int frame_tree_node_id); |
+ |
#if defined(OS_ANDROID) |
// 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 |
@@ -67,6 +76,17 @@ class CONTENT_EXPORT RenderFrameHost : public IPC::Listener, |
// current RenderFrameHost. |
virtual RenderFrameHost* GetParent() = 0; |
+ // Returns the FrameTreeNode ID for this frame. This ID is browser-global and |
+ // uniquely identifies a frame that hosts content. The identifier is fixed at |
+ // the creation of the frame and stays constant for the lifetime of the frame. |
+ // When the frame is removed, the ID is not used again. |
+ // |
+ // A RenderFrameHost is tied to a process. Due to cross-process navigations, |
+ // the RenderFrameHost may have a shorter lifetime than a frame. Consequently, |
+ // the FrameTreeNode ID may refer to a different RenderFrameHost after a |
Charlie Reis
2015/12/10 07:20:20
nit: the same FrameTreeNode ID
robwu
2015/12/10 16:39:29
Done.
|
+ // navigation. |
+ 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 |