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