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

Side by Side 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: Nasko's nits (#30) Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_
6 #define CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ 6 #define CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 18 matching lines...) Expand all
29 class SiteInstance; 29 class SiteInstance;
30 30
31 // The interface provides a communication conduit with a frame in the renderer. 31 // The interface provides a communication conduit with a frame in the renderer.
32 class CONTENT_EXPORT RenderFrameHost : public IPC::Listener, 32 class CONTENT_EXPORT RenderFrameHost : public IPC::Listener,
33 public IPC::Sender { 33 public IPC::Sender {
34 public: 34 public:
35 // Returns the RenderFrameHost given its ID and the ID of its render process. 35 // Returns the RenderFrameHost given its ID and the ID of its render process.
36 // Returns nullptr if the IDs do not correspond to a live RenderFrameHost. 36 // Returns nullptr if the IDs do not correspond to a live RenderFrameHost.
37 static RenderFrameHost* FromID(int render_process_id, int render_frame_id); 37 static RenderFrameHost* FromID(int render_process_id, int render_frame_id);
38 38
39 // 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.
40 // 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.
41 // from the RenderFrameHost that returned the ID via GetFrameTreeNodeId().
42 // 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.
43 // Use WebContents::FindFrameByFrameTreeNodeId to find a RenderFrameHost in
44 // a specific WebContents.
45 // Returns nullptr if the frame does not exist.
46 static RenderFrameHost* FromFrameTreeNodeId(int frame_tree_node_id);
47
39 #if defined(OS_ANDROID) 48 #if defined(OS_ANDROID)
40 // Globally allows for injecting JavaScript into the main world. This feature 49 // Globally allows for injecting JavaScript into the main world. This feature
41 // is present only to support Android WebView and must not be used in other 50 // is present only to support Android WebView and must not be used in other
42 // configurations. 51 // configurations.
43 static void AllowInjectingJavaScriptForAndroidWebView(); 52 static void AllowInjectingJavaScriptForAndroidWebView();
44 #endif 53 #endif
45 54
46 // Returns a RenderFrameHost given its accessibility tree ID. 55 // Returns a RenderFrameHost given its accessibility tree ID.
47 static RenderFrameHost* FromAXTreeID(int ax_tree_id); 56 static RenderFrameHost* FromAXTreeID(int ax_tree_id);
48 57
(...skipping 11 matching lines...) Expand all
60 virtual SiteInstance* GetSiteInstance() = 0; 69 virtual SiteInstance* GetSiteInstance() = 0;
61 70
62 // Returns the process for this frame. 71 // Returns the process for this frame.
63 virtual RenderProcessHost* GetProcess() = 0; 72 virtual RenderProcessHost* GetProcess() = 0;
64 73
65 // Returns the current RenderFrameHost of the parent frame, or nullptr if 74 // Returns the current RenderFrameHost of the parent frame, or nullptr if
66 // there is no parent. The result may be in a different process than the 75 // there is no parent. The result may be in a different process than the
67 // current RenderFrameHost. 76 // current RenderFrameHost.
68 virtual RenderFrameHost* GetParent() = 0; 77 virtual RenderFrameHost* GetParent() = 0;
69 78
79 // Returns the FrameTreeNode ID for this frame. This ID is browser-global and
80 // uniquely identifies a frame that hosts content. The identifier is fixed at
81 // the creation of the frame and stays constant for the lifetime of the frame.
82 // When the frame is removed, the ID is not used again.
83 //
84 // A RenderFrameHost is tied to a process. Due to cross-process navigations,
85 // the RenderFrameHost may have a shorter lifetime than a frame. Consequently,
86 // 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.
87 // navigation.
88 virtual int GetFrameTreeNodeId() = 0;
89
70 // Returns the assigned name of the frame, the name of the iframe tag 90 // Returns the assigned name of the frame, the name of the iframe tag
71 // declaring it. For example, <iframe name="framename">[...]</iframe>. It is 91 // declaring it. For example, <iframe name="framename">[...]</iframe>. It is
72 // quite possible for a frame to have no name, in which case GetFrameName will 92 // quite possible for a frame to have no name, in which case GetFrameName will
73 // return an empty string. 93 // return an empty string.
74 virtual const std::string& GetFrameName() = 0; 94 virtual const std::string& GetFrameName() = 0;
75 95
76 // Returns true if the frame is out of process. 96 // Returns true if the frame is out of process.
77 virtual bool IsCrossProcessSubframe() = 0; 97 virtual bool IsCrossProcessSubframe() = 0;
78 98
79 // Returns the last committed URL of the frame. 99 // Returns the last committed URL of the frame.
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 188
169 private: 189 private:
170 // This interface should only be implemented inside content. 190 // This interface should only be implemented inside content.
171 friend class RenderFrameHostImpl; 191 friend class RenderFrameHostImpl;
172 RenderFrameHost() {} 192 RenderFrameHost() {}
173 }; 193 };
174 194
175 } // namespace content 195 } // namespace content
176 196
177 #endif // CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ 197 #endif // CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/public/browser/resource_request_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698