1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
|
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module content.mojom;
import "content/common/document_scoped_interface_bundle.mojom";
import "content/common/native_types.mojom";
import "content/public/common/web_preferences.mojom";
import "ipc/constants.mojom";
import "mojo/public/mojom/base/generic_pending_receiver.mojom";
import "mojo/public/mojom/base/time.mojom";
import "mojo/public/mojom/base/unguessable_token.mojom";
import "services/network/public/mojom/network_types.mojom";
import "third_party/blink/public/mojom/frame/frame_owner_properties.mojom";
import "third_party/blink/public/mojom/manifest/manifest.mojom";
import "third_party/blink/public/mojom/page/page.mojom";
import "third_party/blink/public/mojom/page/widget.mojom";
import "third_party/blink/public/mojom/renderer_preferences.mojom";
import "third_party/blink/public/mojom/user_agent/user_agent_metadata.mojom";
import "ui/gfx/geometry/mojom/geometry.mojom";
struct CreateViewParams {
// Renderer-wide preferences.
blink.mojom.RendererPreferences renderer_preferences;
// Preferences for this view.
WebPreferences web_preferences;
// The ID of the view to be created.
int32 view_id = IPC.mojom.kRoutingIdNone;
// The ID of the main frame hosted in the view, or None if creating a view to
// host a main frame proxy. If this is None, then |proxy_routing_id| should be
// set to something other than None. The |main_frame_widget_routing_id| is
// None if this is None.
int32 main_frame_routing_id = IPC.mojom.kRoutingIdNone;
// The ID of the widget for the main frame. The |main_frame_routing_id| is
// None if this is None.
int32 main_frame_widget_routing_id = IPC.mojom.kRoutingIdNone;
// This is null precisely when |main_frame_routing_id| is MSG_ROUTING_NONE,
// that is, when creating a RenderView for a remote main frame.
DocumentScopedInterfaceBundle? main_frame_interface_bundle;
// The communication interfaces for the WebFrameWidget in blink. All should
// be set if there is a |main_frame_routing_id|.
pending_associated_remote<blink.mojom.FrameWidgetHost>? frame_widget_host;
pending_associated_receiver<blink.mojom.FrameWidget>? frame_widget;
pending_associated_remote<blink.mojom.WidgetHost>? widget_host;
pending_associated_receiver<blink.mojom.Widget>? widget;
// The session storage namespace ID this view should use.
string session_storage_namespace_id;
// The route ID of the opener RenderFrame or RenderFrameProxy, if we need to
// set one (MSG_ROUTING_NONE otherwise).
int32 opener_frame_route_id = IPC.mojom.kRoutingIdNone;
// Carries replicated information, such as frame name and sandbox flags, for
// this view's main frame, which will be a proxy when |main_frame_routing_id|
// is None (due to site isolation), or a RenderFrame in all other cases.
FrameReplicationState replicated_frame_state;
// This represents the frame token for the MainFrame. It will be always set.
// If |main_frame_routing_id| is set, it will store a unique identifier for
// the LocalFrame<-->RenderFrameHostImpl mapping.
// If |proxy_routing_id| is set, it will store a unique identifier for
// the RemoteFrame<-->RenderFrameProxyHost mapping.
mojo_base.mojom.UnguessableToken main_frame_frame_token;
// Used for devtools instrumentation and trace-ability. The token is
// propagated to Blink's LocalFrame and both Blink and content/
// can tag calls and requests with this instrumentation token in order to
// attribute them to the context frame.
// |devtools_main_frame_token| is only defined by the browser and is never
// sent back from the renderer in the control calls.
mojo_base.mojom.UnguessableToken devtools_main_frame_token;
// The ID of the proxy object for the main frame in this view. It is only
// used if |main_frame_routing_id| is None, and exactly one of the two
// should be set to an id other than None at any time.
int32 proxy_routing_id = IPC.mojom.kRoutingIdNone;
// Whether the RenderView should initially be hidden.
bool hidden;
// When true, all RenderWidgets under this RenderView will never be shown to
// the user, and thus never composited, and will not need to produce pixels
// for display. This allows the renderer to optimize and avoid resources used
// for displaying graphical output.
bool never_composited;
// Whether the window associated with this view was created with an opener.
bool window_was_created_with_opener;
// Whether or not the frame has previously committed a real load.
bool has_committed_real_load;
// Initial state for the main frame RenderWidget.
// TODO(danakj): This should be optional and not included when there is no
// main_frame_widget_routing_id.
VisualProperties visual_properties;
// Whether lookup of frames in the created RenderView (e.g. lookup via
// window.open or via <a target=...>) should be renderer-wide (i.e. going
// beyond the usual opener-relationship-based BrowsingInstance boundaries).
bool renderer_wide_named_frame_lookup;
// Set this to true when creating a RenderView inside a portal.
bool inside_portal;
// Endpoint for any messages that are broadcast to all views in a WebContents.
pending_associated_receiver<blink.mojom.PageBroadcast> blink_page_broadcast;
};
struct CreateFrameWidgetParams {
// Gives the routing ID for the RenderWidget that will be attached to the
// new RenderFrame.
int32 routing_id;
// The communication interfaces for the WebFrameWidget in blink.
pending_associated_remote<blink.mojom.FrameWidgetHost> frame_widget_host;
pending_associated_receiver<blink.mojom.FrameWidget> frame_widget;
pending_associated_remote<blink.mojom.WidgetHost> widget_host;
pending_associated_receiver<blink.mojom.Widget> widget;
// The initial visual properties of the widget.
VisualProperties visual_properties;
};
struct CreateFrameParams {
// Specifies the routing ID of the new RenderFrame object.
int32 routing_id;
// If a valid |previous_routing_id| is provided, the new frame will be
// configured to replace either the previous frame or the previous proxy on
// commit.
int32 previous_routing_id;
// The frame token. It is a unique identifier for
// the LocalFrame<-->RenderFrameHostImpl mapping.
mojo_base.mojom.UnguessableToken frame_token;
// Specifies the new frame's opener. The opener will be null if this is
// MSG_ROUTING_NONE.
int32 opener_routing_id;
// The new frame should be created as a child of the object
// identified by |parent_routing_id| or as top level if that is
// MSG_ROUTING_NONE.
int32 parent_routing_id;
// Identifies the previous sibling of the new frame, so that the new frame is
// inserted into the correct place in the frame tree. If this is
// MSG_ROUTING_NONE, the frame will be created as the leftmost child of its
// parent frame, in front of any other children.
int32 previous_sibling_routing_id;
DocumentScopedInterfaceBundle interface_bundle;
// When the new frame has a parent, |replication_state| holds the new frame's
// properties replicated from the process rendering the parent frame, such as
// the new frame's sandbox flags.
FrameReplicationState replication_state;
// Used for devtools instrumentation and trace-ability. The token is
// propagated to Blink's LocalFrame and both Blink and content/
// can tag calls and requests with this instrumentation token in order to
// attribute them to the context frame.
// |devtools_frame_token| is only defined by the browser and is never
// sent back from the renderer in the control calls.
mojo_base.mojom.UnguessableToken devtools_frame_token;
// When the new frame has a parent, |frame_owner_properties| holds the
// properties of the HTMLFrameOwnerElement from the parent process.
// Note that unlike FrameReplicationState, this is not replicated for remote
// frames.
blink.mojom.FrameOwnerProperties frame_owner_properties;
// Specifies properties for a new RenderWidget that will be attached to the
// new RenderFrame (if one is needed).
CreateFrameWidgetParams? widget_params;
// Whether or not the frame has previously committed a real load.
bool has_committed_real_load;
};
struct UpdateScrollbarThemeParams {
// TODO(avi): Update these to optional values when optional numeric types are
// allowed. (https://crbug.com/657632)
bool has_initial_button_delay;
float initial_button_delay;
bool has_autoscroll_button_delay;
float autoscroll_button_delay;
bool jump_on_track_click;
ScrollerStyle preferred_scroller_style;
bool redraw;
bool scroll_view_rubber_banding;
};
struct UpdateSystemColorInfoParams {
bool is_dark_mode;
bool is_high_contrast;
// uint32 represents a SkColor in the map.
map<SystemThemeColor, uint32> colors;
};
// The background state for the render process. When backgrounded the process's
// priority will be lower (via base::Process::SetProcessBackgrounded()) if
// allowed on the current platform (as determined by
// base::Process::CanBackgroundProcesses()).
enum RenderProcessBackgroundState {
// The renderer process has not been backgrounded, a hidden renderer may still
// be foregrounded, e.g. when it is playing audio.
kForegrounded,
// The renderer process has been backgrounded, a visible renderer may still
// be backgrounded, e.g. when it is hosting only low priority frames.
kBackgrounded,
};
// The visibility state for the renderer process, indicating whether or not any
// of the frames associated with the renderer process are visible.
enum RenderProcessVisibleState {
kVisible,
kHidden,
};
// The primordial Channel-associated interface implemented by a render process.
// This should be used for implementing browser-to-renderer control messages
// which need to retain FIFO with respect to legacy IPC messages.
interface Renderer {
// Tells the renderer to create a new view.
CreateView(CreateViewParams params);
// Tells the renderer to destroy an existing view. This method must be called
// exactly once for each invocation of CreateView. |view_id| is synonymous
// with |routing_id|.
DestroyView(int32 view_id);
// Tells the renderer to create a new RenderFrame.
CreateFrame(CreateFrameParams params);
// Tells the renderer to create a new RenderFrameProxy object with
// |routing_id|. |render_view_routing_id| identifies the
// RenderView to be associated with this proxy. The new proxy's opener should
// be set to the object identified by |opener_routing_id|, or to null if that
// is MSG_ROUTING_NONE. The new proxy should be created as a child of the
// object identified by |parent_routing_id| or as top level if that is
// MSG_ROUTING_NONE.
// |proxy_frame_token| is used uniquely identify the
// RemoteFrame <--> RenderFrameProxyHost mapping.
// |devtools_frame_token| is used for devtools instrumentation
// and trace-ability. It is defined by the browser and is never
// sent back from the renderer in the control calls.
CreateFrameProxy(int32 routing_id, int32 render_view_routing_id,
int32 opener_routing_id, int32 parent_routing_id,
FrameReplicationState replication_state,
mojo_base.mojom.UnguessableToken proxy_frame_token,
mojo_base.mojom.UnguessableToken devtools_frame_token);
// Tells the renderer that the network type has changed so that
// navigator.onLine and navigator.connection can be updated.
OnNetworkConnectionChanged(NetworkConnectionType connection_type,
double max_bandwidth_mbps);
// Tells the renderer process that the network quality estimate has changed.
// EffectiveConnectionType is the connection type whose typical performance is
// most similar to the measured performance of the network in use.
// The downstream throughput is computed in kilobits per second. If an
// estimate of the HTTP or transport RTT is unavailable, it will be set to
// net::nqe::internal::InvalidRTT(). If the throughput estimate is
// unavailable, it will be set to net::nqe::internal::INVALID_RTT_THROUGHPUT.
OnNetworkQualityChanged(
network.mojom.EffectiveConnectionType effective_connection_type,
mojo_base.mojom.TimeDelta http_rtt,
mojo_base.mojom.TimeDelta transport_rtt,
double bandwidth_kbps);
// Tells the renderer to suspend/resume the webkit timers. Only for use on
// Android.
SetWebKitSharedTimersSuspended(bool suspend);
// Sets the user-agent string. This is needed because getting the value in the
// renderer from the system leads to a wrong value due to sandboxing. This
// must be called as early as possible, during the renderer process
// initialization.
SetUserAgent(string user_agent);
// Sets the user agent metadata. This will replace `SetUserAgent()` if we
// decide to ship https://github.com/WICG/ua-client-hints.
SetUserAgentMetadata(blink.mojom.UserAgentMetadata metadata);
// Tells the renderer about a scrollbar appearance change. Only for use on
// OS X.
UpdateScrollbarTheme(UpdateScrollbarThemeParams params);
// Notification that the OS X Aqua color preferences changed.
OnSystemColorsChanged(int32 aqua_color_variant, string highlight_text_color,
string highlight_color);
// Tells the renderer process the new system color info.
UpdateSystemColorInfo(UpdateSystemColorInfoParams params);
// Tells the renderer to empty its plugin list cache, optional reloading
// pages containing plugins.
PurgePluginListCache(bool reload_pages);
// Tells the renderer process of a change in visibility or background state.
SetProcessState(RenderProcessBackgroundState background_state,
RenderProcessVisibleState visible_state);
// Tells the scheduler about "keep-alive" state which can be due to:
// service workers, shared workers, or fetch keep-alive.
// If set to true, then the scheduler should not freeze the renderer.
SetSchedulerKeepActive(bool keep_active);
// Tells the renderer process that it has been locked to a site (i.e., a
// scheme plus eTLD+1, such as https://google.com), or to a more specific
// origin.
SetIsLockedToSite();
// Tells the renderer to enable V8's memory saving mode when possible.
// This is only used when site-per-process is enabled. If the process
// only contains subframes, V8's low memory mode will be enabled.
// If a main frame exists or is created, the low memory mode will
// be disabled.
EnableV8LowMemoryMode();
// Write out the accumulated code profiling profile to the configured file.
// The callback is invoked once the profile has been flushed to disk.
[EnableIf=clang_profiling_inside_sandbox]
WriteClangProfilingProfile() => ();
};
|