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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.h

Issue 2506183002: Make window.open() IPCs be frame-based (Closed)
Patch Set: Compile fix. Created 4 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_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 class StreamHandle; 94 class StreamHandle;
95 class TimeoutMonitor; 95 class TimeoutMonitor;
96 class WebBluetoothServiceImpl; 96 class WebBluetoothServiceImpl;
97 struct ContentSecurityPolicyHeader; 97 struct ContentSecurityPolicyHeader;
98 struct ContextMenuParams; 98 struct ContextMenuParams;
99 struct FileChooserParams; 99 struct FileChooserParams;
100 struct FrameOwnerProperties; 100 struct FrameOwnerProperties;
101 struct FileChooserParams; 101 struct FileChooserParams;
102 struct ResourceResponse; 102 struct ResourceResponse;
103 103
104 namespace mojom {
105 class CreateNewWindowParams;
106 }
107
104 class CONTENT_EXPORT RenderFrameHostImpl 108 class CONTENT_EXPORT RenderFrameHostImpl
105 : public RenderFrameHost, 109 : public RenderFrameHost,
106 NON_EXPORTED_BASE(public mojom::FrameHost), 110 NON_EXPORTED_BASE(public mojom::FrameHost),
107 public BrowserAccessibilityDelegate, 111 public BrowserAccessibilityDelegate,
108 public SiteInstanceImpl::Observer, 112 public SiteInstanceImpl::Observer,
109 public NON_EXPORTED_BASE( 113 public NON_EXPORTED_BASE(
110 service_manager::InterfaceFactory<media::mojom::InterfaceFactory>) { 114 service_manager::InterfaceFactory<media::mojom::InterfaceFactory>) {
111 public: 115 public:
112 using AXTreeSnapshotCallback = 116 using AXTreeSnapshotCallback =
113 base::Callback<void( 117 base::Callback<void(
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 // Tracks whether the RenderFrame for this RenderFrameHost has been created in 210 // Tracks whether the RenderFrame for this RenderFrameHost has been created in
207 // the renderer process. This is currently only used for subframes. 211 // the renderer process. This is currently only used for subframes.
208 // TODO(creis): Use this for main frames as well when RVH goes away. 212 // TODO(creis): Use this for main frames as well when RVH goes away.
209 void SetRenderFrameCreated(bool created); 213 void SetRenderFrameCreated(bool created);
210 214
211 // Called for renderer-created windows to resume requests from this frame, 215 // Called for renderer-created windows to resume requests from this frame,
212 // after they are blocked in RenderWidgetHelper::CreateNewWindow. 216 // after they are blocked in RenderWidgetHelper::CreateNewWindow.
213 void Init(); 217 void Init();
214 218
215 int routing_id() const { return routing_id_; } 219 int routing_id() const { return routing_id_; }
220
221 // Called when this frame has added a child. This is a continuation of an IPC
222 // that was partially handled on the IO thread (to allocate |new_routing_id|),
223 // and is forwarded here. The renderer has already been told to create a
224 // RenderFrame with |new_routing_id|.
216 void OnCreateChildFrame(int new_routing_id, 225 void OnCreateChildFrame(int new_routing_id,
217 blink::WebTreeScopeType scope, 226 blink::WebTreeScopeType scope,
218 const std::string& frame_name, 227 const std::string& frame_name,
219 const std::string& frame_unique_name, 228 const std::string& frame_unique_name,
220 blink::WebSandboxFlags sandbox_flags, 229 blink::WebSandboxFlags sandbox_flags,
221 const FrameOwnerProperties& frame_owner_properties); 230 const FrameOwnerProperties& frame_owner_properties);
222 231
232 // Called when this frame tries to open a new WebContents, e.g. via a script
233 // call to window.open(). The renderer has already been told to create
234 // RenderView/RenderFrames with the specified route ids, which were assigned
alexmos 2016/12/13 18:41:40 nit: s/RenderFrames/RenderFrame/. (just one Rende
ncarter (slow) 2016/12/15 00:33:16 Done.
235 // on the IO thread.
236 void OnCreateNewWindow(int32_t render_view_route_id,
237 int32_t main_frame_route_id,
238 int32_t main_frame_widget_route_id,
239 const mojom::CreateNewWindowParams& params,
240 SessionStorageNamespace* session_storage_namespace);
241
223 RenderViewHostImpl* render_view_host() { return render_view_host_; } 242 RenderViewHostImpl* render_view_host() { return render_view_host_; }
224 RenderFrameHostDelegate* delegate() { return delegate_; } 243 RenderFrameHostDelegate* delegate() { return delegate_; }
225 FrameTreeNode* frame_tree_node() { return frame_tree_node_; } 244 FrameTreeNode* frame_tree_node() { return frame_tree_node_; }
226 245
227 const GURL& last_committed_url() const { return last_committed_url_; } 246 const GURL& last_committed_url() const { return last_committed_url_; }
228 247
229 // Allows FrameTreeNode::SetCurrentURL to update this frame's last committed 248 // Allows FrameTreeNode::SetCurrentURL to update this frame's last committed
230 // URL. Do not call this directly, since we rely on SetCurrentURL to track 249 // URL. Do not call this directly, since we rely on SetCurrentURL to track
231 // whether a real load has committed or not. 250 // whether a real load has committed or not.
232 void set_last_committed_url(const GURL& url) { 251 void set_last_committed_url(const GURL& url) {
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 const std::set<std::string>& digests_of_uris_of_serialized_resources, 719 const std::set<std::string>& digests_of_uris_of_serialized_resources,
701 base::TimeDelta renderer_main_thread_time); 720 base::TimeDelta renderer_main_thread_time);
702 void OnSelectionChanged(const base::string16& text, 721 void OnSelectionChanged(const base::string16& text,
703 uint32_t offset, 722 uint32_t offset,
704 const gfx::Range& range); 723 const gfx::Range& range);
705 724
706 #if defined(USE_EXTERNAL_POPUP_MENU) 725 #if defined(USE_EXTERNAL_POPUP_MENU)
707 void OnShowPopup(const FrameHostMsg_ShowPopup_Params& params); 726 void OnShowPopup(const FrameHostMsg_ShowPopup_Params& params);
708 void OnHidePopup(); 727 void OnHidePopup();
709 #endif 728 #endif
729 void OnShowCreatedWindow(int pending_widget_routing_id,
730 WindowOpenDisposition disposition,
731 const gfx::Rect& initial_rect,
732 bool user_gesture);
710 733
711 // Registers Mojo interfaces that this frame host makes available. 734 // Registers Mojo interfaces that this frame host makes available.
712 void RegisterMojoInterfaces(); 735 void RegisterMojoInterfaces();
713 736
714 // Resets any waiting state of this RenderFrameHost that is no longer 737 // Resets any waiting state of this RenderFrameHost that is no longer
715 // relevant. 738 // relevant.
716 void ResetWaitingState(); 739 void ResetWaitingState();
717 740
718 // Returns whether the given URL is allowed to commit in the current process. 741 // Returns whether the given URL is allowed to commit in the current process.
719 // This is a more conservative check than RenderProcessHost::FilterURL, since 742 // This is a more conservative check than RenderProcessHost::FilterURL, since
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 remote_associated_interfaces_; 1104 remote_associated_interfaces_;
1082 // NOTE: This must be the last member. 1105 // NOTE: This must be the last member.
1083 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; 1106 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_;
1084 1107
1085 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); 1108 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl);
1086 }; 1109 };
1087 1110
1088 } // namespace content 1111 } // namespace content
1089 1112
1090 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 1113 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698