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