ben | 76f52b24 | 2016-06-18 05:42:48 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | module content.mojom; |
| 6 | |
Dave Tapuska | fc4adbae | 2020-12-02 22:08:59 | [diff] [blame] | 7 | import "cc/mojom/browser_controls_state.mojom"; |
Arthur Hemery | 9c03573 | 2019-01-07 16:12:41 | [diff] [blame] | 8 | import "content/common/frame_messages.mojom"; |
Antonio Sartori | 90f4121 | 2021-01-22 10:08:34 | [diff] [blame] | 9 | import "content/common/frame_replication_state.mojom"; |
Jeremy Roman | 62fee22 | 2019-07-09 17:34:14 | [diff] [blame] | 10 | import "content/common/native_types.mojom"; |
Arthur Hemery | d3011f6 | 2018-05-30 10:38:44 | [diff] [blame] | 11 | import "content/common/navigation_client.mojom"; |
Arthur Hemery | 7b67a97 | 2017-12-01 15:24:49 | [diff] [blame] | 12 | import "content/common/navigation_params.mojom"; |
Miyoung Shin | 072d405 | 2020-07-13 07:52:44 | [diff] [blame] | 13 | import "content/common/web_ui.mojom"; |
csharrison | 95f01e92 | 2017-04-24 18:52:35 | [diff] [blame] | 14 | import "content/public/common/window_container_type.mojom"; |
Daniel Cheng | d1b77555 | 2021-02-19 18:50:02 | [diff] [blame] | 15 | import "ipc/constants.mojom"; |
Mario Sanchez Prada | 13bbad5 | 2020-06-01 18:12:29 | [diff] [blame] | 16 | import "mojo/public/mojom/base/file_path.mojom"; |
Ken Rockot | 8b447d7 | 2018-02-03 20:30:47 | [diff] [blame] | 17 | import "mojo/public/mojom/base/string16.mojom"; |
Dominic Mazzoni | 77d0aba | 2021-01-14 09:42:16 | [diff] [blame] | 18 | import "mojo/public/mojom/base/time.mojom"; |
Oksana Zhuravlova | 34579e91 | 2018-03-23 00:18:49 | [diff] [blame] | 19 | import "mojo/public/mojom/base/unguessable_token.mojom"; |
Hajime Hoshi | 35ad74f | 2019-03-07 08:38:05 | [diff] [blame] | 20 | import "mojo/public/mojom/base/values.mojom"; |
arthursonzogni | 42eabe01 | 2020-01-17 15:55:56 | [diff] [blame] | 21 | import "services/network/public/mojom/content_security_policy.mojom"; |
Daniel Cheng | d1b77555 | 2021-02-19 18:50:02 | [diff] [blame] | 22 | import "services/network/public/mojom/url_loader.mojom"; |
Dave Tapuska | 2a6046a | 2021-03-01 22:42:52 | [diff] [blame] | 23 | import "services/network/public/mojom/url_loader_factory.mojom"; |
| 24 | import "services/network/public/mojom/url_request.mojom"; |
arthursonzogni | 42eabe01 | 2020-01-17 15:55:56 | [diff] [blame] | 25 | import "services/network/public/mojom/url_response_head.mojom"; |
Ken Rockot | 543f5e3 | 2018-02-04 02:13:50 | [diff] [blame] | 26 | import "services/service_manager/public/mojom/interface_provider.mojom"; |
Miyoung Shin | 99505dd | 2019-07-27 12:45:35 | [diff] [blame] | 27 | import "services/viz/public/mojom/compositing/surface_id.mojom"; |
Blink Reformat | a30d423 | 2018-04-07 15:31:06 | [diff] [blame] | 28 | import "third_party/blink/public/mojom/blob/blob_url_store.mojom"; |
Dave Tapuska | 4e60c23 | 2020-11-05 15:49:32 | [diff] [blame] | 29 | import "third_party/blink/public/mojom/browser_interface_broker.mojom"; |
Julie Jeongeun Kim | 42a90df | 2019-03-20 23:13:10 | [diff] [blame] | 30 | import "third_party/blink/public/mojom/commit_result/commit_result.mojom"; |
Lowell Manners | f03ea5a | 2019-04-23 11:47:58 | [diff] [blame] | 31 | import "third_party/blink/public/mojom/devtools/console_message.mojom"; |
Kevin McNee | ea7f3b8 | 2020-02-27 21:42:32 | [diff] [blame] | 32 | import "third_party/blink/public/mojom/devtools/devtools_agent.mojom"; |
Gyuyoung Kim | 16a12f5 | 2020-12-19 04:24:26 | [diff] [blame] | 33 | import "third_party/blink/public/mojom/frame/frame.mojom"; |
Dave Tapuska | 4e60c23 | 2020-11-05 15:49:32 | [diff] [blame] | 34 | import "third_party/blink/public/mojom/frame/frame_owner_element_type.mojom"; |
| 35 | import "third_party/blink/public/mojom/frame/frame_owner_properties.mojom"; |
| 36 | import "third_party/blink/public/mojom/frame/frame_policy.mojom"; |
Dave Tapuska | d6703f91 | 2019-01-31 23:13:11 | [diff] [blame] | 37 | import "third_party/blink/public/mojom/frame/lifecycle.mojom"; |
Andy Paicu | c93d3086 | 2018-10-10 15:33:45 | [diff] [blame] | 38 | import "third_party/blink/public/mojom/frame/navigation_initiator.mojom"; |
Antonio Sartori | 7f809cc7 | 2020-10-30 07:47:20 | [diff] [blame] | 39 | import "third_party/blink/public/mojom/frame/policy_container.mojom"; |
Dave Tapuska | 4e60c23 | 2020-11-05 15:49:32 | [diff] [blame] | 40 | import "third_party/blink/public/mojom/frame/tree_scope_type.mojom"; |
Daniel Cheng | d1b77555 | 2021-02-19 18:50:02 | [diff] [blame] | 41 | import "third_party/blink/public/mojom/loader/referrer.mojom"; |
Minggang Wang | ee5af39 | 2020-02-05 02:55:28 | [diff] [blame] | 42 | import "third_party/blink/public/mojom/loader/resource_load_info.mojom"; |
Hiroki Nakagawa | 75375834 | 2018-12-27 04:13:49 | [diff] [blame] | 43 | import "third_party/blink/public/mojom/loader/url_loader_factory_bundle.mojom"; |
Yuzu Saijo | aae9170 | 2019-03-13 07:38:05 | [diff] [blame] | 44 | import "third_party/blink/public/mojom/messaging/transferable_message.mojom"; |
Yuzu Saijo | d46f498a | 2020-08-04 02:56:22 | [diff] [blame] | 45 | import "third_party/blink/public/mojom/page/page.mojom"; |
Dave Tapuska | 8499eec | 2020-03-16 17:54:30 | [diff] [blame] | 46 | import "third_party/blink/public/mojom/page/widget.mojom"; |
Lucas Furukawa Gadani | 89a7418 | 2019-01-10 19:33:22 | [diff] [blame] | 47 | import "third_party/blink/public/mojom/portal/portal.mojom"; |
Daniel Cheng | d1b77555 | 2021-02-19 18:50:02 | [diff] [blame] | 48 | import "third_party/blink/public/mojom/renderer_preferences.mojom"; |
Hiroki Nakagawa | cdbc791 | 2018-11-30 11:30:05 | [diff] [blame] | 49 | import "third_party/blink/public/mojom/service_worker/controller_service_worker.mojom"; |
Hiroki Nakagawa | 077f2096 | 2020-05-15 08:04:44 | [diff] [blame] | 50 | import "third_party/blink/public/mojom/service_worker/service_worker_container.mojom"; |
Chris Hamilton | a46b1544 | 2020-07-31 14:38:56 | [diff] [blame] | 51 | import "third_party/blink/public/mojom/tokens/tokens.mojom"; |
Daniel Cheng | d1b77555 | 2021-02-19 18:50:02 | [diff] [blame] | 52 | import "third_party/blink/public/mojom/webpreferences/web_preferences.mojom"; |
Dave Tapuska | 9a31f41 | 2020-07-20 17:01:28 | [diff] [blame] | 53 | import "third_party/blink/public/mojom/widget/visual_properties.mojom"; |
Julie Jeongeun Kim | 42a90df | 2019-03-20 23:13:10 | [diff] [blame] | 54 | import "third_party/blink/public/mojom/window_features/window_features.mojom"; |
Mario Sanchez Prada | 5d7f1ac | 2020-07-16 17:18:40 | [diff] [blame] | 55 | import "ui/accessibility/mojom/ax_tree_update.mojom"; |
Julie Jeongeun Kim | 2b1d45a | 2019-06-28 23:37:54 | [diff] [blame] | 56 | import "ui/base/mojom/window_open_disposition.mojom"; |
Miyoung Shin | 87943f50 | 2019-07-26 13:31:58 | [diff] [blame] | 57 | import "ui/gfx/geometry/mojom/geometry.mojom"; |
Kevin McNee | ea7f3b8 | 2020-02-27 21:42:32 | [diff] [blame] | 58 | import "url/mojom/origin.mojom"; |
| 59 | import "url/mojom/url.mojom"; |
ben | 76f52b24 | 2016-06-18 05:42:48 | [diff] [blame] | 60 | |
Miyoung Shin | 5d77f7207 | 2020-10-09 15:14:20 | [diff] [blame] | 61 | [Native] |
| 62 | struct PageState; |
| 63 | |
Daniel Cheng | d1b77555 | 2021-02-19 18:50:02 | [diff] [blame] | 64 | // A View (i.e. a "main frame") can be created for a few different cases, these |
| 65 | // values are used to specify which it is. |
| 66 | enum ViewWidgetType { |
| 67 | // A standard view that's the top-level widget in a frame hierarchy. |
| 68 | kTopLevel, |
| 69 | // A GuestView used to render contents inside a <webview> element. |
| 70 | kGuestView, |
| 71 | // A view used to render contents inside a <portal> element. |
| 72 | kPortal |
| 73 | }; |
| 74 | |
| 75 | struct CreateViewParams { |
| 76 | // Renderer-wide preferences. |
| 77 | blink.mojom.RendererPreferences renderer_preferences; |
| 78 | |
| 79 | // Preferences for this view. |
| 80 | blink.mojom.WebPreferences web_preferences; |
| 81 | |
| 82 | // The ID of the view to be created. |
| 83 | int32 view_id = IPC.mojom.kRoutingIdNone; |
| 84 | |
| 85 | // The session storage namespace ID this view should use. |
| 86 | string session_storage_namespace_id; |
| 87 | |
| 88 | // The frame token of the opener frame if one exists, or base::nullopt |
| 89 | // otherwise. |
Chris Hamilton | 2ea2031 | 2021-02-24 17:20:14 | [diff] [blame] | 90 | blink.mojom.FrameToken? opener_frame_token; |
Daniel Cheng | d1b77555 | 2021-02-19 18:50:02 | [diff] [blame] | 91 | |
Daniel Cheng | 4daa5122 | 2021-02-21 07:20:11 | [diff] [blame] | 92 | // Information that needs to be replicated to the view's main frame, e.g. |
| 93 | // frame name and sandbox flags. |
| 94 | FrameReplicationState replication_state; |
| 95 | |
| 96 | // Used for devtools instrumentation and trace-ability. The token is shared |
| 97 | // across all frames (local or remotes) representing the same logical frame |
| 98 | // tree node, and is used by Blink and content to tag calls and requests for |
| 99 | // instrumentation purposes, allowing them to be attributed to a context |
| 100 | // frame. |
| 101 | // |
| 102 | // Must not be used to look up a RenderFrameHostImpl or RenderFrameProxyHost |
| 103 | // in the browser process, as the token is shared, making the mapping |
| 104 | // ambiguous and non-authoritative. |
| 105 | mojo_base.mojom.UnguessableToken devtools_main_frame_token; |
| 106 | |
Daniel Cheng | d1b77555 | 2021-02-19 18:50:02 | [diff] [blame] | 107 | CreateMainFrameUnion main_frame; |
| 108 | |
| 109 | // Whether the RenderView should initially be hidden. |
| 110 | bool hidden; |
| 111 | |
| 112 | // When true, all RenderWidgets under this RenderView will never be shown to |
| 113 | // the user, and thus never composited, and will not need to produce pixels |
| 114 | // for display. This allows the renderer to optimize and avoid resources used |
| 115 | // for displaying graphical output. |
| 116 | bool never_composited; |
| 117 | |
| 118 | // Whether the window associated with this view was created with an opener. |
| 119 | bool window_was_created_with_opener; |
| 120 | |
| 121 | // Whether lookup of frames in the created RenderView (e.g. lookup via |
| 122 | // window.open or via <a target=...>) should be renderer-wide (i.e. going |
| 123 | // beyond the usual opener-relationship-based BrowsingInstance boundaries). |
| 124 | bool renderer_wide_named_frame_lookup; |
| 125 | |
| 126 | // Indicates whether the view is a regular top-level widget or some other |
| 127 | // nested "main frame" widget type. |
| 128 | ViewWidgetType type; |
| 129 | |
| 130 | // Endpoint for any messages that are broadcast to all views in a WebContents. |
| 131 | pending_associated_receiver<blink.mojom.PageBroadcast> blink_page_broadcast; |
| 132 | }; |
| 133 | |
Daniel Cheng | d1b77555 | 2021-02-19 18:50:02 | [diff] [blame] | 134 | // A union to distinguish between parameters specific to local main frame |
| 135 | // creation and remote main frame creation. |
| 136 | union CreateMainFrameUnion { |
| 137 | CreateLocalMainFrameParams local_params; |
| 138 | CreateRemoteMainFrameParams remote_params; |
| 139 | }; |
| 140 | |
| 141 | // Parameters used for browser-initiated local main frame creation. |
| 142 | struct CreateLocalMainFrameParams { |
Daniel Cheng | 4daa5122 | 2021-02-21 07:20:11 | [diff] [blame] | 143 | // The frame token. Used to map between LocalFrame and RenderFrameHostImpl. |
| 144 | blink.mojom.LocalFrameToken token; |
| 145 | |
Daniel Cheng | d1b77555 | 2021-02-19 18:50:02 | [diff] [blame] | 146 | // The ID of the main frame hosted in the view. Must not be kRoutingIdNone. |
| 147 | int32 routing_id = IPC.mojom.kRoutingIdNone; |
| 148 | |
| 149 | // The communication interfaces for the WebLocalFrame in blink. |
| 150 | pending_associated_receiver<content.mojom.Frame> frame; |
| 151 | |
| 152 | pending_remote<blink.mojom.BrowserInterfaceBroker> interface_broker; |
| 153 | |
| 154 | // Whether or not the frame has previously committed a real load. |
| 155 | bool has_committed_real_load; |
| 156 | |
| 157 | // Null when the main frame has no policy container yet (for example, because |
| 158 | // it is a speculative RenderFrameHost), and the policy container will be |
| 159 | // sent during CommitNavigation. |
| 160 | blink.mojom.PolicyContainer? policy_container; |
| 161 | |
| 162 | CreateFrameWidgetParams widget_params; |
| 163 | }; |
| 164 | |
| 165 | // Parameters used for brower-initiated remote main frame creation. |
| 166 | struct CreateRemoteMainFrameParams { |
Daniel Cheng | 4daa5122 | 2021-02-21 07:20:11 | [diff] [blame] | 167 | blink.mojom.RemoteFrameToken token; |
| 168 | |
Daniel Cheng | d1b77555 | 2021-02-19 18:50:02 | [diff] [blame] | 169 | // The ID of the proxy object for the main frame in this view. Must not be |
| 170 | // kRoutingIdNone. |
| 171 | int32 routing_id = IPC.mojom.kRoutingIdNone; |
| 172 | }; |
| 173 | |
| 174 | // Parameters used for creating a new frame widget. |
| 175 | struct CreateFrameWidgetParams { |
| 176 | // Gives the routing ID for the RenderWidget that will be attached to the |
| 177 | // new RenderFrame. |
| 178 | int32 routing_id; |
| 179 | |
| 180 | // The communication interfaces for the WebFrameWidget in blink. |
| 181 | pending_associated_remote<blink.mojom.FrameWidgetHost> frame_widget_host; |
| 182 | pending_associated_receiver<blink.mojom.FrameWidget> frame_widget; |
| 183 | pending_associated_remote<blink.mojom.WidgetHost> widget_host; |
| 184 | pending_associated_receiver<blink.mojom.Widget> widget; |
| 185 | |
| 186 | // The initial visual properties of the widget. |
| 187 | blink.mojom.VisualProperties visual_properties; |
| 188 | }; |
| 189 | |
| 190 | // Used for recreating child frames after a crash (does this still happen?) and |
| 191 | // speculative/provisional frames (including main frame). |
| 192 | // |
| 193 | // "Normal" child frame creation (via inserting a new frame owner element into |
| 194 | // the active document) does not use these params and is routed via |
| 195 | // CreateChildFrame(). |
| 196 | // |
| 197 | // "Normal" main frame creation (whether browser-initiated, e.g. opening a new |
| 198 | // tab, or renderer-initiated, e.g. window.open()) also do not use these params |
| 199 | // and are routed via CreateView() and CreateNewWindow() respectively. |
| 200 | // |
Daniel Cheng | d1b77555 | 2021-02-19 18:50:02 | [diff] [blame] | 201 | struct CreateFrameParams { |
Daniel Cheng | 4daa5122 | 2021-02-21 07:20:11 | [diff] [blame] | 202 | // The frame token. Used to map between LocalFrame and RenderFrameHostImpl. |
| 203 | blink.mojom.LocalFrameToken token; |
| 204 | |
Daniel Cheng | d1b77555 | 2021-02-19 18:50:02 | [diff] [blame] | 205 | // Specifies the routing ID of the new RenderFrame object. |
| 206 | int32 routing_id; |
| 207 | |
| 208 | // If a valid |previous_routing_id| is provided, the new frame will be |
| 209 | // configured to replace either the previous frame or the previous proxy on |
| 210 | // commit. |
| 211 | int32 previous_routing_id; |
| 212 | |
Daniel Cheng | d1b77555 | 2021-02-19 18:50:02 | [diff] [blame] | 213 | // Specifies the new frame's opener. The opener will be null if this is |
| 214 | // base::nullopt. |
Chris Hamilton | 2ea2031 | 2021-02-24 17:20:14 | [diff] [blame] | 215 | blink.mojom.FrameToken? opener_frame_token; |
Daniel Cheng | d1b77555 | 2021-02-19 18:50:02 | [diff] [blame] | 216 | |
| 217 | // The new frame should be created as a child of the object |
| 218 | // identified by |parent_routing_id| or as top level if that is |
| 219 | // MSG_ROUTING_NONE. |
| 220 | int32 parent_routing_id; |
| 221 | |
| 222 | // Identifies the previous sibling of the new frame, so that the new frame is |
| 223 | // inserted into the correct place in the frame tree. If this is |
| 224 | // MSG_ROUTING_NONE, the frame will be created as the leftmost child of its |
| 225 | // parent frame, in front of any other children. |
| 226 | int32 previous_sibling_routing_id; |
| 227 | |
| 228 | pending_remote<blink.mojom.BrowserInterfaceBroker> interface_broker; |
| 229 | |
| 230 | // When the new frame has a parent, |replication_state| holds the new frame's |
| 231 | // properties replicated from the process rendering the parent frame, such as |
| 232 | // the new frame's sandbox flags. |
| 233 | FrameReplicationState replication_state; |
| 234 | |
| 235 | // Used for devtools instrumentation and trace-ability. The token is |
| 236 | // propagated to Blink's LocalFrame and both Blink and content/ |
| 237 | // can tag calls and requests with this instrumentation token in order to |
| 238 | // attribute them to the context frame. |
| 239 | // |devtools_frame_token| is only defined by the browser and is never |
| 240 | // sent back from the renderer in the control calls. |
| 241 | mojo_base.mojom.UnguessableToken devtools_frame_token; |
| 242 | |
| 243 | // When the new frame has a parent, |frame_owner_properties| holds the |
| 244 | // properties of the HTMLFrameOwnerElement from the parent process. |
| 245 | // Note that unlike FrameReplicationState, this is not replicated for remote |
| 246 | // frames. |
| 247 | blink.mojom.FrameOwnerProperties frame_owner_properties; |
| 248 | |
| 249 | // Specifies properties for a new RenderWidget that will be attached to the |
| 250 | // new RenderFrame (if one is needed). |
| 251 | CreateFrameWidgetParams? widget_params; |
| 252 | |
| 253 | // Whether or not the frame has previously committed a real load. |
| 254 | bool has_committed_real_load; |
| 255 | |
| 256 | // The policy container for the frame to be created. This can be null if we |
| 257 | // could not determine a policy container yet, for example in case of a |
| 258 | // speculative RenderFrameHost. In that case, the final policy container will |
| 259 | // be sent along CommitNavigation. |
| 260 | blink.mojom.PolicyContainer? policy_container; |
| 261 | |
| 262 | // The mojo connection to the mojom::Frame in the renderer. |
| 263 | pending_associated_receiver<content.mojom.Frame> frame; |
| 264 | }; |
| 265 | |
Mario Sanchez Prada | 13bbad5 | 2020-06-01 18:12:29 | [diff] [blame] | 266 | // Provided with each call to Frame::GetSerializedHtmlWithLocalLinks() so that |
| 267 | // the renderer can notify the browser process each time that a chunk of HTML |
| 268 | // data gets serialized, as well as when the entire process is finished. |
| 269 | interface FrameHTMLSerializerHandler { |
| 270 | // Sent by the renderer as a response to GetSerializedHtmlWithLocalLinks() to |
| 271 | // indicate that HTML data has been serialized, included in |data_buffer|. |
| 272 | DidReceiveData(string data_buffer); |
| 273 | |
| 274 | // Reports that the serialization process is finished. It is expected to |
| 275 | // receive this message right after the last time DidReceiveData() is called. |
| 276 | Done(); |
| 277 | }; |
| 278 | |
Dominic Mazzoni | 77d0aba | 2021-01-14 09:42:16 | [diff] [blame] | 279 | struct SnapshotAccessibilityTreeParams { |
| 280 | // See ui/accessibility/ax_mode.h for valid values of |ax_mode|. |
| 281 | uint32 ax_mode; |
| 282 | |
| 283 | // If true, nodes that are entirely offscreen will have their entire |
| 284 | // subtree excluded. Note that this heuristic is imperfect, and |
| 285 | // an absolute-positioned node that's visible, but whose ancestors |
| 286 | // are entirely offscreen, may get excluded. |
| 287 | bool exclude_offscreen; |
| 288 | |
| 289 | // The maximum number of nodes to snapshot before exiting early. |
| 290 | // Note that this is not a hard limit; once this limit is reached a |
| 291 | // few more nodes may be added in order to ensure a well-formed |
| 292 | // tree is returned. Use 0 for no max. The corresponding C++ code |
| 293 | // uses size_t. |
| 294 | uint64 max_nodes; |
| 295 | |
| 296 | // The maximum amount of time to spend snapshotting the tree. Like |
| 297 | // max_nodes, this is not a hard limit, and once this limit is reached |
| 298 | // a few more nodes may be added in order to ensure a well-formed tree. |
| 299 | // Use 0 for no timeout. |
| 300 | mojo_base.mojom.TimeDelta timeout; |
| 301 | }; |
| 302 | |
Dave Tapuska | 795de45a | 2021-01-12 20:48:05 | [diff] [blame] | 303 | // An enumeration specifying the reason of the frame deletion. |
| 304 | enum FrameDeleteIntention { |
| 305 | // The frame being deleted isn't a (speculative) main frame. |
| 306 | kNotMainFrame, |
| 307 | // The frame being deleted is a speculative main frame, and it is being |
| 308 | // deleted as part of the shutdown for that WebContents. The entire RenderView |
| 309 | // etc will be destroyed by a separate IPC sent later. |
| 310 | kSpeculativeMainFrameForShutdown, |
| 311 | // The frame being deleted is a speculative main frame, and it is being |
| 312 | // deleted because the speculative navigation was cancelled. This is not part |
| 313 | // of shutdown. |
| 314 | kSpeculativeMainFrameForNavigationCancelled, |
| 315 | }; |
| 316 | |
danakj | 0bdfacd | 2021-01-20 19:27:18 | [diff] [blame] | 317 | // Implemented by the frame provider, and must be associated with other content |
| 318 | // mojoms bound to frames, widgets, views, and currently also with the legacy |
| 319 | // IPC channel. |
Arthur Hemery | d3011f6 | 2018-05-30 10:38:44 | [diff] [blame] | 320 | // KEEP THE COMMIT FUNCTIONS IN SYNC in content/common/navigation_client.mojom. |
danakj | 0bdfacd | 2021-01-20 19:27:18 | [diff] [blame] | 321 | // These will eventually be removed from Frame. |
| 322 | interface Frame { |
clamy | af4bf2d9 | 2018-02-06 10:54:36 | [diff] [blame] | 323 | // Tells the renderer that a same-document navigation should be committed. |
| 324 | // The renderer will return a status value indicating whether the commit |
| 325 | // could proceed as expected or not. In particular, it might be necessary to |
| 326 | // restart the navigation if it is no-longer same-document, which can happen |
| 327 | // if the renderer committed another navigation in the meantime. |
| 328 | CommitSameDocumentNavigation( |
| 329 | CommonNavigationParams common_params, |
Nasko Oskov | c36327d | 2019-01-03 23:23:04 | [diff] [blame] | 330 | CommitNavigationParams request_params) |
clamy | af4bf2d9 | 2018-02-06 10:54:36 | [diff] [blame] | 331 | => (blink.mojom.CommitResult commit_result); |
| 332 | |
clamy | b1df7b96 | 2018-02-01 17:38:17 | [diff] [blame] | 333 | // Asks the renderer to handle a renderer-debug URL. |
| 334 | HandleRendererDebugURL(url.mojom.Url url); |
| 335 | |
Chong Zhang | 7306b0b | 2018-01-24 05:59:24 | [diff] [blame] | 336 | // Provides the renderer an updated |subresource_loader_factories|. |
| 337 | // |
| 338 | // This method is intended to fix broken loaders after a Network Service |
| 339 | // crash, and is only used when Network Service is enabled. |
| 340 | // |
| 341 | // The new bundle contains replacement factories for a subset of the |
| 342 | // receiver's existing bundle. |
| 343 | UpdateSubresourceLoaderFactories( |
Hiroki Nakagawa | 75375834 | 2018-12-27 04:13:49 | [diff] [blame] | 344 | blink.mojom.URLLoaderFactoryBundle subresource_loader_factories); |
Dmitry Gozman | 6adf95b | 2018-10-10 22:12:19 | [diff] [blame] | 345 | |
| 346 | // Returns a DevToolsAgent interface for this frame, used for |
| 347 | // remote debugging. See DevToolsAgent for details. |
| 348 | // Returned DevToolsAgent must be associated with navigation control, |
| 349 | // due to various ordering dependencies between DevTools protocol and |
| 350 | // navigation. |
Julie Jeongeun Kim | 0788779 | 2019-08-13 11:05:48 | [diff] [blame] | 351 | BindDevToolsAgent( |
| 352 | pending_associated_remote<blink.mojom.DevToolsAgentHost> agent_host, |
Andrey Kosyakov | 5bb020f | 2020-03-19 17:28:19 | [diff] [blame] | 353 | pending_associated_receiver<blink.mojom.DevToolsAgent> agent); |
Hajime Hoshi | 35ad74f | 2019-03-07 08:38:05 | [diff] [blame] | 354 | |
Maksim Sadym | cfb8f8d | 2020-09-30 20:30:45 | [diff] [blame] | 355 | // Request for the renderer to execute a given JavaScript method on a given |
| 356 | // object (both identified by name) in the frame's context. |
| 357 | // |
| 358 | // |object_name| is the global name of the object. |
| 359 | // |
| 360 | // |method_name| is the name of the method on the object. |
| 361 | // |
| 362 | // |arguments| is the list of arguments to pass to the method invocation. |
| 363 | // |
| 364 | // |wants_result| is true if the result of this execution is required by the |
| 365 | // caller. If it is false, a reply is still required by Mojo, but a null value |
| 366 | // should be returned to avoid issues serializing a large, unwanted reply. |
| 367 | JavaScriptMethodExecuteRequest( |
| 368 | mojo_base.mojom.String16 object_name, |
| 369 | mojo_base.mojom.String16 method_name, |
| 370 | mojo_base.mojom.ListValue arguments, |
| 371 | bool wants_result) => (mojo_base.mojom.Value result); |
| 372 | |
Hajime Hoshi | 35ad74f | 2019-03-07 08:38:05 | [diff] [blame] | 373 | // Request for the renderer to execute JavaScript in the frame's context. |
| 374 | // |
| 375 | // |javascript| is the string containing the JavaScript to be executed in the |
Avi Drissman | 90630d9 | 2020-04-29 21:17:36 | [diff] [blame] | 376 | // target frame's context. Note that this uses BigString16 rather than |
| 377 | // String16 as this is used in contexts, like DevTools, where the contents of |
| 378 | // the JavaScript script is user-provided, and therefore we can't guarantee |
| 379 | // the size of the script. |
Hajime Hoshi | 35ad74f | 2019-03-07 08:38:05 | [diff] [blame] | 380 | // |
Avi Drissman | 8e3ebe9 | 2019-06-10 20:26:11 | [diff] [blame] | 381 | // |wants_result| is true if the result of this execution is required by the |
| 382 | // caller. If it is false, a reply is still required by Mojo, but a null value |
| 383 | // should be returned to avoid issues serializing a large, unwanted reply. |
| 384 | // |
Hajime Hoshi | 35ad74f | 2019-03-07 08:38:05 | [diff] [blame] | 385 | // TODO(hajimehoshi): This requires navigate association to keep the message |
| 386 | // order with other navigation-related messages. Fix this and move this to a |
| 387 | // non-navigate-related interface if possible. |
Avi Drissman | 4544828f | 2019-03-11 20:37:32 | [diff] [blame] | 388 | JavaScriptExecuteRequest( |
Avi Drissman | 90630d9 | 2020-04-29 21:17:36 | [diff] [blame] | 389 | mojo_base.mojom.BigString16 javascript, |
Avi Drissman | 8e3ebe9 | 2019-06-10 20:26:11 | [diff] [blame] | 390 | bool wants_result) => (mojo_base.mojom.Value result); |
Hajime Hoshi | 35ad74f | 2019-03-07 08:38:05 | [diff] [blame] | 391 | |
Mustaq Ahmed | 02cd883 | 2019-12-05 15:46:56 | [diff] [blame] | 392 | // ONLY FOR TESTS: Same as above but this can optionally trigger a fake user |
| 393 | // activation notification to test functionalities that are gated by user |
| 394 | // activation. |
Avi Drissman | 4544828f | 2019-03-11 20:37:32 | [diff] [blame] | 395 | JavaScriptExecuteRequestForTests( |
Avi Drissman | 90630d9 | 2020-04-29 21:17:36 | [diff] [blame] | 396 | mojo_base.mojom.BigString16 javascript, |
Avi Drissman | 8e3ebe9 | 2019-06-10 20:26:11 | [diff] [blame] | 397 | bool wants_result, |
Hajime Hoshi | f85e7cf72 | 2019-07-19 00:54:49 | [diff] [blame] | 398 | bool has_user_gesture, |
| 399 | int32 world_id) |
Avi Drissman | 4544828f | 2019-03-11 20:37:32 | [diff] [blame] | 400 | => (mojo_base.mojom.Value result); |
Hajime Hoshi | 35ad74f | 2019-03-07 08:38:05 | [diff] [blame] | 401 | |
| 402 | // Same as JavaScriptExecuteRequest above except the script is run in the |
| 403 | // isolated world specified by the fourth parameter. |
Avi Drissman | 4544828f | 2019-03-11 20:37:32 | [diff] [blame] | 404 | JavaScriptExecuteRequestInIsolatedWorld( |
Avi Drissman | 90630d9 | 2020-04-29 21:17:36 | [diff] [blame] | 405 | mojo_base.mojom.BigString16 javascript, |
Avi Drissman | 8e3ebe9 | 2019-06-10 20:26:11 | [diff] [blame] | 406 | bool wants_result, |
Avi Drissman | 4544828f | 2019-03-11 20:37:32 | [diff] [blame] | 407 | int32 world_id) => (mojo_base.mojom.Value result); |
Yuzu Saijo | aae9170 | 2019-03-13 07:38:05 | [diff] [blame] | 408 | |
Ian Barkley-Yeung | bda77fb | 2020-12-08 04:26:46 | [diff] [blame] | 409 | // Indicates that the frame host (browser) wants the |untrusted_stack_trace| |
| 410 | // parameter of DidAddMessageToConsole() filled in for Error messages if at |
| 411 | // all possible. |
| 412 | SetWantErrorMessageStackTrace(); |
| 413 | |
Dave Tapuska | ca25070 | 2021-01-07 17:40:55 | [diff] [blame] | 414 | // Unload this RenderFrame and replace it by a RenderFrameProxy, so the frame |
| 415 | // can navigate to a document rendered by a different process. The unload can |
| 416 | // fail if the RenderFrame is currently detached (it was removed from the |
| 417 | // frame tree before the Unload was received). If successful this message will |
| 418 | // send back AgentSchedulingGroupHost::DidUnloadRenderFrame message. This |
| 419 | // cannot be a standard reply callback because the unload acknowledgement must |
| 420 | // be posted back to the event loop to be invoked later. This is to ensure |
| 421 | // that any postMessage() calls executed by JS during unload are dispatched, |
| 422 | // since postMessage dispatch is always scheduled asynchronously. |
| 423 | Unload(int32 new_remote_frame_routing_id, |
| 424 | bool is_loading, |
| 425 | FrameReplicationState new_remote_frame_replication_state, |
Chris Hamilton | 6c60a83 | 2021-02-19 20:35:46 | [diff] [blame] | 426 | blink.mojom.RemoteFrameToken new_remote_frame_token); |
Dave Tapuska | 795de45a | 2021-01-12 20:48:05 | [diff] [blame] | 427 | |
| 428 | // Delete the frame. This is only called for child frames that the browser |
| 429 | // wants to detach, or for speculative main frames which are owned by the |
| 430 | // browser process. Committed main frames are owned by the renderer's WebView |
| 431 | // and can not be deleted directly. |
| 432 | Delete(FrameDeleteIntention intention); |
danakj | 0bdfacd | 2021-01-20 19:27:18 | [diff] [blame] | 433 | |
| 434 | // Causes all new subresource requests to be blocked (not being started) until |
| 435 | // ResumeBlockedRequests is called. |
| 436 | BlockRequests(); |
| 437 | |
| 438 | // Resumes blocked requests. |
| 439 | // It is safe to call this without calling BlockRequests. |
| 440 | ResumeBlockedRequests(); |
| 441 | |
| 442 | GetInterfaceProvider( |
| 443 | pending_receiver<service_manager.mojom.InterfaceProvider> interfaces); |
| 444 | |
| 445 | GetCanonicalUrlForSharing() => (url.mojom.Url? canonical_url); |
| 446 | |
| 447 | // Samsung Galaxy Note-specific "smart clip" stylus text getter. |
| 448 | // Extracts the data at the given rect. |
| 449 | [EnableIf=is_android] |
| 450 | ExtractSmartClipData(gfx.mojom.Rect rect) |
| 451 | => (mojo_base.mojom.String16 text, mojo_base.mojom.String16 html, |
| 452 | gfx.mojom.Rect clip_rect); |
| 453 | |
| 454 | // Requests a one-time snapshot of the accessibility tree without enabling |
| 455 | // accessibility if it wasn't already enabled. |
| 456 | SnapshotAccessibilityTree(SnapshotAccessibilityTreeParams params) |
| 457 | => (ax.mojom.AXTreeUpdate snapshot); |
| 458 | |
| 459 | // Get HTML data by serializing the target frame and replacing all resource |
| 460 | // links with a path to the local copy passed in the message payload. In order |
| 461 | // to report progress to the the browser process, a pending remote is passed |
| 462 | // via |callback_remote|, so that direct communication with the SavePackage |
| 463 | // object that initiated the process can be established. |
| 464 | GetSerializedHtmlWithLocalLinks( |
| 465 | map<url.mojom.Url, mojo_base.mojom.FilePath> url_map, |
Chris Hamilton | 2ea2031 | 2021-02-24 17:20:14 | [diff] [blame] | 466 | map<blink.mojom.FrameToken, mojo_base.mojom.FilePath> |
danakj | 0bdfacd | 2021-01-20 19:27:18 | [diff] [blame] | 467 | frame_token_map, bool save_with_empty_url, |
| 468 | pending_remote<FrameHTMLSerializerHandler> handler_remote); |
Ken Rockot | 4878545 | 2017-10-25 19:33:14 | [diff] [blame] | 469 | }; |
| 470 | |
sammc | 7f6c6a0 | 2017-01-30 00:53:51 | [diff] [blame] | 471 | // Implemented by the frame (e.g. renderer processes). |
| 472 | // Instances of this interface must be associated with (i.e., FIFO with) the |
| 473 | // legacy IPC channel. |
| 474 | interface FrameBindingsControl { |
| 475 | // Used to tell a render frame whether it should expose various bindings |
| 476 | // that allow JS content extended privileges. See BindingsPolicy for valid |
| 477 | // flag values. |
| 478 | AllowBindings(int32 enabled_bindings_flags); |
Nasko Oskov | 8a73f7d | 2019-09-27 22:29:32 | [diff] [blame] | 479 | |
| 480 | // Used to tell the RenderFrame to enable Mojo JS bindings, which allows |
| 481 | // JS code running in the renderer process to connect to Mojo interfaces |
| 482 | // and make method calls on them. |
| 483 | // This is used for WebUI only at this time. |
| 484 | EnableMojoJsBindings(); |
Miyoung Shin | 072d405 | 2020-07-13 07:52:44 | [diff] [blame] | 485 | |
| 486 | // Used to bind WebUI and WebUIHost mojo connections. |
Daniel Cheng | 4b931a4f | 2020-12-18 01:59:35 | [diff] [blame] | 487 | BindWebUI(pending_associated_receiver<content.mojom.WebUI> receiver, |
| 488 | pending_associated_remote<content.mojom.WebUIHost> remote); |
sammc | 7f6c6a0 | 2017-01-30 00:53:51 | [diff] [blame] | 489 | }; |
| 490 | |
csharrison | 95f01e92 | 2017-04-24 18:52:35 | [diff] [blame] | 491 | struct CreateNewWindowParams { |
Mustaq Ahmed | 8601a56 | 2020-01-31 18:05:52 | [diff] [blame] | 492 | // True if ContentRendererClient allows popups. This is the case only for |
| 493 | // extensions. |
| 494 | bool allow_popup; |
csharrison | 95f01e92 | 2017-04-24 18:52:35 | [diff] [blame] | 495 | |
| 496 | // Type of window requested. |
| 497 | WindowContainerType window_container_type; |
| 498 | |
| 499 | // The session storage namespace ID this window should use. |
Daniel Murphy | 31bbb8b1 | 2018-02-07 21:44:10 | [diff] [blame] | 500 | string session_storage_namespace_id; |
csharrison | 95f01e92 | 2017-04-24 18:52:35 | [diff] [blame] | 501 | |
Daniel Murphy | e3eec92c | 2018-02-23 19:09:15 | [diff] [blame] | 502 | // The session storage namespace ID this window should clone from. |
| 503 | // TODO(dmurph): Remove this once session storage is fully mojo'd, as the |
| 504 | // clone call happens on a different interface. https://crbug.com/716490 |
| 505 | string clone_from_session_storage_namespace_id; |
| 506 | |
csharrison | 95f01e92 | 2017-04-24 18:52:35 | [diff] [blame] | 507 | // The name of the resulting frame that should be created (empty if none |
| 508 | // has been specified). UTF8 encoded string. |
| 509 | string frame_name; |
| 510 | |
csharrison | 95f01e92 | 2017-04-24 18:52:35 | [diff] [blame] | 511 | // Whether the opener will be suppressed in the new window, in which case |
| 512 | // scripting the new window is not allowed. |
| 513 | bool opener_suppressed; |
| 514 | |
| 515 | // Whether the window should be opened in the foreground, background, etc. |
| 516 | ui.mojom.WindowOpenDisposition disposition; |
| 517 | |
| 518 | // The URL that will be loaded in the new window (empty if none has been |
| 519 | // specified). |
| 520 | url.mojom.Url target_url; |
| 521 | |
| 522 | // The referrer that will be used to load |target_url| (empty if none has |
| 523 | // been specified). |
| 524 | blink.mojom.Referrer referrer; |
| 525 | |
| 526 | // The window features to use for the new window. |
| 527 | blink.mojom.WindowFeatures features; |
John Delaney | 8623c64 | 2021-01-06 17:37:07 | [diff] [blame] | 528 | |
| 529 | // The impression associated with the navigation in the new window, if |
| 530 | // one is specified. |
| 531 | Impression? impression; |
csharrison | 95f01e92 | 2017-04-24 18:52:35 | [diff] [blame] | 532 | }; |
| 533 | |
Daniel Cheng | 8bb30c6 | 2017-10-23 20:40:47 | [diff] [blame] | 534 | // Operation result when the renderer asks the browser to create a new window. |
| 535 | enum CreateNewWindowStatus { |
| 536 | // Ignore creation of the new window. This can happen because creation is |
| 537 | // blocked or because the new window should have no opener relationship. |
| 538 | kIgnore, |
| 539 | // Reuse the current window rather than creating a new window. |
| 540 | kReuse, |
| 541 | // Create a new window using the corresponding params in |reply|. |
| 542 | kSuccess, |
| 543 | }; |
| 544 | |
| 545 | // All routing IDs in this struct must be set to a valid routing ID. |
Daniel Cheng | 4daa5122 | 2021-02-21 07:20:11 | [diff] [blame] | 546 | // TODO(dcheng): It's almost possible to use CreateLocalMainFrameParams here. |
| 547 | // See if there's a reasonable way to factor out state here by splitting things |
| 548 | // into browser-created params vs renderer-created params. |
csharrison | 95f01e92 | 2017-04-24 18:52:35 | [diff] [blame] | 549 | struct CreateNewWindowReply { |
Daniel Cheng | 8bb30c6 | 2017-10-23 20:40:47 | [diff] [blame] | 550 | // The ID of the view to be created. |
csharrison | 95f01e92 | 2017-04-24 18:52:35 | [diff] [blame] | 551 | int32 route_id; |
| 552 | |
Daniel Cheng | 4daa5122 | 2021-02-21 07:20:11 | [diff] [blame] | 553 | // The unique identifier of the RenderFrameHost |
| 554 | blink.mojom.LocalFrameToken main_frame_token; |
| 555 | |
csharrison | 95f01e92 | 2017-04-24 18:52:35 | [diff] [blame] | 556 | // The ID of the main frame hosted in the view. |
| 557 | int32 main_frame_route_id; |
| 558 | |
danakj | 0bdfacd | 2021-01-20 19:27:18 | [diff] [blame] | 559 | // The pending mojo connection to the Frame implementation in the renderer. |
| 560 | pending_associated_receiver<content.mojom.Frame> frame; |
| 561 | |
Daniel Cheng | d1b77555 | 2021-02-19 18:50:02 | [diff] [blame] | 562 | CreateFrameWidgetParams widget_params; |
Dave Tapuska | 8499eec | 2020-03-16 17:54:30 | [diff] [blame] | 563 | |
Yuzu Saijo | d46f498a | 2020-08-04 02:56:22 | [diff] [blame] | 564 | // The communication interfaces for the PageBroadcast. |
| 565 | pending_associated_receiver<blink.mojom.PageBroadcast> page_broadcast; |
| 566 | |
Ken Rockot | c4a0ada9 | 2020-12-02 00:22:14 | [diff] [blame] | 567 | pending_remote<blink.mojom.BrowserInterfaceBroker> |
| 568 | main_frame_interface_broker; |
Balazs Engedy | ba034e7 | 2017-10-27 22:26:28 | [diff] [blame] | 569 | |
csharrison | 95f01e92 | 2017-04-24 18:52:35 | [diff] [blame] | 570 | // Duplicated from CreateNewWindowParams because legacy code. |
Daniel Murphy | 31bbb8b1 | 2018-02-07 21:44:10 | [diff] [blame] | 571 | string cloned_session_storage_namespace_id; |
Pavel Feldman | 08beed784 | 2017-10-17 19:18:11 | [diff] [blame] | 572 | |
Daniel Cheng | 4daa5122 | 2021-02-21 07:20:11 | [diff] [blame] | 573 | // Used for devtools instrumentation and trace-ability. The token is shared |
| 574 | // across all frames (local or remotes) representing the same logical frame |
| 575 | // tree node, and is used by Blink and content to tag calls and requests for |
| 576 | // instrumentation purposes, allowing them to be attributed to a context |
| 577 | // frame. |
| 578 | // |
| 579 | // Must not be used to look up a RenderFrameHostImpl or RenderFrameProxyHost |
| 580 | // in the browser process, as the token is shared, making the mapping |
| 581 | // ambiguous and non-authoritative. |
Oksana Zhuravlova | 34579e91 | 2018-03-23 00:18:49 | [diff] [blame] | 582 | mojo_base.mojom.UnguessableToken devtools_main_frame_token; |
Yury Semikhatsky | 82730ff | 2020-02-25 22:29:26 | [diff] [blame] | 583 | |
| 584 | // Used by devtools instrumentation to tell devtools agent in the renderer |
| 585 | // that it should pause created window and wait for an explicit resume command |
| 586 | // from the client. |
| 587 | bool wait_for_debugger; |
Antonio Sartori | 7f809cc7 | 2020-10-30 07:47:20 | [diff] [blame] | 588 | |
| 589 | // The policy container for the new frame that will be created by Blink in |
| 590 | // response. |
Antonio Sartori | 9290b6b | 2020-11-09 10:09:33 | [diff] [blame] | 591 | blink.mojom.PolicyContainer policy_container; |
csharrison | 95f01e92 | 2017-04-24 18:52:35 | [diff] [blame] | 592 | }; |
| 593 | |
csharrison | 95f01e92 | 2017-04-24 18:52:35 | [diff] [blame] | 594 | // Implemented by the frame server (i.e. the browser process). For messages that |
| 595 | // must be associated with the IPC channel. |
| 596 | interface FrameHost { |
Daniel Cheng | 8bb30c6 | 2017-10-23 20:40:47 | [diff] [blame] | 597 | // Sent by the renderer to request the browser to create a new window. |reply| |
| 598 | // is only non-null on when status == CreateNewWindowStatus::kSuccess. |
csharrison | 95f01e92 | 2017-04-24 18:52:35 | [diff] [blame] | 599 | [Sync] CreateNewWindow(CreateNewWindowParams params) |
Daniel Cheng | 8bb30c6 | 2017-10-23 20:40:47 | [diff] [blame] | 600 | => (CreateNewWindowStatus status, CreateNewWindowReply? reply); |
Yutaka Hirano | f7f2f63 | 2017-09-06 10:40:08 | [diff] [blame] | 601 | |
Lucas Furukawa Gadani | 9912582 | 2019-01-03 15:41:49 | [diff] [blame] | 602 | // Sent by the renderer process to request the creation of a new portal. |
Adithya Srinivasan | e8bf80e | 2019-05-01 15:39:31 | [diff] [blame] | 603 | // |portal| is the pipe to be used for the Portal object, |client| is the pipe |
Dave Tapuska | 8444938 | 2020-05-01 00:39:04 | [diff] [blame] | 604 | // used to communicate back with the caller. Returns: |
| 605 | // |proxy_routing_id| - the routing id of the RenderFrameProxy |
| 606 | // |initial_replicated_state| - the replicated state associated with that |
| 607 | // RenderFrameProxy |
| 608 | // |portal_token| - the unique identifier for the portal |
| 609 | // |frame_token| - the unique identifier of the RenderFrameProxy |
| 610 | // |devtools_frame_token| - the unique identifier of the frame node in the |
| 611 | // frame tree |
Jeremy Roman | d92e137 | 2019-06-04 16:31:17 | [diff] [blame] | 612 | [Sync] CreatePortal( |
| 613 | pending_associated_receiver<blink.mojom.Portal> portal, |
| 614 | pending_associated_remote<blink.mojom.PortalClient> client) |
Lucas Furukawa Gadani | 9912582 | 2019-01-03 15:41:49 | [diff] [blame] | 615 | => (int32 proxy_routing_id, |
Kevin McNee | 51ef5dc | 2020-01-13 17:52:37 | [diff] [blame] | 616 | FrameReplicationState initial_replicated_state, |
Adithya Srinivasan | ea4760c | 2020-07-30 15:44:57 | [diff] [blame] | 617 | blink.mojom.PortalToken portal_token, |
Chris Hamilton | 6c60a83 | 2021-02-19 20:35:46 | [diff] [blame] | 618 | blink.mojom.RemoteFrameToken frame_token, |
Lucas Furukawa Gadani | f68204d | 2019-04-30 17:30:24 | [diff] [blame] | 619 | mojo_base.mojom.UnguessableToken devtools_frame_token); |
Lucas Furukawa Gadani | 9912582 | 2019-01-03 15:41:49 | [diff] [blame] | 620 | |
Lucas Furukawa Gadani | 56dd545 | 2019-03-22 18:23:12 | [diff] [blame] | 621 | // Requests that this frame adopts the portal identified by |portal_token|. |
Dave Tapuska | 8444938 | 2020-05-01 00:39:04 | [diff] [blame] | 622 | // Returns: |
| 623 | // |proxy_routing_id| - the routing id of the portal's RenderFrameProxy |
| 624 | // |replicated_state| - the replicated state associated with that |
| 625 | // RenderFrameProxy |
| 626 | // |frame_token| - the unique identifier of the RenderFrameProxy |
| 627 | // |devtools_frame_token| - the unique identifier of the frame node in the |
| 628 | // frame tree |
Adithya Srinivasan | ea4760c | 2020-07-30 15:44:57 | [diff] [blame] | 629 | [Sync] AdoptPortal(blink.mojom.PortalToken portal_token) |
Lucas Furukawa Gadani | f68204d | 2019-04-30 17:30:24 | [diff] [blame] | 630 | => (int32 proxy_routing_id, |
Jeremy Roman | 62fee22 | 2019-07-09 17:34:14 | [diff] [blame] | 631 | FrameReplicationState replicated_state, |
Chris Hamilton | 6c60a83 | 2021-02-19 20:35:46 | [diff] [blame] | 632 | blink.mojom.RemoteFrameToken frame_token, |
Lucas Furukawa Gadani | f68204d | 2019-04-30 17:30:24 | [diff] [blame] | 633 | mojo_base.mojom.UnguessableToken devtools_frame_token); |
Lucas Furukawa Gadani | 56dd545 | 2019-03-22 18:23:12 | [diff] [blame] | 634 | |
Dave Tapuska | d983562 | 2020-03-10 17:32:31 | [diff] [blame] | 635 | |
| 636 | // Similar to CreateNewWindow, except used for sub-widgets, like <select> |
Dave Tapuska | 04ccda06 | 2020-10-21 21:58:12 | [diff] [blame] | 637 | // dropdowns. Upon return, the renderer side popup will be owned by the |
| 638 | // PopupWidgetHost. |
Dave Tapuska | d95cfb3 | 2020-11-02 17:04:55 | [diff] [blame] | 639 | CreateNewPopupWidget( |
Dave Tapuska | 04ccda06 | 2020-10-21 21:58:12 | [diff] [blame] | 640 | pending_associated_receiver<blink.mojom.PopupWidgetHost> popup_host, |
Dave Tapuska | 8499eec | 2020-03-16 17:54:30 | [diff] [blame] | 641 | pending_associated_receiver<blink.mojom.WidgetHost> blink_widget_host, |
Dave Tapuska | d95cfb3 | 2020-11-02 17:04:55 | [diff] [blame] | 642 | pending_associated_remote<blink.mojom.Widget> blink_widget); |
Dave Tapuska | d983562 | 2020-03-10 17:32:31 | [diff] [blame] | 643 | |
Dave Tapuska | 4e60c23 | 2020-11-05 15:49:32 | [diff] [blame] | 644 | // Asynchronously creates a child frame. A routing ID must be allocated first |
| 645 | // by calling RenderMessageFilter::GenerateFrameRoutingID() |
| 646 | // Each of these messages will have a corresponding mojom::FrameHost::Detach |
| 647 | // API sent when the frame is detached from the DOM. |
| 648 | CreateChildFrame(int32 child_routing_id, |
danakj | 0bdfacd | 2021-01-20 19:27:18 | [diff] [blame] | 649 | pending_associated_remote<content.mojom.Frame> frame, |
Dave Tapuska | 4e60c23 | 2020-11-05 15:49:32 | [diff] [blame] | 650 | pending_receiver<blink.mojom.BrowserInterfaceBroker> |
| 651 | browser_interface_broker, |
Antonio Sartori | db967c5 | 2021-01-20 09:54:30 | [diff] [blame] | 652 | blink.mojom.PolicyContainerBindParams |
| 653 | policy_container_bind_params, |
Dave Tapuska | 4e60c23 | 2020-11-05 15:49:32 | [diff] [blame] | 654 | blink.mojom.TreeScopeType scope, |
| 655 | string frame_name, |
| 656 | string frame_unique_name, |
| 657 | bool is_created_by_script, |
| 658 | blink.mojom.FramePolicy frame_policy, |
| 659 | blink.mojom.FrameOwnerProperties frame_owner_properties, |
| 660 | blink.mojom.FrameOwnerElementType frame_owner_element_type); |
| 661 | |
Balazs Engedy | a40712f | 2017-09-15 15:01:11 | [diff] [blame] | 662 | // Sent by the renderer when a navigation commits in the frame. |
Oksana Zhuravlova | 8b88e57 | 2019-01-07 21:54:00 | [diff] [blame] | 663 | |
| 664 | // If |interface_params| is non-empty, the FrameHost implementation |
Ken Rockot | 228182e | 2020-12-01 18:43:59 | [diff] [blame] | 665 | // must unbind the old BrowserInterfaceBroker connections, and drop any |
| 666 | // interface requests pending on them. Then it should bind the appropriate |
| 667 | // requests and start servicing GetInterface messages coming in on these new |
| 668 | // connections in a security context that is appropriate for the committed |
| 669 | // navigation. |
Balazs Engedy | 0c8d550b | 2017-12-06 21:30:23 | [diff] [blame] | 670 | // |
Oksana Zhuravlova | 8b88e57 | 2019-01-07 21:54:00 | [diff] [blame] | 671 | // The FrameHost implementation must enforce that |interface_params| |
Balazs Engedy | 0c8d550b | 2017-12-06 21:30:23 | [diff] [blame] | 672 | // is set for cross-document navigations. This prevents origin confusion by |
| 673 | // ensuring that interface requests racing with navigation commit will be |
| 674 | // either ignored, or serviced correctly in the security context of the |
Ken Rockot | 228182e | 2020-12-01 18:43:59 | [diff] [blame] | 675 | // document they originated from (based on which BrowserInterfaceBroker |
| 676 | // connection the GetInterface messages arrive on). |
Balazs Engedy | a40712f | 2017-09-15 15:01:11 | [diff] [blame] | 677 | DidCommitProvisionalLoad( |
Balazs Engedy | 0c8d550b | 2017-12-06 21:30:23 | [diff] [blame] | 678 | DidCommitProvisionalLoadParams params, |
Oksana Zhuravlova | 8b88e57 | 2019-01-07 21:54:00 | [diff] [blame] | 679 | DidCommitProvisionalLoadInterfaceParams? interface_params); |
Arthur Hemery | 7b67a97 | 2017-12-01 15:24:49 | [diff] [blame] | 680 | |
Arthur Hemery | 7b0ae49 | 2018-02-05 16:04:45 | [diff] [blame] | 681 | // Sent by the renderer to indicate that a same document navigation |
| 682 | // committed in the renderer process. |
| 683 | DidCommitSameDocumentNavigation( |
Rakina Zata Amni | 2635778 | 2020-12-03 11:45:01 | [diff] [blame] | 684 | DidCommitProvisionalLoadParams params, |
| 685 | DidCommitSameDocumentNavigationParams same_document_params); |
Arthur Hemery | 7b0ae49 | 2018-02-05 16:04:45 | [diff] [blame] | 686 | |
Arthur Hemery | 7b67a97 | 2017-12-01 15:24:49 | [diff] [blame] | 687 | // Sent by the renderer to request a navigation. |
Marijn Kruisselbrink | 07bf59d5 | 2018-04-03 21:50:25 | [diff] [blame] | 688 | // |blob_url_token| should be non-null when this is a navigation to a blob: |
| 689 | // URL. The token will then be used to look up the blob associated with the |
| 690 | // blob URL. Without this by the time the navigation code starts fetching |
| 691 | // the URL the blob URL might no longer be valid. |blob_url_token| is |
| 692 | // not part of BeginNavigationParams because that struct needs to be |
| 693 | // cloneable, and thus can't contain mojo interfaces. |
| 694 | // If an invalid BlobURLToken is passed in, or if the token doesn't match the |
| 695 | // url in |common_params|, the navigation will result in a network error. |
Arthur Hemery | d3011f6 | 2018-05-30 10:38:44 | [diff] [blame] | 696 | // |navigation_client| is passed to the renderer to allow for further control |
Nasko Oskov | d22f9bf87 | 2020-12-23 00:31:35 | [diff] [blame] | 697 | // of the navigation. Allows for Commit and Cancels/Aborts. |
Antonio Sartori | db967c5 | 2021-01-20 09:54:30 | [diff] [blame] | 698 | // Passing the |initiator_policy_container_keep_alive_handle| is just a means |
| 699 | // to ensure that the PolicyContainerHost of the initiator RenderFrameHost is |
| 700 | // kept alive, even if the RenderFrameHost itself has already been deleted in |
| 701 | // the meantime. If this can be ensured in other ways, it is safe to pass a |
| 702 | // mojo::NullRemote. In particular, if the initiator LocalFrame is alive when |
| 703 | // issuing this mojo call, there is no need to pass |
| 704 | // |initiator_policy_container_keep_alive_handle|, since the initiator |
| 705 | // PolicyContainerHost is kept alive by LocalFrame's PolicyContainer. |
Arthur Hemery | d3011f6 | 2018-05-30 10:38:44 | [diff] [blame] | 706 | // TODO(ahemery): |navigation_client| should not be optional. Make it |
Nasko Oskov | d22f9bf87 | 2020-12-23 00:31:35 | [diff] [blame] | 707 | // mandatory. |
Arthur Hemery | 7b67a97 | 2017-12-01 15:24:49 | [diff] [blame] | 708 | BeginNavigation( |
| 709 | CommonNavigationParams common_params, |
Marijn Kruisselbrink | 07bf59d5 | 2018-04-03 21:50:25 | [diff] [blame] | 710 | BeginNavigationParams begin_params, |
Julie Jeongeun Kim | 249cfbb | 2019-08-30 06:44:05 | [diff] [blame] | 711 | pending_remote<blink.mojom.BlobURLToken>? blob_url_token, |
Julie Jeongeun Kim | ed2e5ba7 | 2019-09-12 10:14:17 | [diff] [blame] | 712 | pending_associated_remote<NavigationClient>? navigation_client, |
Antonio Sartori | db967c5 | 2021-01-20 09:54:30 | [diff] [blame] | 713 | pending_remote<blink.mojom.NavigationInitiator>? navigation_initiator, |
| 714 | pending_remote<blink.mojom.PolicyContainerHostKeepAliveHandle>? |
| 715 | initiator_policy_container_keep_alive_handle); |
John Abd-El-Malek | d488264 | 2017-12-04 21:45:19 | [diff] [blame] | 716 | |
| 717 | // Sent when a subresource response has started. |
Jay Civelli | d5904f0 | 2018-03-23 19:43:57 | [diff] [blame] | 718 | // |cert_status| is the bitmask of status info of the SSL certificate. (see |
| 719 | // net/cert/cert_status_flags.h). |
Lukasz Anforowicz | d334bba | 2020-02-10 23:32:55 | [diff] [blame] | 720 | SubresourceResponseStarted(url.mojom.Url url, uint32 cert_status); |
Jay Civelli | d5904f0 | 2018-03-23 19:43:57 | [diff] [blame] | 721 | |
Jay Civelli | 116683f | 2018-03-27 19:56:23 | [diff] [blame] | 722 | // Sent when a resource load finished, successfully or not. |
Minggang Wang | ee5af39 | 2020-02-05 02:55:28 | [diff] [blame] | 723 | ResourceLoadComplete(blink.mojom.ResourceLoadInfo url_load_info); |
Luciano Pacheco | 8def47f | 2017-12-07 06:52:30 | [diff] [blame] | 724 | |
| 725 | // Sent when the frame changes its window.name. |
| 726 | DidChangeName(string name, string unique_name); |
| 727 | |
Austin Tankiang | 10d6483 | 2017-12-20 02:43:55 | [diff] [blame] | 728 | // If a cross-process navigation was started for the initial history load in |
| 729 | // this subframe, this tries to cancel it to allow a client redirect to happen |
| 730 | // instead. |
| 731 | CancelInitialHistoryLoad(); |
| 732 | |
| 733 | // Change the encoding name of the page in UI when the page has detected |
| 734 | // proper encoding name. Sent for top-level frames. |
| 735 | UpdateEncoding(string encoding_name); |
Lucas Furukawa Gadani | e5d27a36 | 2018-02-13 14:26:02 | [diff] [blame] | 736 | |
Clark DuVall | a0e4299 | 2018-09-17 17:00:11 | [diff] [blame] | 737 | // Updates information to determine whether a user gesture should carryover to |
| 738 | // future navigations. This is needed so navigations within a certain |
| 739 | // timeframe of a request initiated by a gesture will be treated as if they |
| 740 | // were initiated by a gesture too, otherwise the navigation may be blocked. |
| 741 | [EnableIf=is_android] |
| 742 | UpdateUserGestureCarryoverInfo(); |
Lowell Manners | 9499addc | 2019-03-12 11:05:32 | [diff] [blame] | 743 | |
Gyuyoung Kim | bc7dee64 | 2020-06-17 01:43:29 | [diff] [blame] | 744 | // Notifies the browser that this frame has new session history information. |
Ken Rockot | 4da6ac0 | 2020-10-27 01:28:25 | [diff] [blame] | 745 | // |
| 746 | // NOTE: PageState can be quite large when serialized, and its message |
| 747 | // structure must remain stable; hence [UnlimitedSize] for this message. |
| 748 | [UnlimitedSize] |
Gyuyoung Kim | bc7dee64 | 2020-06-17 01:43:29 | [diff] [blame] | 749 | UpdateState(PageState state); |
Gyuyoung Kim | 0028790a | 2020-06-26 00:09:00 | [diff] [blame] | 750 | |
| 751 | // Requests that the given URL be opened in the specified manner. |
Yeunjoo Choi | 9232ea3 | 2021-03-08 16:25:17 | [diff] [blame^] | 752 | OpenURL(blink.mojom.OpenURLParams params); |
Gyuyoung Kim | 847ecc7 | 2020-07-21 14:07:55 | [diff] [blame] | 753 | |
| 754 | // Called when the renderer is done loading a frame. |
| 755 | DidStopLoading(); |
ben | 76f52b24 | 2016-06-18 05:42:48 | [diff] [blame] | 756 | }; |