blob: b2082e2db22caad08a138d891636b4321e658a8e [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";
Arthur Hemeryd3011f62018-05-30 10:38:449import "content/common/navigation_client.mojom";
Arthur Hemery7b67a972017-12-01 15:24:4910import "content/common/navigation_params.mojom";
John Abd-El-Malekd4882642017-12-04 21:45:1911import "content/public/common/resource_type.mojom";
Jay Civelli116683f2018-03-27 19:56:2312import "content/public/common/resource_load_info.mojom";
John Abd-El-Malekecc6f5f2018-03-02 18:47:3913import "content/public/common/transferrable_url_loader.mojom";
csharrison95f01e922017-04-24 18:52:3514import "content/public/common/window_container_type.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";
Ken Rockot54311e62018-02-10 19:01:5218import "services/network/public/mojom/url_loader.mojom";
Kinuko Yasudad795ac72018-07-11 08:07:5319import "services/network/public/mojom/url_loader_factory.mojom";
Ken Rockot543f5e32018-02-04 02:13:5020import "services/service_manager/public/mojom/interface_provider.mojom";
Jennifer Apaciblec45fd052018-02-25 12:04:5521import "services/viz/public/interfaces/compositing/surface_id.mojom";
Blink Reformata30d4232018-04-07 15:31:0622import "third_party/blink/public/mojom/blob/blob_url_store.mojom";
Julie Jeongeun Kim42a90df2019-03-20 23:13:1023import "third_party/blink/public/mojom/commit_result/commit_result.mojom";
Blink Reformata30d4232018-04-07 15:31:0624import "third_party/blink/public/mojom/feature_policy/feature_policy.mojom";
Dave Tapuskad6703f912019-01-31 23:13:1125import "third_party/blink/public/mojom/frame/lifecycle.mojom";
Andy Paicuc93d30862018-10-10 15:33:4526import "third_party/blink/public/mojom/frame/navigation_initiator.mojom";
Jeremy Roman3c83b162019-03-12 16:55:5227import "third_party/blink/public/mojom/messaging/transferable_message.mojom";
Hiroki Nakagawa753758342018-12-27 04:13:4928import "third_party/blink/public/mojom/loader/url_loader_factory_bundle.mojom";
Yuzu Saijoaae91702019-03-13 07:38:0529import "third_party/blink/public/mojom/messaging/transferable_message.mojom";
Lucas Furukawa Gadani89a74182019-01-10 19:33:2230import "third_party/blink/public/mojom/portal/portal.mojom";
Leon Han075e0b32018-11-06 07:59:4431import "third_party/blink/public/mojom/referrer.mojom";
Hiroki Nakagawacdbc7912018-11-30 11:30:0532import "third_party/blink/public/mojom/service_worker/controller_service_worker.mojom";
Leon Han49c3ff62019-03-13 00:08:0133import "third_party/blink/public/mojom/service_worker/service_worker_provider.mojom";
Hiroki Nakagawa7c0a7e72018-12-10 04:31:2934import "third_party/blink/public/mojom/devtools/devtools_agent.mojom";
Lucas Furukawa Gadani99125822019-01-03 15:41:4935import "third_party/blink/public/mojom/portal/portal.mojom";
Julie Jeongeun Kim42a90df2019-03-20 23:13:1036import "third_party/blink/public/mojom/window_features/window_features.mojom";
csharrison95f01e922017-04-24 18:52:3537import "ui/base/mojo/window_open_disposition.mojom";
Daniel Cheng7a059b02018-02-03 10:04:1338import "url/mojom/url.mojom";
Adithya Srinivasan57f44d0d2019-03-22 15:36:0239import "url/mojom/origin.mojom";
Luciano Pacheco8528c16f2017-12-14 07:10:5640import "ui/gfx/geometry/mojo/geometry.mojom";
ben76f52b242016-06-18 05:42:4841
ben275a5652016-10-28 16:55:5042// The name of the InterfaceProviderSpec in service manifests used by the
43// frame tree to expose frame-specific interfaces between renderer and browser.
44const string kNavigation_FrameSpec = "navigation:frame";
45
ben76f52b242016-06-18 05:42:4846// Implemented by the frame provider (e.g. renderer processes).
47interface Frame {
rockot400ea35b2016-10-15 19:15:3248 GetInterfaceProvider(service_manager.mojom.InterfaceProvider& interfaces);
Daniel Cheng118f9e282017-11-10 03:28:4449 GetCanonicalUrlForSharing() => (url.mojom.Url? canonical_url);
Luciano Pacheco8528c16f2017-12-14 07:10:5650
John Abd-El-Malek9405d80e2018-08-08 16:50:2151 // Causes all new subresource requests to be blocked (not being started) until
52 // ResumeBlockedRequests is called.
53 BlockRequests();
54
55 // Resumes blocked requests.
56 // It is safe to call this without calling BlockRequests.
57 ResumeBlockedRequests();
58
59 // Cancels blocked requests. BlockRequests must have been called before.
60 CancelBlockedRequests();
61
Dave Tapuska1dd57742019-02-07 01:07:3762 // Set the lifecycle state.
63 SetLifecycleState(blink.mojom.FrameLifecycleState state);
64
Luciano Pacheco8528c16f2017-12-14 07:10:5665 // Samsung Galaxy Note-specific "smart clip" stylus text getter.
66 // Extracts the data at the given rect.
Eve Martin-Jones40f552c2018-02-14 22:47:3267 [EnableIf=is_android]
Luciano Pacheco8528c16f2017-12-14 07:10:5668 ExtractSmartClipData(gfx.mojom.Rect rect)
Mahesh Machavolu346cd2662018-05-24 12:40:1169 => (mojo_base.mojom.String16 text, mojo_base.mojom.String16 html,
70 gfx.mojom.Rect clip_rect);
ben76f52b242016-06-18 05:42:4871};
72
Ken Rockot48785452017-10-25 19:33:1473// See src/content/common/navigation_params.h
74[Native]
75struct CommonNavigationParams;
76
77// See src/content/common/navigation_params.h
78[Native]
Nasko Oskovc36327d2019-01-03 23:23:0479struct CommitNavigationParams;
Ken Rockot48785452017-10-25 19:33:1480
81// 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 //
95 // When the Network Service is enabled, |subresource_loader_factories| may
96 // also be provided by the browser as a a means for the renderer to load
97 // subresources where applicable.
Pavel Feldmanf20fc9d2017-11-17 09:13:3098 //
arthursonzognib950d902018-02-08 09:27:1399 // |controller_service_worker_info| may also be provided by the browser if the
100 // frame that is being navigated is supposed to be controlled by a Service
101 // Worker.
Leon Han49c3ff62019-03-13 00:08:01102 // |provider_info| may also be provided if the browser has created a
103 // ServiceWorkerProviderHost for this navigation.
Kinuko Yasudad795ac72018-07-11 08:07:53104 // |prefetch_loader_factory| is populated only when Network Service is
105 // enabled. The pointer is used to start a prefetch loading via the browser
106 // process.
Kinuko Yasudaba384082018-01-11 08:30:16107 //
Pavel Feldmanf20fc9d2017-11-17 09:13:30108 // For automation driver-initiated navigations over the devtools protocol,
109 // |devtools_navigation_token_| is used to tag the navigation. This navigation
110 // token is then sent into the renderer and lands on the DocumentLoader. That
111 // way subsequent Blink-level frame lifecycle events can be associated with
112 // the concrete navigation.
113 // - The value should not be sent back to the browser.
114 // - The value on DocumentLoader may be generated in the renderer in some
115 // cases, and thus shouldn't be trusted.
116 // TODO(crbug.com/783506): Replace devtools navigation token with the generic
117 // navigation token that can be passed from renderer to the browser.
arthursonzogni3a4ca9f2017-12-07 17:58:34118 CommitNavigation(
John Abd-El-Malekb165dc52018-01-18 17:12:18119 network.mojom.URLResponseHead head,
arthursonzogni3a4ca9f2017-12-07 17:58:34120 CommonNavigationParams common_params,
Nasko Oskovc36327d2019-01-03 23:23:04121 CommitNavigationParams request_params,
John Abd-El-Malekb165dc52018-01-18 17:12:18122 network.mojom.URLLoaderClientEndpoints? url_loader_client_endpoints,
Hiroki Nakagawa753758342018-12-27 04:13:49123 blink.mojom.URLLoaderFactoryBundle? subresource_loader_factories,
John Abd-El-Malekecc6f5f2018-03-02 18:47:39124 array<TransferrableURLLoader>? subresource_overrides,
Hiroki Nakagawacdbc7912018-11-30 11:30:05125 blink.mojom.ControllerServiceWorkerInfo? controller_service_worker_info,
Leon Han49c3ff62019-03-13 00:08:01126 blink.mojom.ServiceWorkerProviderInfoForWindow? provider_info,
Kinuko Yasudad795ac72018-07-11 08:07:53127 network.mojom.URLLoaderFactory? prefetch_loader_factory,
clamy6b92fcf2018-06-01 13:51:37128 mojo_base.mojom.UnguessableToken devtools_navigation_token)
129 => (blink.mojom.CommitResult commit_result);
Doug Turner84693be2017-12-19 00:18:46130
131 // Tells the renderer that a failed navigation is ready to commit.
132 //
133 // The result of this commit usually results in displaying an error page.
134 // Note |error_page_content| may contain the content of the error page
135 // (i.e. flattened HTML, JS, CSS).
136 //
137 // When the Network Service is enabled, |subresource_loader_factories| may
Conley Owens7a78fab2018-03-10 06:27:49138 // also be provided by the browser as a means for the renderer to load
Doug Turner84693be2017-12-19 00:18:46139 // subresources where applicable.
140 CommitFailedNavigation(
141 CommonNavigationParams common_params,
Nasko Oskovc36327d2019-01-03 23:23:04142 CommitNavigationParams request_params,
Doug Turner84693be2017-12-19 00:18:46143 bool has_stale_copy_in_cache,
144 int32 error_code,
145 string? error_page_content,
Hiroki Nakagawa753758342018-12-27 04:13:49146 blink.mojom.URLLoaderFactoryBundle? subresource_loader_factories)
clamy6b92fcf2018-06-01 13:51:37147 => (blink.mojom.CommitResult commit_result);
Chong Zhang7306b0b2018-01-24 05:59:24148
clamyaf4bf2d92018-02-06 10:54:36149 // Tells the renderer that a same-document navigation should be committed.
150 // The renderer will return a status value indicating whether the commit
151 // could proceed as expected or not. In particular, it might be necessary to
152 // restart the navigation if it is no-longer same-document, which can happen
153 // if the renderer committed another navigation in the meantime.
154 CommitSameDocumentNavigation(
155 CommonNavigationParams common_params,
Nasko Oskovc36327d2019-01-03 23:23:04156 CommitNavigationParams request_params)
clamyaf4bf2d92018-02-06 10:54:36157 => (blink.mojom.CommitResult commit_result);
158
clamyb1df7b962018-02-01 17:38:17159 // Asks the renderer to handle a renderer-debug URL.
160 HandleRendererDebugURL(url.mojom.Url url);
161
Chong Zhang7306b0b2018-01-24 05:59:24162 // Provides the renderer an updated |subresource_loader_factories|.
163 //
164 // This method is intended to fix broken loaders after a Network Service
165 // crash, and is only used when Network Service is enabled.
166 //
167 // The new bundle contains replacement factories for a subset of the
168 // receiver's existing bundle.
169 UpdateSubresourceLoaderFactories(
Hiroki Nakagawa753758342018-12-27 04:13:49170 blink.mojom.URLLoaderFactoryBundle subresource_loader_factories);
Dmitry Gozman6adf95b2018-10-10 22:12:19171
172 // Returns a DevToolsAgent interface for this frame, used for
173 // remote debugging. See DevToolsAgent for details.
174 // Returned DevToolsAgent must be associated with navigation control,
175 // due to various ordering dependencies between DevTools protocol and
176 // navigation.
177 BindDevToolsAgent(associated blink.mojom.DevToolsAgentHost agent_host,
178 associated blink.mojom.DevToolsAgent& agent);
Hajime Hoshi35ad74f2019-03-07 08:38:05179
180 // Request for the renderer to execute JavaScript in the frame's context.
181 //
182 // |javascript| is the string containing the JavaScript to be executed in the
183 // target frame's context.
184 //
Hajime Hoshi35ad74f2019-03-07 08:38:05185 // TODO(hajimehoshi): This requires navigate association to keep the message
186 // order with other navigation-related messages. Fix this and move this to a
187 // non-navigate-related interface if possible.
Avi Drissman4544828f2019-03-11 20:37:32188 JavaScriptExecuteRequest(
189 mojo_base.mojom.String16 javascript) => (mojo_base.mojom.Value result);
Hajime Hoshi35ad74f2019-03-07 08:38:05190
Avi Drissman4544828f2019-03-11 20:37:32191 // ONLY FOR TESTS: Same as above but adds a fake UserGestureIndicator around
Hajime Hoshi35ad74f2019-03-07 08:38:05192 // execution. (crbug.com/408426)
Avi Drissman4544828f2019-03-11 20:37:32193 JavaScriptExecuteRequestForTests(
194 mojo_base.mojom.String16 javascript,
195 bool has_user_gesture)
196 => (mojo_base.mojom.Value result);
Hajime Hoshi35ad74f2019-03-07 08:38:05197
198 // Same as JavaScriptExecuteRequest above except the script is run in the
199 // isolated world specified by the fourth parameter.
Avi Drissman4544828f2019-03-11 20:37:32200 JavaScriptExecuteRequestInIsolatedWorld(
201 mojo_base.mojom.String16 javascript,
202 int32 world_id) => (mojo_base.mojom.Value result);
Yuzu Saijoaae91702019-03-13 07:38:05203
204 // Posts a message from a frame in another process to the current renderer.
205 // |source_routing_id| is the routing ID of the source frame in the source
206 // process when sent to the browser. The browser replaces it with the routing
207 // ID of the equivalent frame proxy in the destination process.
208 // |source_origin| is the origin of the source frame when the message was
209 // sent, and |target_origin| specifies what the origin of the target frame
210 // must be for the message to be dispatched. An empty string allows the
211 // message to be dispatched to any origin.
212 // |message| is the encoded data, and any extra properties such as
213 // transferred ports or blobs.
214 PostMessageEvent(int32 source_routing_id,
215 mojo_base.mojom.String16 source_origin,
216 mojo_base.mojom.String16 target_origin,
217 blink.mojom.TransferableMessage message);
Lucas Furukawa Gadani56dd5452019-03-22 18:23:12218
Adithya Srinivasan324086b2019-03-26 17:06:58219 // Forwards message to the portal's main frame.
Adithya Srinivasan274cb1c2019-04-04 14:46:00220 ForwardMessageToPortalHost(blink.mojom.TransferableMessage message,
Adithya Srinivasan324086b2019-03-26 17:06:58221 url.mojom.Origin source_origin,
222 url.mojom.Origin? target_origin);
223
Lucas Furukawa Gadani56dd5452019-03-22 18:23:12224 // Called on the main frame of a page embedded in a Portal when it is
225 // activated. The frame has the option to adopt the previous page as a portal
226 // identified by |portal_token| with the interface |portal|. The activation
227 // can optionally include a message |data| dispatched with the
228 // PortalActivateEvent.
229 OnPortalActivated(mojo_base.mojom.UnguessableToken portal_token,
230 associated blink.mojom.Portal portal,
231 blink.mojom.TransferableMessage data);
Ken Rockot48785452017-10-25 19:33:14232};
233
sammc7f6c6a02017-01-30 00:53:51234// Implemented by the frame (e.g. renderer processes).
235// Instances of this interface must be associated with (i.e., FIFO with) the
236// legacy IPC channel.
237interface FrameBindingsControl {
238 // Used to tell a render frame whether it should expose various bindings
239 // that allow JS content extended privileges. See BindingsPolicy for valid
240 // flag values.
241 AllowBindings(int32 enabled_bindings_flags);
242};
243
ben76f52b242016-06-18 05:42:48244// Implemented by a service that provides implementations of the Frame
245// interface. (e.g. renderer processes).
246interface FrameFactory {
Balazs Engedyba034e72017-10-27 22:26:28247 CreateFrame(int32 frame_routing_id, Frame& frame);
csharrison95f01e922017-04-24 18:52:35248};
249
csharrison95f01e922017-04-24 18:52:35250struct CreateNewWindowParams {
251 // True if this open request came in the context of a user gesture.
Mustaq Ahmedc4cb7162018-06-05 16:28:36252 //
253 // TODO(mustaq): We have cases where a user gesture is assumed to be
254 // there even when it's not the case. See https://crbug.com/843233.
255 bool mimic_user_gesture;
csharrison95f01e922017-04-24 18:52:35256
257 // Type of window requested.
258 WindowContainerType window_container_type;
259
260 // The session storage namespace ID this window should use.
Daniel Murphy31bbb8b12018-02-07 21:44:10261 string session_storage_namespace_id;
csharrison95f01e922017-04-24 18:52:35262
Daniel Murphye3eec92c2018-02-23 19:09:15263 // The session storage namespace ID this window should clone from.
264 // TODO(dmurph): Remove this once session storage is fully mojo'd, as the
265 // clone call happens on a different interface. https://crbug.com/716490
266 string clone_from_session_storage_namespace_id;
267
csharrison95f01e922017-04-24 18:52:35268 // The name of the resulting frame that should be created (empty if none
269 // has been specified). UTF8 encoded string.
270 string frame_name;
271
csharrison95f01e922017-04-24 18:52:35272 // Whether the opener will be suppressed in the new window, in which case
273 // scripting the new window is not allowed.
274 bool opener_suppressed;
275
276 // Whether the window should be opened in the foreground, background, etc.
277 ui.mojom.WindowOpenDisposition disposition;
278
279 // The URL that will be loaded in the new window (empty if none has been
280 // specified).
281 url.mojom.Url target_url;
282
283 // The referrer that will be used to load |target_url| (empty if none has
284 // been specified).
285 blink.mojom.Referrer referrer;
286
287 // The window features to use for the new window.
288 blink.mojom.WindowFeatures features;
289};
290
Daniel Cheng8bb30c62017-10-23 20:40:47291// Operation result when the renderer asks the browser to create a new window.
292enum CreateNewWindowStatus {
293 // Ignore creation of the new window. This can happen because creation is
294 // blocked or because the new window should have no opener relationship.
295 kIgnore,
296 // Reuse the current window rather than creating a new window.
297 kReuse,
298 // Create a new window using the corresponding params in |reply|.
299 kSuccess,
300};
301
302// All routing IDs in this struct must be set to a valid routing ID.
csharrison95f01e922017-04-24 18:52:35303struct CreateNewWindowReply {
Daniel Cheng8bb30c62017-10-23 20:40:47304 // The ID of the view to be created.
csharrison95f01e922017-04-24 18:52:35305 int32 route_id;
306
307 // The ID of the main frame hosted in the view.
308 int32 main_frame_route_id;
309
310 // The ID of the widget for the main frame.
311 int32 main_frame_widget_route_id;
312
Oksana Zhuravlova8b88e572019-01-07 21:54:00313 DocumentScopedInterfaceBundle main_frame_interface_bundle;
Balazs Engedyba034e72017-10-27 22:26:28314
csharrison95f01e922017-04-24 18:52:35315 // Duplicated from CreateNewWindowParams because legacy code.
Daniel Murphy31bbb8b12018-02-07 21:44:10316 string cloned_session_storage_namespace_id;
Pavel Feldman08beed7842017-10-17 19:18:11317
318 // Used for devtools instrumentation and trace-ability. The token is
319 // propagated to Blink's LocalFrame and both Blink and content/
320 // can tag calls and requests with this instrumentation token in order to
321 // attribute them to the context frame.
322 // |devtools_frame_token| is only defined by the browser and is never
323 // sent back from the renderer in the control calls.
Oksana Zhuravlova34579e912018-03-23 00:18:49324 mojo_base.mojom.UnguessableToken devtools_main_frame_token;
csharrison95f01e922017-04-24 18:52:35325};
326
Yutaka Hiranof7f2f632017-09-06 10:40:08327// An opaque handle that keeps alive the associated render process even after
328// the frame is detached. Used by resource requests with "keepalive" specified.
329interface KeepAliveHandle {};
330
csharrison95f01e922017-04-24 18:52:35331// Implemented by the frame server (i.e. the browser process). For messages that
332// must be associated with the IPC channel.
333interface FrameHost {
Daniel Cheng8bb30c62017-10-23 20:40:47334 // Sent by the renderer to request the browser to create a new window. |reply|
335 // is only non-null on when status == CreateNewWindowStatus::kSuccess.
csharrison95f01e922017-04-24 18:52:35336 [Sync] CreateNewWindow(CreateNewWindowParams params)
Daniel Cheng8bb30c62017-10-23 20:40:47337 => (CreateNewWindowStatus status, CreateNewWindowReply? reply);
Yutaka Hiranof7f2f632017-09-06 10:40:08338
Lucas Furukawa Gadani99125822019-01-03 15:41:49339 // Sent by the renderer process to request the creation of a new portal.
Lucas Furukawa Gadani56dd5452019-03-22 18:23:12340 // |portal| is the interface to be used for the Portal object. Returns
Lucas Furukawa Gadani99125822019-01-03 15:41:49341 // |proxy_routing_id|, which is the routing id of the RenderFrameProxy and
342 // |portal_token|, which is the unique identifier for the portal.
Adithya Srinivasanca9f7ce2019-03-22 13:53:36343 [Sync] CreatePortal(associated blink.mojom.Portal& portal)
Lucas Furukawa Gadani99125822019-01-03 15:41:49344 => (int32 proxy_routing_id,
345 mojo_base.mojom.UnguessableToken portal_token);
346
Lucas Furukawa Gadani56dd5452019-03-22 18:23:12347 // Requests that this frame adopts the portal identified by |portal_token|.
348 // Returns |proxy_routing_id|, which is the routing id of the portal's
349 // RenderFrameProxy.
350 [Sync] AdoptPortal(mojo_base.mojom.UnguessableToken portal_token)
351 => (int32 proxy_routing_id);
352
Yutaka Hiranof7f2f632017-09-06 10:40:08353 // Creates and returns a KeepAliveHandle.
354 IssueKeepAliveHandle(KeepAliveHandle& keep_alive_handle);
Balazs Engedya40712f2017-09-15 15:01:11355
356 // Sent by the renderer when a navigation commits in the frame.
Oksana Zhuravlova8b88e572019-01-07 21:54:00357
358 // If |interface_params| is non-empty, the FrameHost implementation
359 // must unbind the old InterfaceProvider and DocumentInterfaceBroker
360 // connections, and drop any interface requests pending on them.
361 // Then it should bind the appropriate requests and start servicing
362 // GetInterface messages coming in on these new connections
Balazs Engedy0c8d550b2017-12-06 21:30:23363 // in a security context that is appropriate for the committed navigation.
364 //
Oksana Zhuravlova8b88e572019-01-07 21:54:00365 // The FrameHost implementation must enforce that |interface_params|
Balazs Engedy0c8d550b2017-12-06 21:30:23366 // is set for cross-document navigations. This prevents origin confusion by
367 // ensuring that interface requests racing with navigation commit will be
368 // either ignored, or serviced correctly in the security context of the
369 // document they originated from (based on which InterfaceProvider connection
Oksana Zhuravlova8b88e572019-01-07 21:54:00370 // the GetInterface messages arrive on or DocumentInterfaceBroker
371 // connection the Get<interface> messages arrive on).
Balazs Engedya40712f2017-09-15 15:01:11372 DidCommitProvisionalLoad(
Balazs Engedy0c8d550b2017-12-06 21:30:23373 DidCommitProvisionalLoadParams params,
Oksana Zhuravlova8b88e572019-01-07 21:54:00374 DidCommitProvisionalLoadInterfaceParams? interface_params);
Arthur Hemery7b67a972017-12-01 15:24:49375
Arthur Hemery7b0ae492018-02-05 16:04:45376 // Sent by the renderer to indicate that a same document navigation
377 // committed in the renderer process.
378 DidCommitSameDocumentNavigation(
379 DidCommitProvisionalLoadParams params);
380
Arthur Hemery7b67a972017-12-01 15:24:49381 // Sent by the renderer to request a navigation.
Marijn Kruisselbrink07bf59d52018-04-03 21:50:25382 // |blob_url_token| should be non-null when this is a navigation to a blob:
383 // URL. The token will then be used to look up the blob associated with the
384 // blob URL. Without this by the time the navigation code starts fetching
385 // the URL the blob URL might no longer be valid. |blob_url_token| is
386 // not part of BeginNavigationParams because that struct needs to be
387 // cloneable, and thus can't contain mojo interfaces.
388 // If an invalid BlobURLToken is passed in, or if the token doesn't match the
389 // url in |common_params|, the navigation will result in a network error.
Arthur Hemeryd3011f62018-05-30 10:38:44390 // |navigation_client| is passed to the renderer to allow for further control
391 // of the navigation. Allows for Commit and Cancels/Aborts. It is only valid
392 // when PerNavigationMojoInterface is enabled.
393 // TODO(ahemery): |navigation_client| should not be optional. Make it
394 // mandatory when removing PerNavigationMojoInterface feature flag.
Arthur Hemery7b67a972017-12-01 15:24:49395 BeginNavigation(
396 CommonNavigationParams common_params,
Marijn Kruisselbrink07bf59d52018-04-03 21:50:25397 BeginNavigationParams begin_params,
Arthur Hemeryd3011f62018-05-30 10:38:44398 blink.mojom.BlobURLToken? blob_url_token,
Andy Paicuc93d30862018-10-10 15:33:45399 associated NavigationClient? navigation_client,
400 blink.mojom.NavigationInitiator? navigation_initiator);
John Abd-El-Malekd4882642017-12-04 21:45:19401
402 // Sent when a subresource response has started.
Jay Civellid5904f02018-03-23 19:43:57403 // |cert_status| is the bitmask of status info of the SSL certificate. (see
404 // net/cert/cert_status_flags.h).
405 SubresourceResponseStarted(url.mojom.Url url, uint32 cert_status);
406
Jay Civelli116683f2018-03-27 19:56:23407 // Sent when a resource load finished, successfully or not.
408 ResourceLoadComplete(ResourceLoadInfo url_load_info);
Luciano Pacheco8def47f2017-12-07 06:52:30409
410 // Sent when the frame changes its window.name.
411 DidChangeName(string name, string unique_name);
412
413 // Sent when the frame starts enforcing an insecure request policy. Sending
414 // this information in DidCommitProvisionalLoad isn't sufficient; this
415 // message is needed because, for example, a document can dynamically insert
416 // a <meta> tag that causes strict mixed content checking to be enforced.
417 //
418 // Argument |policy_bitmap| represents blink::WebInsecureRequestPolicy uint8
419 // bitfield.
420 EnforceInsecureRequestPolicy(uint8 policy_bitmap);
arthursonzogni4b62a5cb2018-01-17 14:14:26421 // Elements of |set| are hashes of hosts to upgrade.
422 EnforceInsecureNavigationsSet(array<uint32> set);
Luciano Pacheco8def47f2017-12-07 06:52:30423
424 // Notifies the browser process that HTTP headers which affect the frame
425 // polices were delivered with the document being loaded into the frame. This
426 // can be either or both of 'Feature-Policy' or 'Content-Security-Policy' (
427 // which can set sandbox flags).
428 //
429 // |parsed_header| is a list of an origin whitelist for each feature in the
430 // policy.
431 DidSetFramePolicyHeaders(
432 blink.mojom.WebSandboxFlags sandbox_flags,
433 array<blink.mojom.ParsedFeaturePolicyDeclaration> parsed_header);
Austin Tankiang10d64832017-12-20 02:43:55434
435 // If a cross-process navigation was started for the initial history load in
436 // this subframe, this tries to cancel it to allow a client redirect to happen
437 // instead.
438 CancelInitialHistoryLoad();
439
440 // Change the encoding name of the page in UI when the page has detected
441 // proper encoding name. Sent for top-level frames.
442 UpdateEncoding(string encoding_name);
Lucas Furukawa Gadanie5d27a362018-02-13 14:26:02443
Lucas Gadani471160f92018-03-01 03:13:21444 // The frame's size is replicated in the browser so that the browser can
445 // correctly set the initial size of the frame in case of a cross-process
446 // navigation.
447 FrameSizeChanged(gfx.mojom.Size size);
Becca Hughesfd5d8f892018-06-14 18:23:36448
449 // Notifies the browser that the current frame has either become or is no
450 // longer fullscreen.
451 FullscreenStateChanged(bool is_fullscreen);
Clark DuValla0e42992018-09-17 17:00:11452
Dave Tapuskad6703f912019-01-31 23:13:11453 // Notifies the browser that the current frame has changed its visibility
454 // status.
455 VisibilityChanged(blink.mojom.FrameVisibility visibility);
456
Clark DuValla0e42992018-09-17 17:00:11457 // Updates information to determine whether a user gesture should carryover to
458 // future navigations. This is needed so navigations within a certain
459 // timeframe of a request initiated by a gesture will be treated as if they
460 // were initiated by a gesture too, otherwise the navigation may be blocked.
461 [EnableIf=is_android]
462 UpdateUserGestureCarryoverInfo();
Lowell Manners9499addc2019-03-12 11:05:32463
464 // Sent after the onload handler has been invoked for the document
465 // in this frame. Sent for top-level frames.
466 DocumentOnLoadCompleted();
Alexander Timin50be4492019-04-17 23:07:59467
468 // Sent by the blink's FrameScheduler when a list of active features
469 // the scheduler tracks changes.
470 // See blink::scheduler::SchedulingPolicy::Feature for the meaning
471 // of the individual bits.
472 // TODO(altimin): Move into a separate scheduling interface.
473 UpdateActiveSchedulerTrackedFeatures(uint64 features_mask);
ben76f52b242016-06-18 05:42:48474};