[M120 Migration][VD] Enable direct rendering for TVPlus
[platform/framework/web/chromium-efl.git] / fuchsia_web / shell / web_engine_shell.cml
1 // Copyright 2022 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 {
5   include: [
6     // CML shards intended for tests are used here because this component is
7     // launched as a test. While it doesn't fit the typical use-case for a test
8     // component, it's a useful way to be able to launch the component from a
9     // host tool and have it run somewhere it can get the capabilities it needs
10     // to function correctly.
11     // TODO(crbug.com/1410937): Run as a non-test component.
12     "//build/config/fuchsia/test/chromium_system_test_facet.shard.test-cml",
13     "//build/config/fuchsia/test/elf_test_runner.shard.test-cml",
14     "sys/component/realm_builder_absolute.shard.cml",
15
16     "syslog/client.shard.cml",
17   ],
18   program: {
19     binary: "web_engine_shell_exec",
20   },
21
22
23   use: [
24     // Required in `--use-context-provider` mode.
25
26     {
27       protocol: [
28         // Required to display the View in Scene Manager unless running in
29         // `--headless` mode.
30         "fuchsia.element.GraphicalPresenter",
31       ],
32       availability: "optional",
33     },
34
35     {
36       protocol: [
37         // The system ContextProvider is required to create the Context.
38         "fuchsia.web.ContextProvider",
39       ],
40       availability: "optional",
41     },
42
43     // The remaining are provided from this Component to the `web_instance.cm`
44     // via `CreateContextParams.service_directory`.
45
46     {
47       // Used to hold the cdm_data directory passed to the WebInstance.
48       storage: "data",
49       path: "/data",
50
51       // The `--use-context-provider` mode  does not support
52       // `--enable-web-instance-tmp` so there is no need to `use` "tmp" like
53       // the `offer` when not in `--use-context-provider` mode.
54     },
55     {
56       protocol: [
57         // Required capabilities for all WebInstance configurations.
58         "fuchsia.buildinfo.Provider",
59         "fuchsia.device.NameProvider",
60         "fuchsia.fonts.Provider",
61         "fuchsia.hwinfo.Product",
62         "fuchsia.intl.PropertyProvider",
63         // "fuchsia.logger/LogSink", is included by the shard above.
64         "fuchsia.memorypressure.Provider",
65         "fuchsia.process.Launcher",
66         "fuchsia.sysmem.Allocator",
67       ],
68       // TODO(crbug.com/1421351): Make required when `--use-context-provider`.
69       availability: "optional",
70     },
71     {
72       protocol: [
73         // Allows CPU scheduling profiles to be applied to threads to
74         // tune their performance, especially for media rendering.
75         // TODO(crbug.com/1224707): Migrate to `fuchsia.scheduler`.
76         "fuchsia.media.ProfileProvider",
77
78         // Optionally used by the tracing service.
79         // TODO(crbug.com/1364196): Offer only when enabled.
80         "fuchsia.tracing.perfetto.ProducerConnector",
81       ],
82       availability: "optional",
83     },
84     {
85       protocol: [
86         // Required by `fuchsia.web/ContextFeatureFlags.NETWORK`.
87         "fuchsia.net.interfaces.State",
88         "fuchsia.net.name.Lookup",
89         "fuchsia.posix.socket.Provider",
90
91         // Required by `fuchsia.web/ContextFeatureFlags.AUDIO`.
92         "fuchsia.media.Audio",
93         "fuchsia.media.AudioDeviceEnumerator",
94         "fuchsia.media.SessionAudioConsumerFactory",
95
96         // Required by `fuchsia.web/ContextFeatureFlags.VULKAN`.
97         // "fuchsia.tracing.provider.Registry" is optionally used by the
98         // tracing service.
99         "fuchsia.tracing.provider.Registry",
100         "fuchsia.vulkan.loader.Loader",
101
102         // Required by `fuchsia.web/ContextFeatureFlags.HARDWARE_VIDEO_DECODER`.
103         "fuchsia.mediacodec.CodecFactory",
104       ],
105       // TODO(crbug.com/1421351): Make required when `--use-context-provider`.
106       availability: "optional",
107     },
108     {
109       // Required by `fuchsia.web/ContextFeatureFlags.WIDEVINE_CDM` if the value
110       // of the GN arg `enable_widevine` at is true.
111       // TODO(crbug.com/1379411): Use a shard to conditionally `use` based on
112       // the build-time config.
113       protocol: "fuchsia.media.drm.Widevine",
114       availability: "optional",
115     },
116     {
117       protocol: [
118         // Required by the absence of `fuchsia.web/ContextFeatureFlags.HEADLESS`
119         // unless running in `--headless` mode.
120         "fuchsia.accessibility.semantics.SemanticsManager",
121         "fuchsia.ui.composition.Allocator",
122         "fuchsia.ui.composition.Flatland",
123       ],
124       availability: "optional",
125     },
126     {
127       protocol: [
128         // Required by `fuchsia.web/ContextFeatureFlags.KEYBOARD`.
129         "fuchsia.ui.input3.Keyboard",
130
131         // Required by `fuchsia.web/ContextFeatureFlags.VIRTUAL_KEYBOARD`.
132         "fuchsia.input.virtualkeyboard.ControllerCreator",
133
134         // Required by the absence of
135         // `fuchsia.web/ContextFeatureFlags.DISABLE_DYNAMIC_CODE_GENERATION`.
136         "fuchsia.kernel.VmexResource",
137       ],
138     },
139   ],
140   offer: [
141     {
142       // Required capabilities for WebInstanceHost in a child Component.
143       protocol: [
144         "fuchsia.feedback.ComponentDataRegister",
145         "fuchsia.feedback.CrashReportingProductRegister",
146       ],
147       from: "parent",
148       to: "#realm_builder",
149     },
150
151     // Offered for use by the relaunched
152     // `fuchsia_web/shell/web_engine_shell_for_web_instance_host.cml`
153     // TODO(crbug.com/1410937): Remove when running as a non-test component and
154     // thus the relaunch is no longer needed.
155     {
156       protocol: [
157         // Required to display the View in Scene Manager unless running in
158         // `--headless` mode.
159         "fuchsia.element.GraphicalPresenter",
160       ],
161       from: "parent",
162       to: "#realm_builder",
163       availability: "optional",
164     },
165
166     // The remaining are offered from the parent to `web_instance.cm` via
167     // `RealmBuilder` when not in `--use-context-provider` mode.
168
169     {
170       // Used to hold the cdm_data directory passed to web_instance.
171       storage: "data",
172       from: "parent",
173       to: "#realm_builder",
174     },
175     {
176       // Used when launched with --enable-web-instance-tmp.
177       storage: [ "tmp" ],
178       from: "parent",
179       to: "#realm_builder",
180       availability: "optional",
181     },
182     {
183       // The chromium test realm offers the system-wide config-data dir to test
184       // components. Route the web_engine sub-directory of this as required by
185       // WebInstanceHost.
186       directory: "config-data",
187       from: "parent",
188       as: "config-data-for-web-instance",
189       to: "#realm_builder",
190       subdir: "web_engine",
191       availability: "optional",
192     },
193     {
194       // Required by `fuchsia.web/ContextFeatureFlags.NETWORK`.
195       directory: "root-ssl-certificates",
196       from: "parent",
197       to: "#realm_builder",
198     },
199     {
200       // Required capabilities for all WebInstance configurations.
201       protocol: [
202         "fuchsia.buildinfo.Provider",
203         "fuchsia.device.NameProvider",
204         "fuchsia.fonts.Provider",
205         "fuchsia.hwinfo.Product",
206         "fuchsia.intl.PropertyProvider",
207         // "fuchsia.logger/LogSink", is included by the shard above.
208         "fuchsia.memorypressure.Provider",
209         "fuchsia.process.Launcher",
210         "fuchsia.sysmem.Allocator",
211       ],
212       from: "parent",
213       to: "#realm_builder",
214     },
215     {
216       protocol: [
217         // Allows CPU scheduling profiles to be applied to threads to
218         // tune their performance, especially for media rendering.
219         // TODO(crbug.com/1224707): Migrate to `fuchsia.scheduler`.
220         "fuchsia.media.ProfileProvider",
221
222         // Optionally used by the tracing service.
223         // TODO(crbug.com/1364196): Offer only when enabled.
224         "fuchsia.tracing.perfetto.ProducerConnector",
225       ],
226       from: "parent",
227       to: "#realm_builder",
228       availability: "optional",
229     },
230     {
231       protocol: [
232         // Required by `fuchsia.web/ContextFeatureFlags.NETWORK`.
233         "fuchsia.net.interfaces.State",
234         "fuchsia.net.name.Lookup",
235         "fuchsia.posix.socket.Provider",
236
237         // Required by `fuchsia.web/ContextFeatureFlags.AUDIO`.
238         "fuchsia.media.Audio",
239         "fuchsia.media.AudioDeviceEnumerator",
240         "fuchsia.media.SessionAudioConsumerFactory",
241
242         // Required by `fuchsia.web/ContextFeatureFlags.VULKAN`.
243         // "fuchsia.tracing.provider.Registry" is optionally used by the
244         // tracing service.
245         "fuchsia.tracing.provider.Registry",
246         "fuchsia.vulkan.loader.Loader",
247
248         // Required by `fuchsia.web/ContextFeatureFlags.HARDWARE_VIDEO_DECODER`.
249         "fuchsia.mediacodec.CodecFactory",
250       ],
251       from: "parent",
252       to: "#realm_builder",
253     },
254     {
255       // Required by `fuchsia.web/ContextFeatureFlags.WIDEVINE_CDM` if the value
256       // of the GN arg `enable_widevine` at is true.
257       // TODO(crbug.com/1379411): Use a shard to conditionally `offer` based on
258       // the build-time config.
259       protocol: "fuchsia.media.drm.Widevine",
260       from: "parent",
261       to: "#realm_builder",
262       availability: "optional",
263     },
264     {
265       protocol: [
266         // Required by the absence of `fuchsia.web/ContextFeatureFlags.HEADLESS`
267         // unless running in `--headless` mode.
268         "fuchsia.accessibility.semantics.SemanticsManager",
269         "fuchsia.ui.composition.Allocator",
270         "fuchsia.ui.composition.Flatland",
271       ],
272       from: "parent",
273       to: "#realm_builder",
274       availability: "optional",
275     },
276     {
277       protocol: [
278         // Required by `fuchsia.web/ContextFeatureFlags.KEYBOARD`.
279         "fuchsia.ui.input3.Keyboard",
280
281         // Required by `fuchsia.web/ContextFeatureFlags.VIRTUAL_KEYBOARD`.
282         "fuchsia.input.virtualkeyboard.ControllerCreator",
283
284         // Required by the absence of
285         // `fuchsia.web/ContextFeatureFlags.DISABLE_DYNAMIC_CODE_GENERATION`.
286         "fuchsia.kernel.VmexResource",
287       ],
288       from: "parent",
289       to: "#realm_builder",
290     },
291   ],
292   facets: {
293     // TODO(crbug.com/1410937): Remove when converting to a non-test component.
294     "fuchsia.test": {
295       "deprecated-allowed-packages": [
296         "web_engine",
297         "web_engine_with_webui",
298       ],
299     },
300   },
301 }