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

Side by Side Diff: content/public/browser/web_contents.h

Issue 2856653004: Require a process ID when looking up RFHs by FrameTreeNode ID. (Closed)
Patch Set: Remove GetParentFtnId. Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_WEB_CONTENTS_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 // these may change over time. 238 // these may change over time.
239 virtual RenderProcessHost* GetRenderProcessHost() const = 0; 239 virtual RenderProcessHost* GetRenderProcessHost() const = 0;
240 240
241 // Returns the main frame for the currently active view. 241 // Returns the main frame for the currently active view.
242 virtual RenderFrameHost* GetMainFrame() = 0; 242 virtual RenderFrameHost* GetMainFrame() = 0;
243 243
244 // Returns the focused frame for the currently active view. 244 // Returns the focused frame for the currently active view.
245 virtual RenderFrameHost* GetFocusedFrame() = 0; 245 virtual RenderFrameHost* GetFocusedFrame() = 0;
246 246
247 // Returns the current RenderFrameHost for a given FrameTreeNode ID if it is 247 // Returns the current RenderFrameHost for a given FrameTreeNode ID if it is
248 // part of this tab. See RenderFrameHost::GetFrameTreeNodeId for documentation 248 // part of this tab. Returns nullptr if |process_id| does not match the
dmazzoni 2017/05/01 22:56:37 Is there a better term you can use than "tab"? Tha
Charlie Reis 2017/05/01 23:12:35 Thanks. I changed it to "frame tree," explicitly
249 // on this ID. 249 // current RenderFrameHost's process ID, to avoid security bugs where callers
250 virtual RenderFrameHost* FindFrameByFrameTreeNodeId( 250 // do not realize a cross-process navigation (and thus privilege change) has
251 // taken place. See RenderFrameHost::GetFrameTreeNodeId for documentation on
252 // frame_tree_node_id.
253 virtual RenderFrameHost* FindFrameByFrameTreeNodeId(int frame_tree_node_id,
254 int process_id) = 0;
255
256 // NOTE: This is generally unsafe to use. Use FindFrameByFrameTreeNodeId
257 // instead.
258 // Returns the current RenderFrameHost for a given FrameTreeNode ID if it is
259 // part of this tab. This may not match the caller's expectation, if a
260 // cross-process navigation (and thus privilege change) has taken place.
261 // See RenderFrameHost::GetFrameTreeNodeId for documentation on this ID.
262 virtual RenderFrameHost* UnsafeFindFrameByFrameTreeNodeId(
251 int frame_tree_node_id) = 0; 263 int frame_tree_node_id) = 0;
252 264
253 // Calls |on_frame| for each frame in the currently active view. 265 // Calls |on_frame| for each frame in the currently active view.
254 // Note: The RenderFrameHost parameter is not guaranteed to have a live 266 // Note: The RenderFrameHost parameter is not guaranteed to have a live
255 // RenderFrame counterpart in the renderer process. Callbacks should check 267 // RenderFrame counterpart in the renderer process. Callbacks should check
256 // IsRenderFrameLive, as sending IPC messages to it in this case will fail 268 // IsRenderFrameLive, as sending IPC messages to it in this case will fail
257 // silently. 269 // silently.
258 virtual void ForEachFrame( 270 virtual void ForEachFrame(
259 const base::Callback<void(RenderFrameHost*)>& on_frame) = 0; 271 const base::Callback<void(RenderFrameHost*)>& on_frame) = 0;
260 272
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 806
795 private: 807 private:
796 // This interface should only be implemented inside content. 808 // This interface should only be implemented inside content.
797 friend class WebContentsImpl; 809 friend class WebContentsImpl;
798 WebContents() {} 810 WebContents() {}
799 }; 811 };
800 812
801 } // namespace content 813 } // namespace content
802 814
803 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ 815 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_
OLDNEW
« no previous file with comments | « content/public/browser/navigation_handle.h ('k') | extensions/browser/extension_api_frame_id_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698