blob: ad8c015e5954a0ba300c057d1b85b826056372f9 [file] [log] [blame]
rockot067ca55f2016-09-30 22:00:151// Copyright 2016 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
7import "content/common/native_types.mojom";
Makoto Shimazu7af43ee2017-08-25 10:20:408import "content/common/service_worker/embedded_worker.mojom";
Ken Rockotfd907632017-09-14 04:23:419import "ipc/constants.mojom";
tbansal99d8aeb2017-05-22 19:12:5810import "mojo/common/time.mojom";
Pavel Feldman25234722017-10-11 02:49:0611import "mojo/common/unguessable_token.mojom";
Balazs Engedyba034e72017-10-27 22:26:2812import "services/service_manager/public/interfaces/interface_provider.mojom";
rockot067ca55f2016-09-30 22:00:1513import "ui/gfx/geometry/mojo/geometry.mojom";
14import "ui/gfx/mojo/icc_profile.mojom";
15
16struct CreateViewParams {
17 // Renderer-wide preferences.
18 RendererPreferences renderer_preferences;
19
20 // Preferences for this view.
21 WebPreferences web_preferences;
22
23 // The ID of the view to be created.
24 int32 view_id = IPC.mojom.kRoutingIdNone;
25
Balazs Engedyba034e72017-10-27 22:26:2826 // The ID of the main frame hosted in the view, or None if creating a view to
27 // host a main frame proxy.
rockot067ca55f2016-09-30 22:00:1528 int32 main_frame_routing_id = IPC.mojom.kRoutingIdNone;
29
Balazs Engedyba034e72017-10-27 22:26:2830 // The InterfaceProvider through which the main RenderFrame can access
31 // services exposed by its RenderFrameHost.
32 //
33 // This is null precisely when |main_frame_routing_id| is MSG_ROUTING_NONE,
34 // that is, when creating a RenderView for a remote main frame.
35 service_manager.mojom.InterfaceProvider? main_frame_interface_provider;
36
rockot067ca55f2016-09-30 22:00:1537 // The ID of the widget for the main frame.
38 int32 main_frame_widget_routing_id = IPC.mojom.kRoutingIdNone;
39
40 // The session storage namespace ID this view should use.
41 int64 session_storage_namespace_id;
42
43 // The route ID of the opener RenderFrame or RenderFrameProxy, if we need to
44 // set one (MSG_ROUTING_NONE otherwise).
45 int32 opener_frame_route_id = IPC.mojom.kRoutingIdNone;
46
47 // Whether the RenderView should initially be swapped out.
48 bool swapped_out;
49
50 // Carries replicated information, such as frame name and sandbox flags, for
51 // this view's main frame, which will be a proxy in |swapped_out|
52 // views when in --site-per-process mode, or a RenderFrame in all other
53 // cases.
54 FrameReplicationState replicated_frame_state;
55
Pavel Feldman25234722017-10-11 02:49:0656 // Used for devtools instrumentation and trace-ability. The token is
57 // propagated to Blink's LocalFrame and both Blink and content/
58 // can tag calls and requests with this instrumentation token in order to
59 // attribute them to the context frame.
60 // |devtools_main_frame_token| is only defined by the browser and is never
61 // sent back from the renderer in the control calls.
62 mojo.common.mojom.UnguessableToken devtools_main_frame_token;
63
rockot067ca55f2016-09-30 22:00:1564 // The ID of the proxy object for the main frame in this view. It is only
65 // used if |swapped_out| is true.
66 int32 proxy_routing_id = IPC.mojom.kRoutingIdNone;
67
68 // Whether the RenderView should initially be hidden.
69 bool hidden;
70
71 // Whether the RenderView will never be visible.
72 bool never_visible;
73
74 // Whether the window associated with this view was created with an opener.
75 bool window_was_created_with_opener;
76
rockot067ca55f2016-09-30 22:00:1577 // The initial renderer size.
78 ResizeParams initial_size;
79
80 // Whether to enable auto-resize.
81 bool enable_auto_resize;
82
83 // The minimum size to layout the page if auto-resize is enabled.
84 gfx.mojom.Size min_size;
85
86 // The maximum size to layout the page if auto-resize is enabled.
87 gfx.mojom.Size max_size;
88
89 // The page zoom level.
90 double page_zoom_level;
rockot067ca55f2016-09-30 22:00:1591};
92
rockot53be7caf2016-10-04 20:17:0893struct CreateFrameWidgetParams {
94 // Gives the routing ID for the RenderWidget that will be attached to the
95 // new RenderFrame. If the RenderFrame does not need a RenderWidget, this
96 // is MSG_ROUTING_NONE and the other parameters are not read.
97 int32 routing_id;
98
99 // Tells the new RenderWidget whether it is initially hidden.
100 bool hidden;
101};
102
103struct CreateFrameParams {
104 // Specifies the routing ID of the new RenderFrame object.
105 int32 routing_id;
106
107 // If a valid |proxy_routing_id| is provided, the new frame will be
108 // configured to replace the proxy on commit.
109 int32 proxy_routing_id;
110
111 // Specifies the new frame's opener. The opener will be null if this is
112 // MSG_ROUTING_NONE.
113 int32 opener_routing_id;
114
115 // The new frame should be created as a child of the object
116 // identified by |parent_routing_id| or as top level if that is
117 // MSG_ROUTING_NONE.
118 int32 parent_routing_id;
119
120 // Identifies the previous sibling of the new frame, so that the new frame is
121 // inserted into the correct place in the frame tree. If this is
122 // MSG_ROUTING_NONE, the frame will be created as the leftmost child of its
123 // parent frame, in front of any other children.
124 int32 previous_sibling_routing_id;
125
Balazs Engedyba034e72017-10-27 22:26:28126 // The InterfaceProvider through which the RenderFrame can access services
127 // exposed by its RenderFrameHost.
128 service_manager.mojom.InterfaceProvider interface_provider;
129
rockot53be7caf2016-10-04 20:17:08130 // When the new frame has a parent, |replication_state| holds the new frame's
131 // properties replicated from the process rendering the parent frame, such as
132 // the new frame's sandbox flags.
133 FrameReplicationState replication_state;
134
Pavel Feldman25234722017-10-11 02:49:06135 // Used for devtools instrumentation and trace-ability. The token is
136 // propagated to Blink's LocalFrame and both Blink and content/
137 // can tag calls and requests with this instrumentation token in order to
138 // attribute them to the context frame.
139 // |devtools_frame_token| is only defined by the browser and is never
140 // sent back from the renderer in the control calls.
141 mojo.common.mojom.UnguessableToken devtools_frame_token;
142
rockot53be7caf2016-10-04 20:17:08143 // When the new frame has a parent, |frame_owner_properties| holds the
144 // properties of the HTMLFrameOwnerElement from the parent process.
145 // Note that unlike FrameReplicationState, this is not replicated for remote
146 // frames.
147 FrameOwnerProperties frame_owner_properties;
148
149 // Specifies properties for a new RenderWidget that will be attached to the
150 // new RenderFrame (if one is needed).
151 CreateFrameWidgetParams widget_params;
152};
153
rockota2db0da2016-10-18 17:39:11154struct UpdateScrollbarThemeParams {
155 float initial_button_delay;
156 float autoscroll_button_delay;
157 bool jump_on_track_click;
158 ScrollerStyle preferred_scroller_style;
159 bool redraw;
160 ScrollbarButtonsPlacement button_placement;
Greg Kerra7b943b2017-07-24 23:17:17161 bool scroll_view_rubber_banding;
rockota2db0da2016-10-18 17:39:11162};
rockot53be7caf2016-10-04 20:17:08163
rockot067ca55f2016-09-30 22:00:15164// The primordial Channel-associated interface implemented by a render process.
165// This should be used for implementing browser-to-renderer control messages
166// which need to retain FIFO with respect to legacy IPC messages.
167interface Renderer {
168 // Tells the renderer to create a new view.
169 CreateView(CreateViewParams params);
rockot53be7caf2016-10-04 20:17:08170
171 // Tells the renderer to create a new RenderFrame.
172 CreateFrame(CreateFrameParams params);
173
Makoto Shimazu7af43ee2017-08-25 10:20:40174 // Tells the renderer to create an EmbeddedWorkerInstanceClient, which is what
175 // manages service worker startup and shutdown.
176 // TODO(shimazu): Create a service worker's execution context by this method
177 // instead of just creating an instance of EmbeddedWorkerInstanceClient.
178 SetUpEmbeddedWorkerChannelForServiceWorker(
179 associated EmbeddedWorkerInstanceClient& client_request);
180
rockot53be7caf2016-10-04 20:17:08181 // Tells the renderer to create a new RenderFrameProxy object with
182 // |routing_id|. |render_view_routing_id| identifies the
183 // RenderView to be associated with this proxy. The new proxy's opener should
184 // be set to the object identified by |opener_routing_id|, or to null if that
185 // is MSG_ROUTING_NONE. The new proxy should be created as a child of the
186 // object identified by |parent_routing_id| or as top level if that is
187 // MSG_ROUTING_NONE.
188 CreateFrameProxy(int32 routing_id, int32 render_view_routing_id,
189 int32 opener_routing_id, int32 parent_routing_id,
190 FrameReplicationState replication_state);
rockota2db0da2016-10-18 17:39:11191
192 // Tells the renderer that the network type has changed so that
193 // navigator.onLine and navigator.connection can be updated.
194 OnNetworkConnectionChanged(NetworkConnectionType connection_type,
195 double max_bandwidth_mbps);
196
tbansal15973c32017-05-10 18:40:44197 // Tells the renderer process that the network quality estimate has changed.
tbansalb612c5d2017-05-25 18:53:06198 // EffectiveConnectionType is the connection type whose typical performance is
199 // most similar to the measured performance of the network in use.
tbansal99d8aeb2017-05-22 19:12:58200 // The downstream throughput is computed in kilobits per second. If an
Ken Rockotfd907632017-09-14 04:23:41201 // estimate of the HTTP or transport RTT is unavailable, it will be set to
tbansal99d8aeb2017-05-22 19:12:58202 // net::nqe::internal::InvalidRTT(). If the throughput estimate is
zhuoyu.qiand80590e52017-10-30 10:23:51203 // unavailable, it will be set to net::nqe::internal::INVALID_RTT_THROUGHPUT.
tbansalb612c5d2017-05-25 18:53:06204 OnNetworkQualityChanged(EffectiveConnectionType effective_connection_type,
205 mojo.common.mojom.TimeDelta http_rtt,
tbansal99d8aeb2017-05-22 19:12:58206 mojo.common.mojom.TimeDelta transport_rtt,
207 double bandwidth_kbps);
tbansal15973c32017-05-10 18:40:44208
rockota2db0da2016-10-18 17:39:11209 // Tells the renderer to suspend/resume the webkit timers. Only for use on
210 // Android.
211 SetWebKitSharedTimersSuspended(bool suspend);
212
213 // Tells the renderer about a scrollbar appearance change. Only for use on
214 // OS X.
215 UpdateScrollbarTheme(UpdateScrollbarThemeParams params);
216
217 // Notification that the OS X Aqua color preferences changed.
218 OnSystemColorsChanged(int32 aqua_color_variant, string highlight_text_color,
219 string highlight_color);
220
221 // Tells the renderer to empty its plugin list cache, optional reloading
222 // pages containing plugins.
223 PurgePluginListCache(bool reload_pages);
Nicholas Verne5420564d2017-10-27 07:37:54224
225
226 // Tells the renderer process to enter or leave background mode.
227 // TODO(crbug:676224) Make this conditional on IPC_MESSAGE_LOG_ENABLED.
228 SetProcessBackgrounded(bool background);
229
230 // Tells the renderer process to purge and suspend.
231 ProcessPurgeAndSuspend();
rockot067ca55f2016-09-30 22:00:15232};