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

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

Issue 2821473002: Service CreateNewWindow on the UI thread with a new mojo interface (Closed)
Patch Set: dcheng fixes + security exploit browsertest nerfing Created 3 years, 8 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 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 class WebBluetoothService; 76 class WebBluetoothService;
77 } 77 }
78 } 78 }
79 79
80 namespace gfx { 80 namespace gfx {
81 class Range; 81 class Range;
82 } 82 }
83 83
84 namespace content { 84 namespace content {
85 class AssociatedInterfaceProviderImpl; 85 class AssociatedInterfaceProviderImpl;
86 class AssociatedInterfaceRegistryImpl;
86 class FeaturePolicy; 87 class FeaturePolicy;
87 class FrameTree; 88 class FrameTree;
88 class FrameTreeNode; 89 class FrameTreeNode;
89 class MediaInterfaceProxy; 90 class MediaInterfaceProxy;
90 class NavigationHandleImpl; 91 class NavigationHandleImpl;
91 class PermissionServiceContext; 92 class PermissionServiceContext;
92 class RenderFrameHostDelegate; 93 class RenderFrameHostDelegate;
93 class RenderFrameProxyHost; 94 class RenderFrameProxyHost;
94 class RenderProcessHost; 95 class RenderProcessHost;
95 class RenderViewHostImpl; 96 class RenderViewHostImpl;
96 class RenderWidgetHostDelegate; 97 class RenderWidgetHostDelegate;
97 class RenderWidgetHostImpl; 98 class RenderWidgetHostImpl;
98 class RenderWidgetHostView; 99 class RenderWidgetHostView;
99 class RenderWidgetHostViewBase; 100 class RenderWidgetHostViewBase;
100 class ResourceRequestBody; 101 class ResourceRequestBody;
101 class StreamHandle; 102 class StreamHandle;
102 class TimeoutMonitor; 103 class TimeoutMonitor;
103 class WebBluetoothServiceImpl; 104 class WebBluetoothServiceImpl;
104 struct ContextMenuParams; 105 struct ContextMenuParams;
105 struct FileChooserParams; 106 struct FileChooserParams;
106 struct FrameOwnerProperties; 107 struct FrameOwnerProperties;
107 struct FileChooserParams; 108 struct FileChooserParams;
108 struct ResourceResponse; 109 struct ResourceResponse;
109 110
110 namespace mojom {
111 class CreateNewWindowParams;
112 }
113
114 class CONTENT_EXPORT RenderFrameHostImpl 111 class CONTENT_EXPORT RenderFrameHostImpl
115 : public RenderFrameHost, 112 : public RenderFrameHost,
116 public base::SupportsUserData, 113 public base::SupportsUserData,
117 NON_EXPORTED_BASE(public mojom::FrameHost), 114 NON_EXPORTED_BASE(public mojom::FrameHost),
115 NON_EXPORTED_BASE(public mojom::FrameHostIPC),
118 public BrowserAccessibilityDelegate, 116 public BrowserAccessibilityDelegate,
119 public SiteInstanceImpl::Observer, 117 public SiteInstanceImpl::Observer,
120 public NON_EXPORTED_BASE( 118 public NON_EXPORTED_BASE(
121 service_manager::InterfaceFactory<media::mojom::InterfaceFactory>), 119 service_manager::InterfaceFactory<media::mojom::InterfaceFactory>),
122 public CSPContext { 120 public CSPContext {
123 public: 121 public:
124 using AXTreeSnapshotCallback = 122 using AXTreeSnapshotCallback =
125 base::Callback<void( 123 base::Callback<void(
126 const ui::AXTreeUpdate&)>; 124 const ui::AXTreeUpdate&)>;
127 using SmartClipCallback = base::Callback<void(const base::string16& text, 125 using SmartClipCallback = base::Callback<void(const base::string16& text,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 // and is forwarded here. The renderer has already been told to create a 243 // and is forwarded here. The renderer has already been told to create a
246 // RenderFrame with |new_routing_id|. 244 // RenderFrame with |new_routing_id|.
247 void OnCreateChildFrame(int new_routing_id, 245 void OnCreateChildFrame(int new_routing_id,
248 blink::WebTreeScopeType scope, 246 blink::WebTreeScopeType scope,
249 const std::string& frame_name, 247 const std::string& frame_name,
250 const std::string& frame_unique_name, 248 const std::string& frame_unique_name,
251 blink::WebSandboxFlags sandbox_flags, 249 blink::WebSandboxFlags sandbox_flags,
252 const ParsedFeaturePolicyHeader& container_policy, 250 const ParsedFeaturePolicyHeader& container_policy,
253 const FrameOwnerProperties& frame_owner_properties); 251 const FrameOwnerProperties& frame_owner_properties);
254 252
255 // Called when this frame tries to open a new WebContents, e.g. via a script
256 // call to window.open(). The renderer has already been told to create the
257 // RenderView and RenderFrame with the specified route ids, which were
258 // assigned on the IO thread.
259 void OnCreateNewWindow(int32_t render_view_route_id,
260 int32_t main_frame_route_id,
261 int32_t main_frame_widget_route_id,
262 const mojom::CreateNewWindowParams& params,
263 SessionStorageNamespace* session_storage_namespace);
264
265 // Update this frame's last committed origin. 253 // Update this frame's last committed origin.
266 void SetLastCommittedOrigin(const url::Origin& origin); 254 void SetLastCommittedOrigin(const url::Origin& origin);
267 255
268 RenderViewHostImpl* render_view_host() { return render_view_host_; } 256 RenderViewHostImpl* render_view_host() { return render_view_host_; }
269 RenderFrameHostDelegate* delegate() { return delegate_; } 257 RenderFrameHostDelegate* delegate() { return delegate_; }
270 FrameTreeNode* frame_tree_node() { return frame_tree_node_; } 258 FrameTreeNode* frame_tree_node() { return frame_tree_node_; }
271 259
272 const GURL& last_committed_url() const { return last_committed_url_; } 260 const GURL& last_committed_url() const { return last_committed_url_; }
273 261
274 // Allows FrameTreeNode::SetCurrentURL to update this frame's last committed 262 // Allows FrameTreeNode::SetCurrentURL to update this frame's last committed
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 #if defined(OS_ANDROID) 777 #if defined(OS_ANDROID)
790 void OnNavigationHandledByEmbedder(); 778 void OnNavigationHandledByEmbedder();
791 void ForwardGetInterfaceToRenderFrame(const std::string& interface_name, 779 void ForwardGetInterfaceToRenderFrame(const std::string& interface_name,
792 mojo::ScopedMessagePipeHandle pipe); 780 mojo::ScopedMessagePipeHandle pipe);
793 #endif 781 #endif
794 void OnShowCreatedWindow(int pending_widget_routing_id, 782 void OnShowCreatedWindow(int pending_widget_routing_id,
795 WindowOpenDisposition disposition, 783 WindowOpenDisposition disposition,
796 const gfx::Rect& initial_rect, 784 const gfx::Rect& initial_rect,
797 bool user_gesture); 785 bool user_gesture);
798 786
787 // mojom::FrameHostIPC
788 void CreateNewWindow(mojom::CreateNewWindowParamsPtr params,
789 const CreateNewWindowCallback& callback) override;
790
791 void RunCreateWindowCompleteCallback(const CreateNewWindowCallback& callback,
792 mojom::CreateNewWindowReplyPtr reply,
793 int render_view_route_id,
794 int main_frame_route_id,
795 int main_frame_widget_route_id,
796 int cloned_session_storage_namespace_id);
797
799 // Registers Mojo interfaces that this frame host makes available. 798 // Registers Mojo interfaces that this frame host makes available.
800 void RegisterMojoInterfaces(); 799 void RegisterMojoInterfaces();
801 800
802 // Resets any waiting state of this RenderFrameHost that is no longer 801 // Resets any waiting state of this RenderFrameHost that is no longer
803 // relevant. 802 // relevant.
804 void ResetWaitingState(); 803 void ResetWaitingState();
805 804
806 // Returns whether the given origin is allowed to commit in the current 805 // Returns whether the given origin is allowed to commit in the current
807 // RenderFrameHost. The |url| is used to ensure it matches the origin in cases 806 // RenderFrameHost. The |url| is used to ensure it matches the origin in cases
808 // where it is applicable. This is a more conservative check than 807 // where it is applicable. This is a more conservative check than
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 // such as for a new subframe navigation in a different frame. Tracking this 1035 // such as for a new subframe navigation in a different frame. Tracking this
1037 // allows us to send things like title and state updates to the latest 1036 // allows us to send things like title and state updates to the latest
1038 // relevant NavigationEntry. 1037 // relevant NavigationEntry.
1039 int nav_entry_id_; 1038 int nav_entry_id_;
1040 1039
1041 // Used to swap out or shut down this RFH when the unload event is taking too 1040 // Used to swap out or shut down this RFH when the unload event is taking too
1042 // long to execute, depending on the number of active frames in the 1041 // long to execute, depending on the number of active frames in the
1043 // SiteInstance. May be null in tests. 1042 // SiteInstance. May be null in tests.
1044 std::unique_ptr<TimeoutMonitor> swapout_event_monitor_timeout_; 1043 std::unique_ptr<TimeoutMonitor> swapout_event_monitor_timeout_;
1045 1044
1045 std::unique_ptr<AssociatedInterfaceRegistryImpl> associated_registry_;
1046
1046 std::unique_ptr<service_manager::InterfaceRegistry> interface_registry_; 1047 std::unique_ptr<service_manager::InterfaceRegistry> interface_registry_;
1047 std::unique_ptr<service_manager::InterfaceProvider> remote_interfaces_; 1048 std::unique_ptr<service_manager::InterfaceProvider> remote_interfaces_;
1048 1049
1049 service_manager::ServiceInfo browser_info_; 1050 service_manager::ServiceInfo browser_info_;
1050 service_manager::ServiceInfo renderer_info_; 1051 service_manager::ServiceInfo renderer_info_;
1051 1052
1052 int on_connect_handler_id_ = 0; 1053 int on_connect_handler_id_ = 0;
1053 1054
1054 std::list<std::unique_ptr<WebBluetoothServiceImpl>> web_bluetooth_services_; 1055 std::list<std::unique_ptr<WebBluetoothServiceImpl>> web_bluetooth_services_;
1055 1056
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 1124
1124 // If true, then the RenderFrame has selected text. 1125 // If true, then the RenderFrame has selected text.
1125 bool has_selection_; 1126 bool has_selection_;
1126 1127
1127 // PlzNavigate: The Previews state of the last navigation. This is used during 1128 // PlzNavigate: The Previews state of the last navigation. This is used during
1128 // history navigation of subframes to ensure that subframes navigate with the 1129 // history navigation of subframes to ensure that subframes navigate with the
1129 // same Previews status as the top-level frame. 1130 // same Previews status as the top-level frame.
1130 PreviewsState last_navigation_previews_state_; 1131 PreviewsState last_navigation_previews_state_;
1131 1132
1132 mojo::Binding<mojom::FrameHost> frame_host_binding_; 1133 mojo::Binding<mojom::FrameHost> frame_host_binding_;
1134 mojo::AssociatedBinding<mojom::FrameHostIPC> frame_host_associated_binding_;
nasko 2017/04/20 18:58:41 nit: If this interface stays around, why not inclu
1133 mojom::FramePtr frame_; 1135 mojom::FramePtr frame_;
1134 mojom::FrameBindingsControlAssociatedPtr frame_bindings_control_; 1136 mojom::FrameBindingsControlAssociatedPtr frame_bindings_control_;
1135 1137
1136 // If this is true then this object was created in response to a renderer 1138 // If this is true then this object was created in response to a renderer
1137 // initiated request. Init() will be called, and until then navigation 1139 // initiated request. Init() will be called, and until then navigation
1138 // requests should be queued. 1140 // requests should be queued.
1139 bool waiting_for_init_; 1141 bool waiting_for_init_;
1140 1142
1141 // If true then this frame's document has a focused element which is editable. 1143 // If true then this frame's document has a focused element which is editable.
1142 bool has_focused_editable_element_; 1144 bool has_focused_editable_element_;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 1182
1181 // NOTE: This must be the last member. 1183 // NOTE: This must be the last member.
1182 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; 1184 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_;
1183 1185
1184 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); 1186 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl);
1185 }; 1187 };
1186 1188
1187 } // namespace content 1189 } // namespace content
1188 1190
1189 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 1191 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698