Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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; |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 108 struct ResourceResponse; | 109 struct ResourceResponse; |
| 109 | 110 |
| 110 namespace mojom { | 111 namespace mojom { |
| 111 class CreateNewWindowParams; | 112 class CreateNewWindowParams; |
| 112 } | 113 } |
| 113 | 114 |
| 114 class CONTENT_EXPORT RenderFrameHostImpl | 115 class CONTENT_EXPORT RenderFrameHostImpl |
| 115 : public RenderFrameHost, | 116 : public RenderFrameHost, |
| 116 public base::SupportsUserData, | 117 public base::SupportsUserData, |
| 117 NON_EXPORTED_BASE(public mojom::FrameHost), | 118 NON_EXPORTED_BASE(public mojom::FrameHost), |
| 119 NON_EXPORTED_BASE(public mojom::FrameHostIPC), | |
| 118 public BrowserAccessibilityDelegate, | 120 public BrowserAccessibilityDelegate, |
| 119 public SiteInstanceImpl::Observer, | 121 public SiteInstanceImpl::Observer, |
| 120 public NON_EXPORTED_BASE( | 122 public NON_EXPORTED_BASE( |
| 121 service_manager::InterfaceFactory<media::mojom::InterfaceFactory>), | 123 service_manager::InterfaceFactory<media::mojom::InterfaceFactory>), |
| 122 public CSPContext { | 124 public CSPContext { |
| 123 public: | 125 public: |
| 124 using AXTreeSnapshotCallback = | 126 using AXTreeSnapshotCallback = |
| 125 base::Callback<void( | 127 base::Callback<void( |
| 126 const ui::AXTreeUpdate&)>; | 128 const ui::AXTreeUpdate&)>; |
| 127 using SmartClipCallback = base::Callback<void(const base::string16& text, | 129 using SmartClipCallback = base::Callback<void(const base::string16& text, |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 247 void OnCreateChildFrame(int new_routing_id, | 249 void OnCreateChildFrame(int new_routing_id, |
| 248 blink::WebTreeScopeType scope, | 250 blink::WebTreeScopeType scope, |
| 249 const std::string& frame_name, | 251 const std::string& frame_name, |
| 250 const std::string& frame_unique_name, | 252 const std::string& frame_unique_name, |
| 251 blink::WebSandboxFlags sandbox_flags, | 253 blink::WebSandboxFlags sandbox_flags, |
| 252 const FrameOwnerProperties& frame_owner_properties); | 254 const FrameOwnerProperties& frame_owner_properties); |
| 253 | 255 |
| 254 // Called when this frame tries to open a new WebContents, e.g. via a script | 256 // Called when this frame tries to open a new WebContents, e.g. via a script |
| 255 // call to window.open(). The renderer has already been told to create the | 257 // call to window.open(). The renderer has already been told to create the |
| 256 // RenderView and RenderFrame with the specified route ids, which were | 258 // RenderView and RenderFrame with the specified route ids, which were |
| 257 // assigned on the IO thread. | 259 // assigned on the IO thread. |
|
alexmos
2017/04/19 22:28:03
nit: update this comment.
Other random thoughts
Charlie Harrison
2017/04/20 14:02:23
Good point, I think I slightly just prefer inlinin
| |
| 258 void OnCreateNewWindow(int32_t render_view_route_id, | 260 void OnCreateNewWindow(int32_t render_view_route_id, |
| 259 int32_t main_frame_route_id, | 261 int32_t main_frame_route_id, |
| 260 int32_t main_frame_widget_route_id, | 262 int32_t main_frame_widget_route_id, |
| 261 const mojom::CreateNewWindowParams& params, | 263 const mojom::CreateNewWindowParams& params, |
| 262 SessionStorageNamespace* session_storage_namespace); | 264 SessionStorageNamespace* session_storage_namespace); |
| 263 | 265 |
| 264 // Update this frame's last committed origin. | 266 // Update this frame's last committed origin. |
| 265 void SetLastCommittedOrigin(const url::Origin& origin); | 267 void SetLastCommittedOrigin(const url::Origin& origin); |
| 266 | 268 |
| 267 RenderViewHostImpl* render_view_host() { return render_view_host_; } | 269 RenderViewHostImpl* render_view_host() { return render_view_host_; } |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 786 #if defined(OS_ANDROID) | 788 #if defined(OS_ANDROID) |
| 787 void OnNavigationHandledByEmbedder(); | 789 void OnNavigationHandledByEmbedder(); |
| 788 void ForwardGetInterfaceToRenderFrame(const std::string& interface_name, | 790 void ForwardGetInterfaceToRenderFrame(const std::string& interface_name, |
| 789 mojo::ScopedMessagePipeHandle pipe); | 791 mojo::ScopedMessagePipeHandle pipe); |
| 790 #endif | 792 #endif |
| 791 void OnShowCreatedWindow(int pending_widget_routing_id, | 793 void OnShowCreatedWindow(int pending_widget_routing_id, |
| 792 WindowOpenDisposition disposition, | 794 WindowOpenDisposition disposition, |
| 793 const gfx::Rect& initial_rect, | 795 const gfx::Rect& initial_rect, |
| 794 bool user_gesture); | 796 bool user_gesture); |
| 795 | 797 |
| 798 // mojom::FrameHostIPC | |
| 799 void CreateNewWindow(mojom::CreateNewWindowParamsPtr params, | |
| 800 const CreateNewWindowCallback& callback) override; | |
| 801 | |
| 802 void RunCreateWindowCompleteCallback(const CreateNewWindowCallback& callback, | |
| 803 mojom::CreateNewWindowReplyPtr reply, | |
| 804 int render_view_route_id, | |
| 805 int main_frame_route_id, | |
| 806 int main_frame_widget_route_id, | |
| 807 int cloned_session_storage_namespace_id); | |
| 808 | |
| 796 // Registers Mojo interfaces that this frame host makes available. | 809 // Registers Mojo interfaces that this frame host makes available. |
| 797 void RegisterMojoInterfaces(); | 810 void RegisterMojoInterfaces(); |
| 798 | 811 |
| 799 // Resets any waiting state of this RenderFrameHost that is no longer | 812 // Resets any waiting state of this RenderFrameHost that is no longer |
| 800 // relevant. | 813 // relevant. |
| 801 void ResetWaitingState(); | 814 void ResetWaitingState(); |
| 802 | 815 |
| 803 // Returns whether the given origin is allowed to commit in the current | 816 // Returns whether the given origin is allowed to commit in the current |
| 804 // RenderFrameHost. The |url| is used to ensure it matches the origin in cases | 817 // RenderFrameHost. The |url| is used to ensure it matches the origin in cases |
| 805 // where it is applicable. This is a more conservative check than | 818 // where it is applicable. This is a more conservative check than |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1033 // such as for a new subframe navigation in a different frame. Tracking this | 1046 // such as for a new subframe navigation in a different frame. Tracking this |
| 1034 // allows us to send things like title and state updates to the latest | 1047 // allows us to send things like title and state updates to the latest |
| 1035 // relevant NavigationEntry. | 1048 // relevant NavigationEntry. |
| 1036 int nav_entry_id_; | 1049 int nav_entry_id_; |
| 1037 | 1050 |
| 1038 // Used to swap out or shut down this RFH when the unload event is taking too | 1051 // Used to swap out or shut down this RFH when the unload event is taking too |
| 1039 // long to execute, depending on the number of active frames in the | 1052 // long to execute, depending on the number of active frames in the |
| 1040 // SiteInstance. May be null in tests. | 1053 // SiteInstance. May be null in tests. |
| 1041 std::unique_ptr<TimeoutMonitor> swapout_event_monitor_timeout_; | 1054 std::unique_ptr<TimeoutMonitor> swapout_event_monitor_timeout_; |
| 1042 | 1055 |
| 1056 std::unique_ptr<AssociatedInterfaceRegistryImpl> associated_registry_; | |
| 1057 | |
| 1043 std::unique_ptr<service_manager::InterfaceRegistry> interface_registry_; | 1058 std::unique_ptr<service_manager::InterfaceRegistry> interface_registry_; |
| 1044 std::unique_ptr<service_manager::InterfaceProvider> remote_interfaces_; | 1059 std::unique_ptr<service_manager::InterfaceProvider> remote_interfaces_; |
| 1045 | 1060 |
| 1046 service_manager::ServiceInfo browser_info_; | 1061 service_manager::ServiceInfo browser_info_; |
| 1047 service_manager::ServiceInfo renderer_info_; | 1062 service_manager::ServiceInfo renderer_info_; |
| 1048 | 1063 |
| 1049 int on_connect_handler_id_ = 0; | 1064 int on_connect_handler_id_ = 0; |
| 1050 | 1065 |
| 1051 std::list<std::unique_ptr<WebBluetoothServiceImpl>> web_bluetooth_services_; | 1066 std::list<std::unique_ptr<WebBluetoothServiceImpl>> web_bluetooth_services_; |
| 1052 | 1067 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1120 | 1135 |
| 1121 // If true, then the RenderFrame has selected text. | 1136 // If true, then the RenderFrame has selected text. |
| 1122 bool has_selection_; | 1137 bool has_selection_; |
| 1123 | 1138 |
| 1124 // PlzNavigate: The Previews state of the last navigation. This is used during | 1139 // PlzNavigate: The Previews state of the last navigation. This is used during |
| 1125 // history navigation of subframes to ensure that subframes navigate with the | 1140 // history navigation of subframes to ensure that subframes navigate with the |
| 1126 // same Previews status as the top-level frame. | 1141 // same Previews status as the top-level frame. |
| 1127 PreviewsState last_navigation_previews_state_; | 1142 PreviewsState last_navigation_previews_state_; |
| 1128 | 1143 |
| 1129 mojo::Binding<mojom::FrameHost> frame_host_binding_; | 1144 mojo::Binding<mojom::FrameHost> frame_host_binding_; |
| 1145 mojo::AssociatedBinding<mojom::FrameHostIPC> frame_host_associated_binding_; | |
| 1130 mojom::FramePtr frame_; | 1146 mojom::FramePtr frame_; |
| 1131 mojom::FrameBindingsControlAssociatedPtr frame_bindings_control_; | 1147 mojom::FrameBindingsControlAssociatedPtr frame_bindings_control_; |
| 1132 | 1148 |
| 1133 // If this is true then this object was created in response to a renderer | 1149 // If this is true then this object was created in response to a renderer |
| 1134 // initiated request. Init() will be called, and until then navigation | 1150 // initiated request. Init() will be called, and until then navigation |
| 1135 // requests should be queued. | 1151 // requests should be queued. |
| 1136 bool waiting_for_init_; | 1152 bool waiting_for_init_; |
| 1137 | 1153 |
| 1138 // If true then this frame's document has a focused element which is editable. | 1154 // If true then this frame's document has a focused element which is editable. |
| 1139 bool has_focused_editable_element_; | 1155 bool has_focused_editable_element_; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1177 | 1193 |
| 1178 // NOTE: This must be the last member. | 1194 // NOTE: This must be the last member. |
| 1179 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 1195 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
| 1180 | 1196 |
| 1181 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 1197 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
| 1182 }; | 1198 }; |
| 1183 | 1199 |
| 1184 } // namespace content | 1200 } // namespace content |
| 1185 | 1201 |
| 1186 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 1202 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| OLD | NEW |