blob: 380029a373ce17816824c18803ed68380276eaa1 [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
Oksana Zhuravlova8b88e572019-01-07 21:54:007import "content/common/document_scoped_interface_bundle.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";
John Abd-El-Malekd4882642017-12-04 21:45:1912import "content/public/common/resource_type.mojom";
Jay Civelli116683f2018-03-27 19:56:2313import "content/public/common/resource_load_info.mojom";
John Abd-El-Malekecc6f5f2018-03-02 18:47:3914import "content/public/common/transferrable_url_loader.mojom";
csharrison95f01e922017-04-24 18:52:3515import "content/public/common/window_container_type.mojom";
Ken Rockot8b447d72018-02-03 20:30:4716import "mojo/public/mojom/base/string16.mojom";
Oksana Zhuravlova34579e912018-03-23 00:18:4917import "mojo/public/mojom/base/unguessable_token.mojom";
Hajime Hoshi35ad74f2019-03-07 08:38:0518import "mojo/public/mojom/base/values.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";
Ken Rockot543f5e32018-02-04 02:13:5021import "services/service_manager/public/mojom/interface_provider.mojom";
Miyoung Shin99505dd2019-07-27 12:45:3522import "services/viz/public/mojom/compositing/surface_id.mojom";
Blink Reformata30d4232018-04-07 15:31:0623import "third_party/blink/public/mojom/blob/blob_url_store.mojom";
Julie Jeongeun Kim42a90df2019-03-20 23:13:1024import "third_party/blink/public/mojom/commit_result/commit_result.mojom";
Lowell Mannersf03ea5a2019-04-23 11:47:5825import "third_party/blink/public/mojom/devtools/console_message.mojom";
Blink Reformata30d4232018-04-07 15:31:0626import "third_party/blink/public/mojom/feature_policy/feature_policy.mojom";
Dave Tapuskad6703f912019-01-31 23:13:1127import "third_party/blink/public/mojom/frame/lifecycle.mojom";
Andy Paicuc93d30862018-10-10 15:33:4528import "third_party/blink/public/mojom/frame/navigation_initiator.mojom";
Jeremy Roman3c83b162019-03-12 16:55:5229import "third_party/blink/public/mojom/messaging/transferable_message.mojom";
Hiroki Nakagawa753758342018-12-27 04:13:4930import "third_party/blink/public/mojom/loader/url_loader_factory_bundle.mojom";
Yuzu Saijoaae91702019-03-13 07:38:0531import "third_party/blink/public/mojom/messaging/transferable_message.mojom";
Lucas Furukawa Gadani89a74182019-01-10 19:33:2232import "third_party/blink/public/mojom/portal/portal.mojom";
Leon Han075e0b32018-11-06 07:59:4433import "third_party/blink/public/mojom/referrer.mojom";
Hiroki Nakagawacdbc7912018-11-30 11:30:0534import "third_party/blink/public/mojom/service_worker/controller_service_worker.mojom";
Leon Han49c3ff62019-03-13 00:08:0135import "third_party/blink/public/mojom/service_worker/service_worker_provider.mojom";
Hiroki Nakagawa7c0a7e72018-12-10 04:31:2936import "third_party/blink/public/mojom/devtools/devtools_agent.mojom";
Lucas Furukawa Gadani99125822019-01-03 15:41:4937import "third_party/blink/public/mojom/portal/portal.mojom";
Julie Jeongeun Kim42a90df2019-03-20 23:13:1038import "third_party/blink/public/mojom/window_features/window_features.mojom";
Julie Jeongeun Kim2b1d45a2019-06-28 23:37:5439import "ui/base/mojom/window_open_disposition.mojom";
Daniel Cheng7a059b02018-02-03 10:04:1340import "url/mojom/url.mojom";
Adithya Srinivasan57f44d0d2019-03-22 15:36:0241import "url/mojom/origin.mojom";
Miyoung Shin87943f502019-07-26 13:31:5842import "ui/gfx/geometry/mojom/geometry.mojom";
ben76f52b242016-06-18 05:42:4843
ben275a5652016-10-28 16:55:5044// The name of the InterfaceProviderSpec in service manifests used by the
45// frame tree to expose frame-specific interfaces between renderer and browser.
46const string kNavigation_FrameSpec = "navigation:frame";
47
ben76f52b242016-06-18 05:42:4848// Implemented by the frame provider (e.g. renderer processes).
49interface Frame {
rockot400ea35b2016-10-15 19:15:3250 GetInterfaceProvider(service_manager.mojom.InterfaceProvider& interfaces);
Daniel Cheng118f9e282017-11-10 03:28:4451 GetCanonicalUrlForSharing() => (url.mojom.Url? canonical_url);
Luciano Pacheco8528c16f2017-12-14 07:10:5652
John Abd-El-Malek9405d80e2018-08-08 16:50:2153 // Causes all new subresource requests to be blocked (not being started) until
54 // ResumeBlockedRequests is called.
55 BlockRequests();
56
57 // Resumes blocked requests.
58 // It is safe to call this without calling BlockRequests.
59 ResumeBlockedRequests();
60
61 // Cancels blocked requests. BlockRequests must have been called before.
62 CancelBlockedRequests();
63
Dave Tapuska1dd57742019-02-07 01:07:3764 // Set the lifecycle state.
65 SetLifecycleState(blink.mojom.FrameLifecycleState state);
66
Mario Sanchez Pradaef82d5f2019-07-26 11:34:0867 // Retrieves the text surrounding the current selection for the frame up to
68 // the length specified by |max_length|, along with its start and end offsets.
69 GetTextSurroundingSelection(uint32 max_length)
70 => (mojo_base.mojom.String16 content, uint32 start_offset,
71 uint32 end_offset);
72
Luciano Pacheco8528c16f2017-12-14 07:10:5673 // Samsung Galaxy Note-specific "smart clip" stylus text getter.
74 // Extracts the data at the given rect.
Eve Martin-Jones40f552c2018-02-14 22:47:3275 [EnableIf=is_android]
Luciano Pacheco8528c16f2017-12-14 07:10:5676 ExtractSmartClipData(gfx.mojom.Rect rect)
Mahesh Machavolu346cd2662018-05-24 12:40:1177 => (mojo_base.mojom.String16 text, mojo_base.mojom.String16 html,
78 gfx.mojom.Rect clip_rect);
ben76f52b242016-06-18 05:42:4879};
80
Ken Rockot48785452017-10-25 19:33:1481// Implemented by the frame provider and currently must be associated with the
82// legacy IPC channel.
Arthur Hemeryd3011f62018-05-30 10:38:4483// KEEP THE COMMIT FUNCTIONS IN SYNC in content/common/navigation_client.mojom.
84// These will eventually be removed from FrameNavigationControl.
Ken Rockot48785452017-10-25 19:33:1485interface FrameNavigationControl {
arthursonzogni3a4ca9f2017-12-07 17:58:3486 // Tells the renderer that a navigation is ready to commit.
87 //
arthursonzognif34adf092018-04-24 17:06:1388 // The renderer should bind the |url_loader_client_endpoints| to an
89 // URLLoaderClient implementation to continue loading the document that will
90 // be the result of the committed navigation.
arthursonzogni3a4ca9f2017-12-07 17:58:3491 //
arthursonzognif34adf092018-04-24 17:06:1392 // Note: |url_loader_client_endpoints| will be empty iff the navigation URL
Arthur Hemeryd3011f62018-05-30 10:38:4493 // wasn't handled by the network stack (i.e. about:blank, ...)
arthursonzogni3a4ca9f2017-12-07 17:58:3494 //
Minggang Wang47a78222019-06-28 17:05:4695 // Note: |response_body| is only used when NavigationImmediateResponseBody is
96 // enabled. It contains the datapipe used to read the response body.
97 //
arthursonzogni3a4ca9f2017-12-07 17:58:3498 // When the Network Service is enabled, |subresource_loader_factories| may
99 // also be provided by the browser as a a means for the renderer to load
100 // subresources where applicable.
Pavel Feldmanf20fc9d2017-11-17 09:13:30101 //
arthursonzognib950d902018-02-08 09:27:13102 // |controller_service_worker_info| may also be provided by the browser if the
103 // frame that is being navigated is supposed to be controlled by a Service
104 // Worker.
Leon Han49c3ff62019-03-13 00:08:01105 // |provider_info| may also be provided if the browser has created a
106 // ServiceWorkerProviderHost for this navigation.
Kinuko Yasudad795ac72018-07-11 08:07:53107 // |prefetch_loader_factory| is populated only when Network Service is
108 // enabled. The pointer is used to start a prefetch loading via the browser
109 // process.
Kinuko Yasudaba384082018-01-11 08:30:16110 //
Pavel Feldmanf20fc9d2017-11-17 09:13:30111 // For automation driver-initiated navigations over the devtools protocol,
112 // |devtools_navigation_token_| is used to tag the navigation. This navigation
113 // token is then sent into the renderer and lands on the DocumentLoader. That
114 // way subsequent Blink-level frame lifecycle events can be associated with
115 // the concrete navigation.
116 // - The value should not be sent back to the browser.
117 // - The value on DocumentLoader may be generated in the renderer in some
118 // cases, and thus shouldn't be trusted.
119 // TODO(crbug.com/783506): Replace devtools navigation token with the generic
120 // navigation token that can be passed from renderer to the browser.
arthursonzogni3a4ca9f2017-12-07 17:58:34121 CommitNavigation(
arthursonzogni3a4ca9f2017-12-07 17:58:34122 CommonNavigationParams common_params,
Nasko Oskovc36327d2019-01-03 23:23:04123 CommitNavigationParams request_params,
Minggang Wang47a78222019-06-28 17:05:46124 network.mojom.URLResponseHead response_head,
125 handle<data_pipe_consumer>? response_body,
John Abd-El-Malekb165dc52018-01-18 17:12:18126 network.mojom.URLLoaderClientEndpoints? url_loader_client_endpoints,
Hiroki Nakagawa753758342018-12-27 04:13:49127 blink.mojom.URLLoaderFactoryBundle? subresource_loader_factories,
John Abd-El-Malekecc6f5f2018-03-02 18:47:39128 array<TransferrableURLLoader>? subresource_overrides,
Hiroki Nakagawacdbc7912018-11-30 11:30:05129 blink.mojom.ControllerServiceWorkerInfo? controller_service_worker_info,
Matt Falkenhagen5e340f12019-07-21 01:28:37130 blink.mojom.ServiceWorkerProviderInfoForClient? provider_info,
Kinuko Yasuda8fb556c2019-07-16 05:47:55131 pending_remote<network.mojom.URLLoaderFactory>? prefetch_loader_factory,
clamy6b92fcf2018-06-01 13:51:37132 mojo_base.mojom.UnguessableToken devtools_navigation_token)
133 => (blink.mojom.CommitResult commit_result);
Doug Turner84693be2017-12-19 00:18:46134
135 // Tells the renderer that a failed navigation is ready to commit.
136 //
137 // The result of this commit usually results in displaying an error page.
138 // Note |error_page_content| may contain the content of the error page
139 // (i.e. flattened HTML, JS, CSS).
140 //
141 // When the Network Service is enabled, |subresource_loader_factories| may
Conley Owens7a78fab2018-03-10 06:27:49142 // also be provided by the browser as a means for the renderer to load
Doug Turner84693be2017-12-19 00:18:46143 // subresources where applicable.
144 CommitFailedNavigation(
145 CommonNavigationParams common_params,
Nasko Oskovc36327d2019-01-03 23:23:04146 CommitNavigationParams request_params,
Doug Turner84693be2017-12-19 00:18:46147 bool has_stale_copy_in_cache,
148 int32 error_code,
149 string? error_page_content,
Hiroki Nakagawa753758342018-12-27 04:13:49150 blink.mojom.URLLoaderFactoryBundle? subresource_loader_factories)
clamy6b92fcf2018-06-01 13:51:37151 => (blink.mojom.CommitResult commit_result);
Chong Zhang7306b0b2018-01-24 05:59:24152
clamyaf4bf2d92018-02-06 10:54:36153 // Tells the renderer that a same-document navigation should be committed.
154 // The renderer will return a status value indicating whether the commit
155 // could proceed as expected or not. In particular, it might be necessary to
156 // restart the navigation if it is no-longer same-document, which can happen
157 // if the renderer committed another navigation in the meantime.
158 CommitSameDocumentNavigation(
159 CommonNavigationParams common_params,
Nasko Oskovc36327d2019-01-03 23:23:04160 CommitNavigationParams request_params)
clamyaf4bf2d92018-02-06 10:54:36161 => (blink.mojom.CommitResult commit_result);
162
clamyb1df7b962018-02-01 17:38:17163 // Asks the renderer to handle a renderer-debug URL.
164 HandleRendererDebugURL(url.mojom.Url url);
165
Chong Zhang7306b0b2018-01-24 05:59:24166 // Provides the renderer an updated |subresource_loader_factories|.
167 //
168 // This method is intended to fix broken loaders after a Network Service
169 // crash, and is only used when Network Service is enabled.
170 //
171 // The new bundle contains replacement factories for a subset of the
172 // receiver's existing bundle.
173 UpdateSubresourceLoaderFactories(
Hiroki Nakagawa753758342018-12-27 04:13:49174 blink.mojom.URLLoaderFactoryBundle subresource_loader_factories);
Dmitry Gozman6adf95b2018-10-10 22:12:19175
176 // Returns a DevToolsAgent interface for this frame, used for
177 // remote debugging. See DevToolsAgent for details.
178 // Returned DevToolsAgent must be associated with navigation control,
179 // due to various ordering dependencies between DevTools protocol and
180 // navigation.
181 BindDevToolsAgent(associated blink.mojom.DevToolsAgentHost agent_host,
182 associated blink.mojom.DevToolsAgent& agent);
Hajime Hoshi35ad74f2019-03-07 08:38:05183
184 // Request for the renderer to execute JavaScript in the frame's context.
185 //
186 // |javascript| is the string containing the JavaScript to be executed in the
187 // target frame's context.
188 //
Avi Drissman8e3ebe92019-06-10 20:26:11189 // |wants_result| is true if the result of this execution is required by the
190 // caller. If it is false, a reply is still required by Mojo, but a null value
191 // should be returned to avoid issues serializing a large, unwanted reply.
192 //
Hajime Hoshi35ad74f2019-03-07 08:38:05193 // TODO(hajimehoshi): This requires navigate association to keep the message
194 // order with other navigation-related messages. Fix this and move this to a
195 // non-navigate-related interface if possible.
Avi Drissman4544828f2019-03-11 20:37:32196 JavaScriptExecuteRequest(
Avi Drissman8e3ebe92019-06-10 20:26:11197 mojo_base.mojom.String16 javascript,
198 bool wants_result) => (mojo_base.mojom.Value result);
Hajime Hoshi35ad74f2019-03-07 08:38:05199
Avi Drissman4544828f2019-03-11 20:37:32200 // ONLY FOR TESTS: Same as above but adds a fake UserGestureIndicator around
Hajime Hoshi35ad74f2019-03-07 08:38:05201 // execution. (crbug.com/408426)
Avi Drissman4544828f2019-03-11 20:37:32202 JavaScriptExecuteRequestForTests(
203 mojo_base.mojom.String16 javascript,
Avi Drissman8e3ebe92019-06-10 20:26:11204 bool wants_result,
Hajime Hoshif85e7cf722019-07-19 00:54:49205 bool has_user_gesture,
206 int32 world_id)
Avi Drissman4544828f2019-03-11 20:37:32207 => (mojo_base.mojom.Value result);
Hajime Hoshi35ad74f2019-03-07 08:38:05208
209 // Same as JavaScriptExecuteRequest above except the script is run in the
210 // isolated world specified by the fourth parameter.
Avi Drissman4544828f2019-03-11 20:37:32211 JavaScriptExecuteRequestInIsolatedWorld(
212 mojo_base.mojom.String16 javascript,
Avi Drissman8e3ebe92019-06-10 20:26:11213 bool wants_result,
Avi Drissman4544828f2019-03-11 20:37:32214 int32 world_id) => (mojo_base.mojom.Value result);
Yuzu Saijoaae91702019-03-13 07:38:05215
216 // Posts a message from a frame in another process to the current renderer.
217 // |source_routing_id| is the routing ID of the source frame in the source
218 // process when sent to the browser. The browser replaces it with the routing
219 // ID of the equivalent frame proxy in the destination process.
220 // |source_origin| is the origin of the source frame when the message was
221 // sent, and |target_origin| specifies what the origin of the target frame
222 // must be for the message to be dispatched. An empty string allows the
223 // message to be dispatched to any origin.
224 // |message| is the encoded data, and any extra properties such as
225 // transferred ports or blobs.
226 PostMessageEvent(int32 source_routing_id,
227 mojo_base.mojom.String16 source_origin,
228 mojo_base.mojom.String16 target_origin,
229 blink.mojom.TransferableMessage message);
Lucas Furukawa Gadani56dd5452019-03-22 18:23:12230
Adithya Srinivasane8bf80e2019-05-01 15:39:31231 // Forwards a message from a portal's host to the main frame in the portal's
232 // guest contents.
233 ForwardMessageFromHost(blink.mojom.TransferableMessage message,
234 url.mojom.Origin source_origin,
235 url.mojom.Origin? target_origin);
Adithya Srinivasan324086b2019-03-26 17:06:58236
Lucas Furukawa Gadani56dd5452019-03-22 18:23:12237 // Called on the main frame of a page embedded in a Portal when it is
238 // activated. The frame has the option to adopt the previous page as a portal
239 // identified by |portal_token| with the interface |portal|. The activation
240 // can optionally include a message |data| dispatched with the
Adithya Srinivasane4f0e0702019-04-18 23:17:20241 // PortalActivateEvent. The return value |was_adopted| indicates if the portal
242 // for the predecessor (identified by |portal_token|) was adopted by the
243 // current frame.
Jeremy Romand92e1372019-06-04 16:31:17244 OnPortalActivated(
245 mojo_base.mojom.UnguessableToken portal_token,
246 pending_associated_remote<blink.mojom.Portal> portal,
247 pending_associated_receiver<blink.mojom.PortalClient> portal_client,
248 blink.mojom.TransferableMessage data) => (bool was_adopted);
Ken Rockot48785452017-10-25 19:33:14249};
250
sammc7f6c6a02017-01-30 00:53:51251// Implemented by the frame (e.g. renderer processes).
252// Instances of this interface must be associated with (i.e., FIFO with) the
253// legacy IPC channel.
254interface FrameBindingsControl {
255 // Used to tell a render frame whether it should expose various bindings
256 // that allow JS content extended privileges. See BindingsPolicy for valid
257 // flag values.
258 AllowBindings(int32 enabled_bindings_flags);
259};
260
ben76f52b242016-06-18 05:42:48261// Implemented by a service that provides implementations of the Frame
262// interface. (e.g. renderer processes).
263interface FrameFactory {
Balazs Engedyba034e72017-10-27 22:26:28264 CreateFrame(int32 frame_routing_id, Frame& frame);
csharrison95f01e922017-04-24 18:52:35265};
266
csharrison95f01e922017-04-24 18:52:35267struct CreateNewWindowParams {
268 // True if this open request came in the context of a user gesture.
Mustaq Ahmedc4cb7162018-06-05 16:28:36269 //
270 // TODO(mustaq): We have cases where a user gesture is assumed to be
271 // there even when it's not the case. See https://crbug.com/843233.
272 bool mimic_user_gesture;
csharrison95f01e922017-04-24 18:52:35273
274 // Type of window requested.
275 WindowContainerType window_container_type;
276
277 // The session storage namespace ID this window should use.
Daniel Murphy31bbb8b12018-02-07 21:44:10278 string session_storage_namespace_id;
csharrison95f01e922017-04-24 18:52:35279
Daniel Murphye3eec92c2018-02-23 19:09:15280 // The session storage namespace ID this window should clone from.
281 // TODO(dmurph): Remove this once session storage is fully mojo'd, as the
282 // clone call happens on a different interface. https://crbug.com/716490
283 string clone_from_session_storage_namespace_id;
284
csharrison95f01e922017-04-24 18:52:35285 // The name of the resulting frame that should be created (empty if none
286 // has been specified). UTF8 encoded string.
287 string frame_name;
288
csharrison95f01e922017-04-24 18:52:35289 // Whether the opener will be suppressed in the new window, in which case
290 // scripting the new window is not allowed.
291 bool opener_suppressed;
292
293 // Whether the window should be opened in the foreground, background, etc.
294 ui.mojom.WindowOpenDisposition disposition;
295
296 // The URL that will be loaded in the new window (empty if none has been
297 // specified).
298 url.mojom.Url target_url;
299
300 // The referrer that will be used to load |target_url| (empty if none has
301 // been specified).
302 blink.mojom.Referrer referrer;
303
304 // The window features to use for the new window.
305 blink.mojom.WindowFeatures features;
306};
307
Daniel Cheng8bb30c62017-10-23 20:40:47308// Operation result when the renderer asks the browser to create a new window.
309enum CreateNewWindowStatus {
310 // Ignore creation of the new window. This can happen because creation is
311 // blocked or because the new window should have no opener relationship.
312 kIgnore,
313 // Reuse the current window rather than creating a new window.
314 kReuse,
315 // Create a new window using the corresponding params in |reply|.
316 kSuccess,
317};
318
319// All routing IDs in this struct must be set to a valid routing ID.
csharrison95f01e922017-04-24 18:52:35320struct CreateNewWindowReply {
Daniel Cheng8bb30c62017-10-23 20:40:47321 // The ID of the view to be created.
csharrison95f01e922017-04-24 18:52:35322 int32 route_id;
323
324 // The ID of the main frame hosted in the view.
325 int32 main_frame_route_id;
326
327 // The ID of the widget for the main frame.
328 int32 main_frame_widget_route_id;
329
Oksana Zhuravlova8b88e572019-01-07 21:54:00330 DocumentScopedInterfaceBundle main_frame_interface_bundle;
Balazs Engedyba034e72017-10-27 22:26:28331
csharrison95f01e922017-04-24 18:52:35332 // Duplicated from CreateNewWindowParams because legacy code.
Daniel Murphy31bbb8b12018-02-07 21:44:10333 string cloned_session_storage_namespace_id;
Pavel Feldman08beed7842017-10-17 19:18:11334
335 // Used for devtools instrumentation and trace-ability. The token is
336 // propagated to Blink's LocalFrame and both Blink and content/
337 // can tag calls and requests with this instrumentation token in order to
338 // attribute them to the context frame.
339 // |devtools_frame_token| is only defined by the browser and is never
340 // sent back from the renderer in the control calls.
Oksana Zhuravlova34579e912018-03-23 00:18:49341 mojo_base.mojom.UnguessableToken devtools_main_frame_token;
csharrison95f01e922017-04-24 18:52:35342};
343
Yutaka Hiranof7f2f632017-09-06 10:40:08344// An opaque handle that keeps alive the associated render process even after
345// the frame is detached. Used by resource requests with "keepalive" specified.
346interface KeepAliveHandle {};
347
csharrison95f01e922017-04-24 18:52:35348// Implemented by the frame server (i.e. the browser process). For messages that
349// must be associated with the IPC channel.
350interface FrameHost {
Daniel Cheng8bb30c62017-10-23 20:40:47351 // Sent by the renderer to request the browser to create a new window. |reply|
352 // is only non-null on when status == CreateNewWindowStatus::kSuccess.
csharrison95f01e922017-04-24 18:52:35353 [Sync] CreateNewWindow(CreateNewWindowParams params)
Daniel Cheng8bb30c62017-10-23 20:40:47354 => (CreateNewWindowStatus status, CreateNewWindowReply? reply);
Yutaka Hiranof7f2f632017-09-06 10:40:08355
Lucas Furukawa Gadani99125822019-01-03 15:41:49356 // Sent by the renderer process to request the creation of a new portal.
Adithya Srinivasane8bf80e2019-05-01 15:39:31357 // |portal| is the pipe to be used for the Portal object, |client| is the pipe
358 // used to communicate back with the caller. Returns |proxy_routing_id|, which
359 // is the routing id of the RenderFrameProxy and |portal_token|, which is the
360 // unique identifier for the portal.
Jeremy Romand92e1372019-06-04 16:31:17361 [Sync] CreatePortal(
362 pending_associated_receiver<blink.mojom.Portal> portal,
363 pending_associated_remote<blink.mojom.PortalClient> client)
Lucas Furukawa Gadani99125822019-01-03 15:41:49364 => (int32 proxy_routing_id,
Lucas Furukawa Gadanif68204d2019-04-30 17:30:24365 mojo_base.mojom.UnguessableToken portal_token,
366 mojo_base.mojom.UnguessableToken devtools_frame_token);
Lucas Furukawa Gadani99125822019-01-03 15:41:49367
Lucas Furukawa Gadani56dd5452019-03-22 18:23:12368 // Requests that this frame adopts the portal identified by |portal_token|.
369 // Returns |proxy_routing_id|, which is the routing id of the portal's
Jeremy Roman62fee222019-07-09 17:34:14370 // RenderFrameProxy, |replicated_state|, the replicated state associated with
371 // that RFP, and the |devtools_frame_token|.
Lucas Furukawa Gadani56dd5452019-03-22 18:23:12372 [Sync] AdoptPortal(mojo_base.mojom.UnguessableToken portal_token)
Lucas Furukawa Gadanif68204d2019-04-30 17:30:24373 => (int32 proxy_routing_id,
Jeremy Roman62fee222019-07-09 17:34:14374 FrameReplicationState replicated_state,
Lucas Furukawa Gadanif68204d2019-04-30 17:30:24375 mojo_base.mojom.UnguessableToken devtools_frame_token);
Lucas Furukawa Gadani56dd5452019-03-22 18:23:12376
Yutaka Hiranof7f2f632017-09-06 10:40:08377 // Creates and returns a KeepAliveHandle.
378 IssueKeepAliveHandle(KeepAliveHandle& keep_alive_handle);
Balazs Engedya40712f2017-09-15 15:01:11379
380 // Sent by the renderer when a navigation commits in the frame.
Oksana Zhuravlova8b88e572019-01-07 21:54:00381
382 // If |interface_params| is non-empty, the FrameHost implementation
383 // must unbind the old InterfaceProvider and DocumentInterfaceBroker
384 // connections, and drop any interface requests pending on them.
385 // Then it should bind the appropriate requests and start servicing
386 // GetInterface messages coming in on these new connections
Balazs Engedy0c8d550b2017-12-06 21:30:23387 // in a security context that is appropriate for the committed navigation.
388 //
Oksana Zhuravlova8b88e572019-01-07 21:54:00389 // The FrameHost implementation must enforce that |interface_params|
Balazs Engedy0c8d550b2017-12-06 21:30:23390 // is set for cross-document navigations. This prevents origin confusion by
391 // ensuring that interface requests racing with navigation commit will be
392 // either ignored, or serviced correctly in the security context of the
393 // document they originated from (based on which InterfaceProvider connection
Oksana Zhuravlova8b88e572019-01-07 21:54:00394 // the GetInterface messages arrive on or DocumentInterfaceBroker
395 // connection the Get<interface> messages arrive on).
Balazs Engedya40712f2017-09-15 15:01:11396 DidCommitProvisionalLoad(
Balazs Engedy0c8d550b2017-12-06 21:30:23397 DidCommitProvisionalLoadParams params,
Oksana Zhuravlova8b88e572019-01-07 21:54:00398 DidCommitProvisionalLoadInterfaceParams? interface_params);
Arthur Hemery7b67a972017-12-01 15:24:49399
Arthur Hemery7b0ae492018-02-05 16:04:45400 // Sent by the renderer to indicate that a same document navigation
401 // committed in the renderer process.
402 DidCommitSameDocumentNavigation(
403 DidCommitProvisionalLoadParams params);
404
Arthur Hemery7b67a972017-12-01 15:24:49405 // Sent by the renderer to request a navigation.
Marijn Kruisselbrink07bf59d52018-04-03 21:50:25406 // |blob_url_token| should be non-null when this is a navigation to a blob:
407 // URL. The token will then be used to look up the blob associated with the
408 // blob URL. Without this by the time the navigation code starts fetching
409 // the URL the blob URL might no longer be valid. |blob_url_token| is
410 // not part of BeginNavigationParams because that struct needs to be
411 // cloneable, and thus can't contain mojo interfaces.
412 // If an invalid BlobURLToken is passed in, or if the token doesn't match the
413 // url in |common_params|, the navigation will result in a network error.
Arthur Hemeryd3011f62018-05-30 10:38:44414 // |navigation_client| is passed to the renderer to allow for further control
415 // of the navigation. Allows for Commit and Cancels/Aborts. It is only valid
416 // when PerNavigationMojoInterface is enabled.
417 // TODO(ahemery): |navigation_client| should not be optional. Make it
418 // mandatory when removing PerNavigationMojoInterface feature flag.
Arthur Hemery7b67a972017-12-01 15:24:49419 BeginNavigation(
420 CommonNavigationParams common_params,
Marijn Kruisselbrink07bf59d52018-04-03 21:50:25421 BeginNavigationParams begin_params,
Arthur Hemeryd3011f62018-05-30 10:38:44422 blink.mojom.BlobURLToken? blob_url_token,
Andy Paicuc93d30862018-10-10 15:33:45423 associated NavigationClient? navigation_client,
424 blink.mojom.NavigationInitiator? navigation_initiator);
John Abd-El-Malekd4882642017-12-04 21:45:19425
426 // Sent when a subresource response has started.
Jay Civellid5904f02018-03-23 19:43:57427 // |cert_status| is the bitmask of status info of the SSL certificate. (see
428 // net/cert/cert_status_flags.h).
429 SubresourceResponseStarted(url.mojom.Url url, uint32 cert_status);
430
Jay Civelli116683f2018-03-27 19:56:23431 // Sent when a resource load finished, successfully or not.
432 ResourceLoadComplete(ResourceLoadInfo url_load_info);
Luciano Pacheco8def47f2017-12-07 06:52:30433
434 // Sent when the frame changes its window.name.
435 DidChangeName(string name, string unique_name);
436
437 // Sent when the frame starts enforcing an insecure request policy. Sending
438 // this information in DidCommitProvisionalLoad isn't sufficient; this
439 // message is needed because, for example, a document can dynamically insert
440 // a <meta> tag that causes strict mixed content checking to be enforced.
441 //
442 // Argument |policy_bitmap| represents blink::WebInsecureRequestPolicy uint8
443 // bitfield.
444 EnforceInsecureRequestPolicy(uint8 policy_bitmap);
arthursonzogni4b62a5cb2018-01-17 14:14:26445 // Elements of |set| are hashes of hosts to upgrade.
446 EnforceInsecureNavigationsSet(array<uint32> set);
Luciano Pacheco8def47f2017-12-07 06:52:30447
448 // Notifies the browser process that HTTP headers which affect the frame
449 // polices were delivered with the document being loaded into the frame. This
450 // can be either or both of 'Feature-Policy' or 'Content-Security-Policy' (
451 // which can set sandbox flags).
452 //
453 // |parsed_header| is a list of an origin whitelist for each feature in the
454 // policy.
455 DidSetFramePolicyHeaders(
456 blink.mojom.WebSandboxFlags sandbox_flags,
457 array<blink.mojom.ParsedFeaturePolicyDeclaration> parsed_header);
Austin Tankiang10d64832017-12-20 02:43:55458
459 // If a cross-process navigation was started for the initial history load in
460 // this subframe, this tries to cancel it to allow a client redirect to happen
461 // instead.
462 CancelInitialHistoryLoad();
463
464 // Change the encoding name of the page in UI when the page has detected
465 // proper encoding name. Sent for top-level frames.
466 UpdateEncoding(string encoding_name);
Lucas Furukawa Gadanie5d27a362018-02-13 14:26:02467
Lucas Gadani471160f92018-03-01 03:13:21468 // The frame's size is replicated in the browser so that the browser can
469 // correctly set the initial size of the frame in case of a cross-process
470 // navigation.
471 FrameSizeChanged(gfx.mojom.Size size);
Becca Hughesfd5d8f892018-06-14 18:23:36472
473 // Notifies the browser that the current frame has either become or is no
474 // longer fullscreen.
475 FullscreenStateChanged(bool is_fullscreen);
Clark DuValla0e42992018-09-17 17:00:11476
Dave Tapuskad6703f912019-01-31 23:13:11477 // Notifies the browser that the current frame has changed its visibility
478 // status.
479 VisibilityChanged(blink.mojom.FrameVisibility visibility);
480
Dave Tapuskaa42101f2019-06-28 17:12:50481 // Notifies the browser that the current frame has changed its lifecycle
482 // state.
483 LifecycleStateChanged(blink.mojom.FrameLifecycleState state);
484
Clark DuValla0e42992018-09-17 17:00:11485 // Updates information to determine whether a user gesture should carryover to
486 // future navigations. This is needed so navigations within a certain
487 // timeframe of a request initiated by a gesture will be treated as if they
488 // were initiated by a gesture too, otherwise the navigation may be blocked.
489 [EnableIf=is_android]
490 UpdateUserGestureCarryoverInfo();
Lowell Manners9499addc2019-03-12 11:05:32491
492 // Sent after the onload handler has been invoked for the document
493 // in this frame. Sent for top-level frames.
494 DocumentOnLoadCompleted();
Alexander Timin50be4492019-04-17 23:07:59495
496 // Sent by the blink's FrameScheduler when a list of active features
497 // the scheduler tracks changes.
498 // See blink::scheduler::SchedulingPolicy::Feature for the meaning
499 // of the individual bits.
500 // TODO(altimin): Move into a separate scheduling interface.
501 UpdateActiveSchedulerTrackedFeatures(uint64 features_mask);
Lowell Mannersf03ea5a2019-04-23 11:47:58502
503 // Blink and JavaScript error messages to log to the console or debugger UI.
504 DidAddMessageToConsole(
505 blink.mojom.ConsoleMessageLevel log_level,
506 mojo_base.mojom.BigString16 msg,
507 int32 line_number,
508 mojo_base.mojom.String16 source_id);
509
Lowell Mannersc39e58272019-05-20 15:46:38510 // Sent when the renderer fails a provisional load with an error.
511 //
512 // |url| is the URL that the error is reported for.
513 //
514 // |error_code| is a net::Error code as reported in the
515 // DidFailProvisionalLoad callback.
516 //
517 // |error_description| is an error message generated from the error_code.
518 // This can be an empty string if we were unable to find a meaningful
519 // description.
520 //
521 // |showing_repost_interstitial| is true if the failure is the result of
522 // navigating to a POST again and we're going to show the POST interstitial.
523 // TODO(https://crbug.com/963806): Delete this method.
524 DidFailProvisionalLoadWithError(
525 url.mojom.Url url,
526 int32 error_code,
527 mojo_base.mojom.String16 error_description,
528 bool showing_repost_interstitial);
529
530 // Sent when the renderer fails to load with an error.
531 DidFailLoadWithError(
532 url.mojom.Url url,
533 int32 error_code,
534 mojo_base.mojom.String16 error_description);
Lowell Manners07a8cac2019-06-04 16:48:07535
536 // Sent to the browser process to transfer the user activation state from the
537 // source frame to the frame sending this IPC. The browser will update the
538 // user activation state of the frames in the frame tree in the non-source and
539 // non-target renderer processes.
540 TransferUserActivationFrom(int32 source_routing_id);
Lowell Manners88da5ec2019-06-18 09:46:17541
542 // Causes a window previously opened via RenderMessageFilter::CreateNewWindow
543 // to be shown on the screen. This message is routed to the preexisting frame
544 // that opened the window, and |pending_widget_routing_id| corresponds to the
545 // widget routing id from the CreateNewWindow reply.
546 ShowCreatedWindow(int32 pending_widget_routing_id,
547 ui.mojom.WindowOpenDisposition disposition,
548 gfx.mojom.Rect rect, bool opened_by_user_gesture);
Lowell Mannersa9530382019-08-01 09:46:57549
550 // Sent by the renderer when the frame becomes focused.
551 FrameFocused();
Hajime Hoshia2f68032019-08-05 13:22:38552
553 // Evicts the page from the back/forward cache due to e.g., JavaScript
554 // execution.
555 EvictFromBackForwardCache();
ben76f52b242016-06-18 05:42:48556};