blob: 7db065f9737bded25a4c3f8879b10b3057508e38 [file] [log] [blame]
ben76f52b242016-06-18 05:42:481// 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
5module content.mojom;
6
Dave Tapuskafc4adbae2020-12-02 22:08:597import "cc/mojom/browser_controls_state.mojom";
Arthur Hemery9c035732019-01-07 16:12:418import "content/common/frame_messages.mojom";
Jeremy Roman62fee222019-07-09 17:34:149import "content/common/native_types.mojom";
Arthur Hemeryd3011f62018-05-30 10:38:4410import "content/common/navigation_client.mojom";
Arthur Hemery7b67a972017-12-01 15:24:4911import "content/common/navigation_params.mojom";
Miyoung Shin072d4052020-07-13 07:52:4412import "content/common/web_ui.mojom";
csharrison95f01e922017-04-24 18:52:3513import "content/public/common/window_container_type.mojom";
Mario Sanchez Prada13bbad52020-06-01 18:12:2914import "mojo/public/mojom/base/file_path.mojom";
Ken Rockot8b447d72018-02-03 20:30:4715import "mojo/public/mojom/base/string16.mojom";
Oksana Zhuravlova34579e912018-03-23 00:18:4916import "mojo/public/mojom/base/unguessable_token.mojom";
Hajime Hoshi35ad74f2019-03-07 08:38:0517import "mojo/public/mojom/base/values.mojom";
arthursonzogni42eabe012020-01-17 15:55:5618import "services/network/public/mojom/content_security_policy.mojom";
Ken Rockot54311e62018-02-10 19:01:5219import "services/network/public/mojom/url_loader.mojom";
Kinuko Yasudad795ac72018-07-11 08:07:5320import "services/network/public/mojom/url_loader_factory.mojom";
arthursonzogni42eabe012020-01-17 15:55:5621import "services/network/public/mojom/url_response_head.mojom";
Ken Rockot543f5e32018-02-04 02:13:5022import "services/service_manager/public/mojom/interface_provider.mojom";
Lucas Furukawa Gadani7bca98a2019-12-11 21:44:2523import "services/viz/public/mojom/compositing/frame_sink_id.mojom";
Miyoung Shin99505dd2019-07-27 12:45:3524import "services/viz/public/mojom/compositing/surface_id.mojom";
Blink Reformata30d4232018-04-07 15:31:0625import "third_party/blink/public/mojom/blob/blob_url_store.mojom";
Dave Tapuska4e60c232020-11-05 15:49:3226import "third_party/blink/public/mojom/browser_interface_broker.mojom";
Julie Jeongeun Kim42a90df2019-03-20 23:13:1027import "third_party/blink/public/mojom/commit_result/commit_result.mojom";
Lowell Mannersf03ea5a2019-04-23 11:47:5828import "third_party/blink/public/mojom/devtools/console_message.mojom";
Kevin McNeeea7f3b82020-02-27 21:42:3229import "third_party/blink/public/mojom/devtools/devtools_agent.mojom";
Gyuyoung Kim16a12f52020-12-19 04:24:2630import "third_party/blink/public/mojom/frame/frame.mojom";
Dave Tapuska4e60c232020-11-05 15:49:3231import "third_party/blink/public/mojom/frame/frame_owner_element_type.mojom";
32import "third_party/blink/public/mojom/frame/frame_owner_properties.mojom";
33import "third_party/blink/public/mojom/frame/frame_policy.mojom";
Dave Tapuskad6703f912019-01-31 23:13:1134import "third_party/blink/public/mojom/frame/lifecycle.mojom";
Andy Paicuc93d30862018-10-10 15:33:4535import "third_party/blink/public/mojom/frame/navigation_initiator.mojom";
Antonio Sartori7f809cc72020-10-30 07:47:2036import "third_party/blink/public/mojom/frame/policy_container.mojom";
Dave Tapuska4e60c232020-11-05 15:49:3237import "third_party/blink/public/mojom/frame/tree_scope_type.mojom";
Minggang Wangee5af392020-02-05 02:55:2838import "third_party/blink/public/mojom/loader/resource_load_info.mojom";
Hiroki Nakagawa753758342018-12-27 04:13:4939import "third_party/blink/public/mojom/loader/url_loader_factory_bundle.mojom";
Yuzu Saijoaae91702019-03-13 07:38:0540import "third_party/blink/public/mojom/messaging/transferable_message.mojom";
Yuzu Saijod46f498a2020-08-04 02:56:2241import "third_party/blink/public/mojom/page/page.mojom";
Dave Tapuska8499eec2020-03-16 17:54:3042import "third_party/blink/public/mojom/page/widget.mojom";
Lucas Furukawa Gadani89a74182019-01-10 19:33:2243import "third_party/blink/public/mojom/portal/portal.mojom";
Hiroki Nakagawa60693aa2020-07-16 09:01:4144import "third_party/blink/public/mojom/loader/referrer.mojom";
Hiroki Nakagawacdbc7912018-11-30 11:30:0545import "third_party/blink/public/mojom/service_worker/controller_service_worker.mojom";
Hiroki Nakagawa077f20962020-05-15 08:04:4446import "third_party/blink/public/mojom/service_worker/service_worker_container.mojom";
Chris Hamiltona46b15442020-07-31 14:38:5647import "third_party/blink/public/mojom/tokens/tokens.mojom";
Dave Tapuska9a31f412020-07-20 17:01:2848import "third_party/blink/public/mojom/widget/visual_properties.mojom";
Julie Jeongeun Kim42a90df2019-03-20 23:13:1049import "third_party/blink/public/mojom/window_features/window_features.mojom";
Mario Sanchez Prada5d7f1ac2020-07-16 17:18:4050import "ui/accessibility/mojom/ax_tree_update.mojom";
Julie Jeongeun Kim2b1d45a2019-06-28 23:37:5451import "ui/base/mojom/window_open_disposition.mojom";
Miyoung Shin87943f502019-07-26 13:31:5852import "ui/gfx/geometry/mojom/geometry.mojom";
Kevin McNeeea7f3b82020-02-27 21:42:3253import "url/mojom/origin.mojom";
54import "url/mojom/url.mojom";
ben76f52b242016-06-18 05:42:4855
Miyoung Shin5d77f72072020-10-09 15:14:2056[Native]
57struct PageState;
58
Mario Sanchez Prada13bbad52020-06-01 18:12:2959// Provided with each call to Frame::GetSerializedHtmlWithLocalLinks() so that
60// the renderer can notify the browser process each time that a chunk of HTML
61// data gets serialized, as well as when the entire process is finished.
62interface FrameHTMLSerializerHandler {
63 // Sent by the renderer as a response to GetSerializedHtmlWithLocalLinks() to
64 // indicate that HTML data has been serialized, included in |data_buffer|.
65 DidReceiveData(string data_buffer);
66
67 // Reports that the serialization process is finished. It is expected to
68 // receive this message right after the last time DidReceiveData() is called.
69 Done();
70};
71
ben76f52b242016-06-18 05:42:4872// Implemented by the frame provider (e.g. renderer processes).
73interface Frame {
Gyuyoung Kim6c9ce9022019-11-26 05:40:0874 GetInterfaceProvider(
75 pending_receiver<service_manager.mojom.InterfaceProvider> interfaces);
Daniel Cheng118f9e282017-11-10 03:28:4476 GetCanonicalUrlForSharing() => (url.mojom.Url? canonical_url);
Luciano Pacheco8528c16f2017-12-14 07:10:5677
John Abd-El-Malek9405d80e2018-08-08 16:50:2178 // Causes all new subresource requests to be blocked (not being started) until
79 // ResumeBlockedRequests is called.
80 BlockRequests();
81
82 // Resumes blocked requests.
83 // It is safe to call this without calling BlockRequests.
84 ResumeBlockedRequests();
85
Luciano Pacheco8528c16f2017-12-14 07:10:5686 // Samsung Galaxy Note-specific "smart clip" stylus text getter.
87 // Extracts the data at the given rect.
Eve Martin-Jones40f552c2018-02-14 22:47:3288 [EnableIf=is_android]
Luciano Pacheco8528c16f2017-12-14 07:10:5689 ExtractSmartClipData(gfx.mojom.Rect rect)
Mahesh Machavolu346cd2662018-05-24 12:40:1190 => (mojo_base.mojom.String16 text, mojo_base.mojom.String16 html,
91 gfx.mojom.Rect clip_rect);
Scott Violet0de3837c2019-09-06 22:51:5492
Mario Sanchez Prada749007a2020-03-13 16:48:2993 // Requests a one-time snapshot of the accessibility tree without enabling
94 // accessibility if it wasn't already enabled.
95 // See ui/accessibility/ax_mode.h for valid values of |ax_mode|.
Ken Rockot4da6ac02020-10-27 01:28:2596 //
97 // TODO(crbug.com/1141990): AXTreeUpdate can be quite large, hence the
98 // [UnlimitedSize] tag. It may be possible to remove this if AXTreeUpdate
99 // can be reworked to avoid very large serialized values.
Mario Sanchez Prada749007a2020-03-13 16:48:29100 SnapshotAccessibilityTree(uint32 ax_mode)
Mario Sanchez Prada5d7f1ac2020-07-16 17:18:40101 => (ax.mojom.AXTreeUpdate snapshot);
Mario Sanchez Prada13bbad52020-06-01 18:12:29102
103 // Get HTML data by serializing the target frame and replacing all resource
104 // links with a path to the local copy passed in the message payload. In order
105 // to report progress to the the browser process, a pending remote is passed
106 // via |callback_remote|, so that direct communication with the SavePackage
107 // object that initiated the process can be established.
108 GetSerializedHtmlWithLocalLinks(
109 map<url.mojom.Url, mojo_base.mojom.FilePath> url_map,
110 map<mojo_base.mojom.UnguessableToken, mojo_base.mojom.FilePath>
111 frame_token_map, bool save_with_empty_url,
112 pending_remote<FrameHTMLSerializerHandler> handler_remote);
ben76f52b242016-06-18 05:42:48113};
114
Ken Rockot48785452017-10-25 19:33:14115// Implemented by the frame provider and currently must be associated with the
116// legacy IPC channel.
Arthur Hemeryd3011f62018-05-30 10:38:44117// KEEP THE COMMIT FUNCTIONS IN SYNC in content/common/navigation_client.mojom.
118// These will eventually be removed from FrameNavigationControl.
Ken Rockot48785452017-10-25 19:33:14119interface FrameNavigationControl {
clamyaf4bf2d92018-02-06 10:54:36120 // Tells the renderer that a same-document navigation should be committed.
121 // The renderer will return a status value indicating whether the commit
122 // could proceed as expected or not. In particular, it might be necessary to
123 // restart the navigation if it is no-longer same-document, which can happen
124 // if the renderer committed another navigation in the meantime.
125 CommitSameDocumentNavigation(
126 CommonNavigationParams common_params,
Nasko Oskovc36327d2019-01-03 23:23:04127 CommitNavigationParams request_params)
clamyaf4bf2d92018-02-06 10:54:36128 => (blink.mojom.CommitResult commit_result);
129
clamyb1df7b962018-02-01 17:38:17130 // Asks the renderer to handle a renderer-debug URL.
131 HandleRendererDebugURL(url.mojom.Url url);
132
Chong Zhang7306b0b2018-01-24 05:59:24133 // Provides the renderer an updated |subresource_loader_factories|.
134 //
135 // This method is intended to fix broken loaders after a Network Service
136 // crash, and is only used when Network Service is enabled.
137 //
138 // The new bundle contains replacement factories for a subset of the
139 // receiver's existing bundle.
140 UpdateSubresourceLoaderFactories(
Hiroki Nakagawa753758342018-12-27 04:13:49141 blink.mojom.URLLoaderFactoryBundle subresource_loader_factories);
Dmitry Gozman6adf95b2018-10-10 22:12:19142
143 // Returns a DevToolsAgent interface for this frame, used for
144 // remote debugging. See DevToolsAgent for details.
145 // Returned DevToolsAgent must be associated with navigation control,
146 // due to various ordering dependencies between DevTools protocol and
147 // navigation.
Julie Jeongeun Kim07887792019-08-13 11:05:48148 BindDevToolsAgent(
149 pending_associated_remote<blink.mojom.DevToolsAgentHost> agent_host,
Andrey Kosyakov5bb020f2020-03-19 17:28:19150 pending_associated_receiver<blink.mojom.DevToolsAgent> agent);
Hajime Hoshi35ad74f2019-03-07 08:38:05151
Maksim Sadymcfb8f8d2020-09-30 20:30:45152 // Request for the renderer to execute a given JavaScript method on a given
153 // object (both identified by name) in the frame's context.
154 //
155 // |object_name| is the global name of the object.
156 //
157 // |method_name| is the name of the method on the object.
158 //
159 // |arguments| is the list of arguments to pass to the method invocation.
160 //
161 // |wants_result| is true if the result of this execution is required by the
162 // caller. If it is false, a reply is still required by Mojo, but a null value
163 // should be returned to avoid issues serializing a large, unwanted reply.
164 JavaScriptMethodExecuteRequest(
165 mojo_base.mojom.String16 object_name,
166 mojo_base.mojom.String16 method_name,
167 mojo_base.mojom.ListValue arguments,
168 bool wants_result) => (mojo_base.mojom.Value result);
169
Hajime Hoshi35ad74f2019-03-07 08:38:05170 // Request for the renderer to execute JavaScript in the frame's context.
171 //
172 // |javascript| is the string containing the JavaScript to be executed in the
Avi Drissman90630d92020-04-29 21:17:36173 // target frame's context. Note that this uses BigString16 rather than
174 // String16 as this is used in contexts, like DevTools, where the contents of
175 // the JavaScript script is user-provided, and therefore we can't guarantee
176 // the size of the script.
Hajime Hoshi35ad74f2019-03-07 08:38:05177 //
Avi Drissman8e3ebe92019-06-10 20:26:11178 // |wants_result| is true if the result of this execution is required by the
179 // caller. If it is false, a reply is still required by Mojo, but a null value
180 // should be returned to avoid issues serializing a large, unwanted reply.
181 //
Hajime Hoshi35ad74f2019-03-07 08:38:05182 // TODO(hajimehoshi): This requires navigate association to keep the message
183 // order with other navigation-related messages. Fix this and move this to a
184 // non-navigate-related interface if possible.
Avi Drissman4544828f2019-03-11 20:37:32185 JavaScriptExecuteRequest(
Avi Drissman90630d92020-04-29 21:17:36186 mojo_base.mojom.BigString16 javascript,
Avi Drissman8e3ebe92019-06-10 20:26:11187 bool wants_result) => (mojo_base.mojom.Value result);
Hajime Hoshi35ad74f2019-03-07 08:38:05188
Mustaq Ahmed02cd8832019-12-05 15:46:56189 // ONLY FOR TESTS: Same as above but this can optionally trigger a fake user
190 // activation notification to test functionalities that are gated by user
191 // activation.
Avi Drissman4544828f2019-03-11 20:37:32192 JavaScriptExecuteRequestForTests(
Avi Drissman90630d92020-04-29 21:17:36193 mojo_base.mojom.BigString16 javascript,
Avi Drissman8e3ebe92019-06-10 20:26:11194 bool wants_result,
Hajime Hoshif85e7cf722019-07-19 00:54:49195 bool has_user_gesture,
196 int32 world_id)
Avi Drissman4544828f2019-03-11 20:37:32197 => (mojo_base.mojom.Value result);
Hajime Hoshi35ad74f2019-03-07 08:38:05198
199 // Same as JavaScriptExecuteRequest above except the script is run in the
200 // isolated world specified by the fourth parameter.
Avi Drissman4544828f2019-03-11 20:37:32201 JavaScriptExecuteRequestInIsolatedWorld(
Avi Drissman90630d92020-04-29 21:17:36202 mojo_base.mojom.BigString16 javascript,
Avi Drissman8e3ebe92019-06-10 20:26:11203 bool wants_result,
Avi Drissman4544828f2019-03-11 20:37:32204 int32 world_id) => (mojo_base.mojom.Value result);
Yuzu Saijoaae91702019-03-13 07:38:05205
Ian Barkley-Yeungbda77fb2020-12-08 04:26:46206 // Indicates that the frame host (browser) wants the |untrusted_stack_trace|
207 // parameter of DidAddMessageToConsole() filled in for Error messages if at
208 // all possible.
209 SetWantErrorMessageStackTrace();
210
Gyuyoung Kim11aad0b62020-04-29 16:00:26211 // Requests that a provisional RenderFrame swap itself into the frame tree,
212 // replacing the RenderFrameProxy that it is associated with. This is used
213 // with remote-to-local frame navigations when the RenderFrameProxy
214 // corresponds to a non-live (crashed) frame. In that case, the browser
215 // process will send this message as part of an early commit to stop showing
216 // the sad iframe without waiting for the provisional RenderFrame's navigation
217 // to commit.
218 SwapIn();
Ken Rockot48785452017-10-25 19:33:14219};
220
sammc7f6c6a02017-01-30 00:53:51221// Implemented by the frame (e.g. renderer processes).
222// Instances of this interface must be associated with (i.e., FIFO with) the
223// legacy IPC channel.
224interface FrameBindingsControl {
225 // Used to tell a render frame whether it should expose various bindings
226 // that allow JS content extended privileges. See BindingsPolicy for valid
227 // flag values.
228 AllowBindings(int32 enabled_bindings_flags);
Nasko Oskov8a73f7d2019-09-27 22:29:32229
230 // Used to tell the RenderFrame to enable Mojo JS bindings, which allows
231 // JS code running in the renderer process to connect to Mojo interfaces
232 // and make method calls on them.
233 // This is used for WebUI only at this time.
234 EnableMojoJsBindings();
Miyoung Shin072d4052020-07-13 07:52:44235
236 // Used to bind WebUI and WebUIHost mojo connections.
Daniel Cheng4b931a4f2020-12-18 01:59:35237 BindWebUI(pending_associated_receiver<content.mojom.WebUI> receiver,
238 pending_associated_remote<content.mojom.WebUIHost> remote);
sammc7f6c6a02017-01-30 00:53:51239};
240
ben76f52b242016-06-18 05:42:48241// Implemented by a service that provides implementations of the Frame
242// interface. (e.g. renderer processes).
243interface FrameFactory {
Henrique Ferreiro3a9751c2019-09-30 13:54:07244 CreateFrame(int32 frame_routing_id, pending_receiver<Frame> frame);
csharrison95f01e922017-04-24 18:52:35245};
246
csharrison95f01e922017-04-24 18:52:35247struct CreateNewWindowParams {
Mustaq Ahmed8601a562020-01-31 18:05:52248 // True if ContentRendererClient allows popups. This is the case only for
249 // extensions.
250 bool allow_popup;
csharrison95f01e922017-04-24 18:52:35251
252 // Type of window requested.
253 WindowContainerType window_container_type;
254
255 // The session storage namespace ID this window should use.
Daniel Murphy31bbb8b12018-02-07 21:44:10256 string session_storage_namespace_id;
csharrison95f01e922017-04-24 18:52:35257
Daniel Murphye3eec92c2018-02-23 19:09:15258 // The session storage namespace ID this window should clone from.
259 // TODO(dmurph): Remove this once session storage is fully mojo'd, as the
260 // clone call happens on a different interface. https://crbug.com/716490
261 string clone_from_session_storage_namespace_id;
262
csharrison95f01e922017-04-24 18:52:35263 // The name of the resulting frame that should be created (empty if none
264 // has been specified). UTF8 encoded string.
265 string frame_name;
266
csharrison95f01e922017-04-24 18:52:35267 // Whether the opener will be suppressed in the new window, in which case
268 // scripting the new window is not allowed.
269 bool opener_suppressed;
270
271 // Whether the window should be opened in the foreground, background, etc.
272 ui.mojom.WindowOpenDisposition disposition;
273
274 // The URL that will be loaded in the new window (empty if none has been
275 // specified).
276 url.mojom.Url target_url;
277
278 // The referrer that will be used to load |target_url| (empty if none has
279 // been specified).
280 blink.mojom.Referrer referrer;
281
282 // The window features to use for the new window.
283 blink.mojom.WindowFeatures features;
John Delaney8623c642021-01-06 17:37:07284
285 // The impression associated with the navigation in the new window, if
286 // one is specified.
287 Impression? impression;
csharrison95f01e922017-04-24 18:52:35288};
289
Daniel Cheng8bb30c62017-10-23 20:40:47290// Operation result when the renderer asks the browser to create a new window.
291enum CreateNewWindowStatus {
292 // Ignore creation of the new window. This can happen because creation is
293 // blocked or because the new window should have no opener relationship.
294 kIgnore,
295 // Reuse the current window rather than creating a new window.
296 kReuse,
297 // Create a new window using the corresponding params in |reply|.
298 kSuccess,
299};
300
301// All routing IDs in this struct must be set to a valid routing ID.
csharrison95f01e922017-04-24 18:52:35302struct CreateNewWindowReply {
Daniel Cheng8bb30c62017-10-23 20:40:47303 // The ID of the view to be created.
csharrison95f01e922017-04-24 18:52:35304 int32 route_id;
305
306 // The ID of the main frame hosted in the view.
307 int32 main_frame_route_id;
308
Dave Tapuska84449382020-05-01 00:39:04309 // The unique identifier of the RenderFrameHost
310 mojo_base.mojom.UnguessableToken main_frame_frame_token;
311
csharrison95f01e922017-04-24 18:52:35312 // The ID of the widget for the main frame.
313 int32 main_frame_widget_route_id;
314
danakjbe56b8132019-10-12 00:57:41315 // Initial properties for the main frame RenderWidget.
Dave Tapuska9a31f412020-07-20 17:01:28316 blink.mojom.VisualProperties visual_properties;
danakjbe56b8132019-10-12 00:57:41317
Dave Tapuska8499eec2020-03-16 17:54:30318 // The communication interfaces for the WebFrameWidget in blink.
319 pending_associated_remote<blink.mojom.FrameWidgetHost> frame_widget_host;
320 pending_associated_receiver<blink.mojom.FrameWidget> frame_widget;
321 pending_associated_remote<blink.mojom.WidgetHost> widget_host;
322 pending_associated_receiver<blink.mojom.Widget> widget;
323
Yuzu Saijod46f498a2020-08-04 02:56:22324 // The communication interfaces for the PageBroadcast.
325 pending_associated_receiver<blink.mojom.PageBroadcast> page_broadcast;
326
Ken Rockotc4a0ada92020-12-02 00:22:14327 pending_remote<blink.mojom.BrowserInterfaceBroker>
328 main_frame_interface_broker;
Balazs Engedyba034e72017-10-27 22:26:28329
csharrison95f01e922017-04-24 18:52:35330 // Duplicated from CreateNewWindowParams because legacy code.
Daniel Murphy31bbb8b12018-02-07 21:44:10331 string cloned_session_storage_namespace_id;
Pavel Feldman08beed7842017-10-17 19:18:11332
333 // Used for devtools instrumentation and trace-ability. The token is
334 // propagated to Blink's LocalFrame and both Blink and content/
335 // can tag calls and requests with this instrumentation token in order to
336 // attribute them to the context frame.
337 // |devtools_frame_token| is only defined by the browser and is never
338 // sent back from the renderer in the control calls.
Oksana Zhuravlova34579e912018-03-23 00:18:49339 mojo_base.mojom.UnguessableToken devtools_main_frame_token;
Yury Semikhatsky82730ff2020-02-25 22:29:26340
341 // Used by devtools instrumentation to tell devtools agent in the renderer
342 // that it should pause created window and wait for an explicit resume command
343 // from the client.
344 bool wait_for_debugger;
Antonio Sartori7f809cc72020-10-30 07:47:20345
346 // The policy container for the new frame that will be created by Blink in
347 // response.
Antonio Sartori9290b6b2020-11-09 10:09:33348 blink.mojom.PolicyContainer policy_container;
csharrison95f01e922017-04-24 18:52:35349};
350
Gyuyoung Kim0028790a2020-06-26 00:09:00351// This struct holds parameters included in the OpenURL method sent by the
352// renderer to the browser, |is_history_navigation_in_new_child_frame| is true
353// in the case that the browser process should look for an existing history item
354// for the frame.
355struct OpenURLParams {
356 // The main URL to open.
357 url.mojom.Url url;
358 url.mojom.Origin initiator_origin;
Antonio Sartori9a82f6f32020-12-14 09:22:45359
360 // The token of the RenderFrameHost that initiated the navigation. It might
361 // refer to a RenderFrameHost that doesn't exist anymore when the IPC reaches
362 // the browser process.
363 mojo_base.mojom.UnguessableToken? initiator_frame_token;
364
Gyuyoung Kim0028790a2020-06-26 00:09:00365 network.mojom.URLRequestBody? post_body;
366 string extra_headers;
367 blink.mojom.Referrer referrer;
368
369 // The window position to open the URL.
370 ui.mojom.WindowOpenDisposition disposition;
371 bool should_replace_current_entry;
372 bool user_gesture;
373
374 // Extra information about the triggering of the OpenURL.
Gyuyoung Kim16a12f52020-12-19 04:24:26375 blink.mojom.TriggeringEventInfo triggering_event_info;
Daniel Cheng13251e52020-11-25 17:41:23376 pending_remote<blink.mojom.BlobURLToken>? blob_url_token;
Gyuyoung Kim0028790a2020-06-26 00:09:00377 string href_translate;
378 Impression? impression;
379 NavigationDownloadPolicy download_policy;
380};
381
csharrison95f01e922017-04-24 18:52:35382// Implemented by the frame server (i.e. the browser process). For messages that
383// must be associated with the IPC channel.
384interface FrameHost {
Daniel Cheng8bb30c62017-10-23 20:40:47385 // Sent by the renderer to request the browser to create a new window. |reply|
386 // is only non-null on when status == CreateNewWindowStatus::kSuccess.
csharrison95f01e922017-04-24 18:52:35387 [Sync] CreateNewWindow(CreateNewWindowParams params)
Daniel Cheng8bb30c62017-10-23 20:40:47388 => (CreateNewWindowStatus status, CreateNewWindowReply? reply);
Yutaka Hiranof7f2f632017-09-06 10:40:08389
Lucas Furukawa Gadani99125822019-01-03 15:41:49390 // Sent by the renderer process to request the creation of a new portal.
Adithya Srinivasane8bf80e2019-05-01 15:39:31391 // |portal| is the pipe to be used for the Portal object, |client| is the pipe
Dave Tapuska84449382020-05-01 00:39:04392 // used to communicate back with the caller. Returns:
393 // |proxy_routing_id| - the routing id of the RenderFrameProxy
394 // |initial_replicated_state| - the replicated state associated with that
395 // RenderFrameProxy
396 // |portal_token| - the unique identifier for the portal
397 // |frame_token| - the unique identifier of the RenderFrameProxy
398 // |devtools_frame_token| - the unique identifier of the frame node in the
399 // frame tree
Jeremy Romand92e1372019-06-04 16:31:17400 [Sync] CreatePortal(
401 pending_associated_receiver<blink.mojom.Portal> portal,
402 pending_associated_remote<blink.mojom.PortalClient> client)
Lucas Furukawa Gadani99125822019-01-03 15:41:49403 => (int32 proxy_routing_id,
Kevin McNee51ef5dc2020-01-13 17:52:37404 FrameReplicationState initial_replicated_state,
Adithya Srinivasanea4760c2020-07-30 15:44:57405 blink.mojom.PortalToken portal_token,
Dave Tapuska84449382020-05-01 00:39:04406 mojo_base.mojom.UnguessableToken frame_token,
Lucas Furukawa Gadanif68204d2019-04-30 17:30:24407 mojo_base.mojom.UnguessableToken devtools_frame_token);
Lucas Furukawa Gadani99125822019-01-03 15:41:49408
Lucas Furukawa Gadani56dd5452019-03-22 18:23:12409 // Requests that this frame adopts the portal identified by |portal_token|.
Dave Tapuska84449382020-05-01 00:39:04410 // Returns:
411 // |proxy_routing_id| - the routing id of the portal's RenderFrameProxy
412 // |replicated_state| - the replicated state associated with that
413 // RenderFrameProxy
414 // |frame_token| - the unique identifier of the RenderFrameProxy
415 // |devtools_frame_token| - the unique identifier of the frame node in the
416 // frame tree
Adithya Srinivasanea4760c2020-07-30 15:44:57417 [Sync] AdoptPortal(blink.mojom.PortalToken portal_token)
Lucas Furukawa Gadanif68204d2019-04-30 17:30:24418 => (int32 proxy_routing_id,
Lucas Furukawa Gadani7bca98a2019-12-11 21:44:25419 viz.mojom.FrameSinkId frame_sink_id,
Jeremy Roman62fee222019-07-09 17:34:14420 FrameReplicationState replicated_state,
Dave Tapuska84449382020-05-01 00:39:04421 mojo_base.mojom.UnguessableToken frame_token,
Lucas Furukawa Gadanif68204d2019-04-30 17:30:24422 mojo_base.mojom.UnguessableToken devtools_frame_token);
Lucas Furukawa Gadani56dd5452019-03-22 18:23:12423
Dave Tapuskad9835622020-03-10 17:32:31424
425 // Similar to CreateNewWindow, except used for sub-widgets, like <select>
Dave Tapuska04ccda062020-10-21 21:58:12426 // dropdowns. Upon return, the renderer side popup will be owned by the
427 // PopupWidgetHost.
Dave Tapuskad95cfb32020-11-02 17:04:55428 CreateNewPopupWidget(
Dave Tapuska04ccda062020-10-21 21:58:12429 pending_associated_receiver<blink.mojom.PopupWidgetHost> popup_host,
Dave Tapuska8499eec2020-03-16 17:54:30430 pending_associated_receiver<blink.mojom.WidgetHost> blink_widget_host,
Dave Tapuskad95cfb32020-11-02 17:04:55431 pending_associated_remote<blink.mojom.Widget> blink_widget);
Dave Tapuskad9835622020-03-10 17:32:31432
Dave Tapuska4e60c232020-11-05 15:49:32433 // Asynchronously creates a child frame. A routing ID must be allocated first
434 // by calling RenderMessageFilter::GenerateFrameRoutingID()
435 // Each of these messages will have a corresponding mojom::FrameHost::Detach
436 // API sent when the frame is detached from the DOM.
437 CreateChildFrame(int32 child_routing_id,
Dave Tapuska4e60c232020-11-05 15:49:32438 pending_receiver<blink.mojom.BrowserInterfaceBroker>
439 browser_interface_broker,
Antonio Sartoria1fd1432020-11-25 09:10:20440 pending_associated_receiver<blink.mojom.PolicyContainerHost>
441 policy_container_associated_receiver,
Dave Tapuska4e60c232020-11-05 15:49:32442 blink.mojom.TreeScopeType scope,
443 string frame_name,
444 string frame_unique_name,
445 bool is_created_by_script,
446 blink.mojom.FramePolicy frame_policy,
447 blink.mojom.FrameOwnerProperties frame_owner_properties,
448 blink.mojom.FrameOwnerElementType frame_owner_element_type);
449
Balazs Engedya40712f2017-09-15 15:01:11450 // Sent by the renderer when a navigation commits in the frame.
Oksana Zhuravlova8b88e572019-01-07 21:54:00451
452 // If |interface_params| is non-empty, the FrameHost implementation
Ken Rockot228182e2020-12-01 18:43:59453 // must unbind the old BrowserInterfaceBroker connections, and drop any
454 // interface requests pending on them. Then it should bind the appropriate
455 // requests and start servicing GetInterface messages coming in on these new
456 // connections in a security context that is appropriate for the committed
457 // navigation.
Balazs Engedy0c8d550b2017-12-06 21:30:23458 //
Oksana Zhuravlova8b88e572019-01-07 21:54:00459 // The FrameHost implementation must enforce that |interface_params|
Balazs Engedy0c8d550b2017-12-06 21:30:23460 // is set for cross-document navigations. This prevents origin confusion by
461 // ensuring that interface requests racing with navigation commit will be
462 // either ignored, or serviced correctly in the security context of the
Ken Rockot228182e2020-12-01 18:43:59463 // document they originated from (based on which BrowserInterfaceBroker
464 // connection the GetInterface messages arrive on).
Balazs Engedya40712f2017-09-15 15:01:11465 DidCommitProvisionalLoad(
Balazs Engedy0c8d550b2017-12-06 21:30:23466 DidCommitProvisionalLoadParams params,
Oksana Zhuravlova8b88e572019-01-07 21:54:00467 DidCommitProvisionalLoadInterfaceParams? interface_params);
Arthur Hemery7b67a972017-12-01 15:24:49468
Arthur Hemery7b0ae492018-02-05 16:04:45469 // Sent by the renderer to indicate that a same document navigation
470 // committed in the renderer process.
471 DidCommitSameDocumentNavigation(
Rakina Zata Amni26357782020-12-03 11:45:01472 DidCommitProvisionalLoadParams params,
473 DidCommitSameDocumentNavigationParams same_document_params);
Arthur Hemery7b0ae492018-02-05 16:04:45474
Arthur Hemery7b67a972017-12-01 15:24:49475 // Sent by the renderer to request a navigation.
Marijn Kruisselbrink07bf59d52018-04-03 21:50:25476 // |blob_url_token| should be non-null when this is a navigation to a blob:
477 // URL. The token will then be used to look up the blob associated with the
478 // blob URL. Without this by the time the navigation code starts fetching
479 // the URL the blob URL might no longer be valid. |blob_url_token| is
480 // not part of BeginNavigationParams because that struct needs to be
481 // cloneable, and thus can't contain mojo interfaces.
482 // If an invalid BlobURLToken is passed in, or if the token doesn't match the
483 // url in |common_params|, the navigation will result in a network error.
Arthur Hemeryd3011f62018-05-30 10:38:44484 // |navigation_client| is passed to the renderer to allow for further control
Nasko Oskovd22f9bf872020-12-23 00:31:35485 // of the navigation. Allows for Commit and Cancels/Aborts.
Arthur Hemeryd3011f62018-05-30 10:38:44486 // TODO(ahemery): |navigation_client| should not be optional. Make it
Nasko Oskovd22f9bf872020-12-23 00:31:35487 // mandatory.
Arthur Hemery7b67a972017-12-01 15:24:49488 BeginNavigation(
489 CommonNavigationParams common_params,
Marijn Kruisselbrink07bf59d52018-04-03 21:50:25490 BeginNavigationParams begin_params,
Julie Jeongeun Kim249cfbb2019-08-30 06:44:05491 pending_remote<blink.mojom.BlobURLToken>? blob_url_token,
Julie Jeongeun Kimed2e5ba72019-09-12 10:14:17492 pending_associated_remote<NavigationClient>? navigation_client,
Miyoung Shinda5da322019-09-02 10:07:37493 pending_remote<blink.mojom.NavigationInitiator>? navigation_initiator);
John Abd-El-Malekd4882642017-12-04 21:45:19494
495 // Sent when a subresource response has started.
Jay Civellid5904f02018-03-23 19:43:57496 // |cert_status| is the bitmask of status info of the SSL certificate. (see
497 // net/cert/cert_status_flags.h).
Lukasz Anforowiczd334bba2020-02-10 23:32:55498 SubresourceResponseStarted(url.mojom.Url url, uint32 cert_status);
Jay Civellid5904f02018-03-23 19:43:57499
Jay Civelli116683f2018-03-27 19:56:23500 // Sent when a resource load finished, successfully or not.
Minggang Wangee5af392020-02-05 02:55:28501 ResourceLoadComplete(blink.mojom.ResourceLoadInfo url_load_info);
Luciano Pacheco8def47f2017-12-07 06:52:30502
503 // Sent when the frame changes its window.name.
504 DidChangeName(string name, string unique_name);
505
Austin Tankiang10d64832017-12-20 02:43:55506 // If a cross-process navigation was started for the initial history load in
507 // this subframe, this tries to cancel it to allow a client redirect to happen
508 // instead.
509 CancelInitialHistoryLoad();
510
511 // Change the encoding name of the page in UI when the page has detected
512 // proper encoding name. Sent for top-level frames.
513 UpdateEncoding(string encoding_name);
Lucas Furukawa Gadanie5d27a362018-02-13 14:26:02514
Lucas Gadani471160f92018-03-01 03:13:21515 // The frame's size is replicated in the browser so that the browser can
516 // correctly set the initial size of the frame in case of a cross-process
517 // navigation.
518 FrameSizeChanged(gfx.mojom.Size size);
Becca Hughesfd5d8f892018-06-14 18:23:36519
Clark DuValla0e42992018-09-17 17:00:11520 // Updates information to determine whether a user gesture should carryover to
521 // future navigations. This is needed so navigations within a certain
522 // timeframe of a request initiated by a gesture will be treated as if they
523 // were initiated by a gesture too, otherwise the navigation may be blocked.
524 [EnableIf=is_android]
525 UpdateUserGestureCarryoverInfo();
Lowell Manners9499addc2019-03-12 11:05:32526
Ian Barkley-Yeung07d8a262020-11-19 22:45:35527 // Blink and JavaScript error messages to log to the console, debugger UI, or
528 // error reporting service. |source_id| is usually a URL.
529 // |untrusted_stack_trace| should only be printed or sent to other services;
530 // it's untrusted and should not be parsed to get a structured stack trace.
Ian Barkley-Yeungbda77fb2020-12-08 04:26:46531 // The stack trace is only present if
532 // FrameNavigationControl.SetWantErrorMessageStackTrace has been called for
533 // this frame and the log_level is kError.
Lowell Mannersf03ea5a2019-04-23 11:47:58534 DidAddMessageToConsole(
535 blink.mojom.ConsoleMessageLevel log_level,
536 mojo_base.mojom.BigString16 msg,
537 int32 line_number,
Ian Barkley-Yeung07d8a262020-11-19 22:45:35538 mojo_base.mojom.String16 source_id,
539 mojo_base.mojom.BigString16? untrusted_stack_trace);
Lowell Mannersf03ea5a2019-04-23 11:47:58540
Gyuyoung Kimbc7dee642020-06-17 01:43:29541 // Notifies the browser that this frame has new session history information.
Ken Rockot4da6ac02020-10-27 01:28:25542 //
543 // NOTE: PageState can be quite large when serialized, and its message
544 // structure must remain stable; hence [UnlimitedSize] for this message.
545 [UnlimitedSize]
Gyuyoung Kimbc7dee642020-06-17 01:43:29546 UpdateState(PageState state);
Gyuyoung Kim0028790a2020-06-26 00:09:00547
548 // Requests that the given URL be opened in the specified manner.
549 OpenURL(OpenURLParams params);
Gyuyoung Kim847ecc72020-07-21 14:07:55550
551 // Called when the renderer is done loading a frame.
552 DidStopLoading();
ben76f52b242016-06-18 05:42:48553};