Closed Bug 1824447 Opened 3 years ago Closed 3 years ago

WebGPU API should only be available in secure contexts

Categories

(Core :: Graphics: WebGPU, defect)

defect

Tracking

()

RESOLVED FIXED
113 Branch
Tracking Status
firefox113 --- fixed

People

(Reporter: jimb, Assigned: jimb, NeedInfo)

References

Details

Attachments

(1 file, 1 obsolete file)

It's standard practice now for newly introduced content-visible web APIs to be available only in secure contexts, to encourage the adoption of https. WebGPU's API was marked in this way in gpuweb#1363. Firefox's WebIDL needs to be updated to match.

Adding as a blocker of webgpu-in-nightly because dom/tests/mochitest/general/test_interfaces.js won't pass unless we properly describe where the WebGPU properties should be visible, and I don't want to expose it in an insecure context even temporarily.

Assignee: nobody → jimb

In gpuweb#1709, the WebGPU WebIDL switched to using namespaces for enumerated constants, apparently because the bikeshed spec formatting software was now able to handle that. Change Firefox's WebIDL to match.

Add the [[SecureContext]] extended attribute to all interfaces in dom/webidl/WebGPU.webidl, to match the specification.

It's standard practice now for newly introduced content-visible web APIs to be available only in secure contexts, to encourage the adoption of https. WebGPU's API was marked in this way in gpuweb#1363. Firefox's WebIDL needs to be updated to match.

WebGPU's namespaces are not marked as [SecureContext], because our WebIDL compiler doesn't yet support that attribute on namespaces.

[[SecureContext]]: https://webidl.spec.whatwg.org/#SecureContext

Depends on D173583

Our WebIDL compiler doesn't support [SecureContext] on namespaces yet, so we'll have to drop the first patch here.

Attachment #9324965 - Attachment is obsolete: true
Pushed by jblandy@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/68cd13be1b19 Make WebGPU interfaces available only in secure contexts. r=webgpu-reviewers,webidl,saschanaz,jgilbert

Tests updated, back up for review.

Flags: needinfo?(jimb)
Pushed by jblandy@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/754743cbc36b Make WebGPU interfaces available only in secure contexts. r=webgpu-reviewers,webidl,saschanaz,jgilbert

Backed out for xpcshell failure on test_FeatureGate.js

Backout link: https://hg.mozilla.org/integration/autoland/rev/c128f8596bbc1b7fd38111d674d8f98a271dd7ce
Log link: https://treeherder.mozilla.org/logviewer?job_id=410699346&repo=autoland&lineNumber=2846

Log snippet:

[task 2023-03-29T19:12:43.770Z] 19:12:43     INFO -  TEST-PASS | toolkit/components/featuregates/test/unit/test_FeatureGate.js | testAllDefaultsMatchSettings - [testAllDefaultsMatchSettings : 439] Feature browser.urlbar.keepPanelOpenDuringImeComposition should match runtime value. - false == false
[task 2023-03-29T19:12:43.770Z] 19:12:43  WARNING -  TEST-UNEXPECTED-FAIL | toolkit/components/featuregates/test/unit/test_FeatureGate.js | testAllDefaultsMatchSettings - [testAllDefaultsMatchSettings : 439] Feature dom.webgpu.enabled should match runtime value. - false == true
[task 2023-03-29T19:12:43.771Z] 19:12:43     INFO -  /builds/worker/workspace/build/tests/xpcshell/tests/toolkit/components/featuregates/test/unit/test_FeatureGate.js:testAllDefaultsMatchSettings:439
[task 2023-03-29T19:12:43.771Z] 19:12:43     INFO -  /builds/worker/workspace/build/tests/xpcshell/head.js:_do_main:238
[task 2023-03-29T19:12:43.771Z] 19:12:43     INFO -  /builds/worker/workspace/build/tests/xpcshell/head.js:_execute_test:585
[task 2023-03-29T19:12:43.772Z] 19:12:43     INFO -  -e:null:1
[task 2023-03-29T19:12:43.772Z] 19:12:43     INFO -  exiting test
[task 2023-03-29T19:12:43.772Z] 19:12:43     INFO -  Unexpected exception NS_ERROR_ABORT:
[task 2023-03-29T19:12:43.772Z] 19:12:43     INFO -  _abort_failed_test@/builds/worker/workspace/build/tests/xpcshell/head.js:868:20
[task 2023-03-29T19:12:43.773Z] 19:12:43     INFO -  do_report_result@/builds/worker/workspace/build/tests/xpcshell/head.js:977:5
[task 2023-03-29T19:12:43.773Z] 19:12:43     INFO -  Assert<@/builds/worker/workspace/build/tests/xpcshell/head.js:71:21
[task 2023-03-29T19:12:43.773Z] 19:12:43     INFO -  Assert.prototype.report@resource://testing-common/Assert.sys.mjs:240:10
[task 2023-03-29T19:12:43.774Z] 19:12:43     INFO -  equal@resource://testing-common/Assert.sys.mjs:282:8
[task 2023-03-29T19:12:43.774Z] 19:12:43     INFO -  testAllDefaultsMatchSettings@/builds/worker/workspace/build/tests/xpcshell/tests/toolkit/components/featuregates/test/unit/test_FeatureGate.js:439:12
[task 2023-03-29T19:12:43.774Z] 19:12:43     INFO -  _do_main@/builds/worker/workspace/build/tests/xpcshell/head.js:238:6
[task 2023-03-29T19:12:43.775Z] 19:12:43     INFO -  _execute_test@/builds/worker/workspace/build/tests/xpcshell/head.js:585:5
[task 2023-03-29T19:12:43.775Z] 19:12:43     INFO -  @-e:1:1
[task 2023-03-29T19:12:43.775Z] 19:12:43     INFO -  exiting test
[task 2023-03-29T19:12:43.775Z] 19:12:43     INFO -  <<<<<<<
[task 2023-03-29T19:12:43.776Z] 19:12:43     INFO -  INFO | Result summary:
[task 2023-03-29T19:12:43.776Z] 19:12:43     INFO -  INFO | Passed: 91
[task 2023-03-29T19:12:43.776Z] 19:12:43  WARNING -  INFO | Failed: 1
[task 2023-03-29T19:12:43.776Z] 19:12:43  WARNING -  One or more unittests failed.
[task 2023-03-29T19:12:43.776Z] 19:12:43     INFO -  INFO | Todo: 0
[task 2023-03-29T19:12:43.776Z] 19:12:43     INFO -  INFO | Retried: 1
[task 2023-03-29T19:12:43.777Z] 19:12:43     INFO -  SUITE-END | took 206s
[task 2023-03-29T19:12:43.777Z] 19:12:43     INFO -  Node moz-http2 server shutting down ...
[task 2023-03-29T19:12:43.777Z] 19:12:43     INFO -  http3Server server shutting down ...
[task 2023-03-29T19:12:43.879Z] 19:12:43     INFO - Return code: 1
[task 2023-03-29T19:12:43.879Z] 19:12:43     INFO - TinderboxPrint: xpcshell-xpcshell<br/>91/<em class="testfail">1</em>/0
[task 2023-03-29T19:12:43.880Z] 19:12:43  WARNING - setting return code to 2
[task 2023-03-29T19:12:43.880Z] 19:12:43     INFO - The xpcshell suite: xpcshell ran with return status: FAILURE
[task 2023-03-29T19:12:43.880Z] 19:12:43     INFO - Running post-action listener: _package_coverage_data
[task 2023-03-29T19:12:43.880Z] 19:12:43     INFO - Running post-action listener: _resource_record_post_action
[task 2023-03-29T19:12:43.881Z] 19:12:43     INFO - Running post-action listener: process_java_coverage_data
[task 2023-03-29T19:12:43.881Z] 19:12:43     INFO - [mozharness: 2023-03-29 19:12:43.879843Z] Finished run-tests step (success)
[task 2023-03-29T19:12:43.881Z] 19:12:43     INFO - [mozharness: 2023-03-29 19:12:43.879892Z] Running uninstall step.
[task 2023-03-29T19:12:43.882Z] 19:12:43     INFO - Running pre-action listener: _resource_record_pre_action
[task 2023-03-29T19:12:43.882Z] 19:12:43     INFO - Running main action method: uninstall
[task 2023-03-29T19:12:43.883Z] 19:12:43     INFO - Skipping uninstall for non-MSIX test
[task 2023-03-29T19:12:43.883Z] 19:12:43     INFO - Running post-action listener: _resource_record_post_action
[task 2023-03-29T19:12:43.883Z] 19:12:43     INFO - [mozharness: 2023-03-29 19:12:43.880445Z] Finished uninstall step (success)
[task 2023-03-29T19:12:43.884Z] 19:12:43     INFO - Running post-run listener: _resource_record_post_run
[task 2023-03-29T19:12:43.932Z] 19:12:43     INFO - Validating Perfherder data against /builds/worker/workspace/mozharness/external_tools/performance-artifact-schema.json
[task 2023-03-29T19:12:43.935Z] 19:12:43     INFO - PERFHERDER_DATA: {"framework": {"name": "job_resource_usage"}, "suites": [{"name": "xpcshell.xpcshell.overall", "extraOptions": ["e10s", "taskcluster-projects/887720501152/machineTypes/n2-standard-2"], "subtests": [{"name": "cpu_percent", "value": 53.389709443099285}, {"name": "io_write_bytes", "value": 3219386368}, {"name": "io.read_bytes", "value": 39284736}, {"name": "io_write_time", "value": 940916}, {"name": "io_read_time", "value": 1156}]}, {"name": "xpcshell.xpcshell.start-pulseaudio", "subtests": [{"name": "time", "value": 0.02334451675415039}, {"name": "cpu_percent", "value": 0}]}, {"name": "xpcshell.xpcshell.install", "subtests": [{"name": "time", "value": 42.10404419898987}, {"name": "cpu_percent", "value": 50.70487804878049}]}, {"name": "xpcshell.xpcshell.stage-files", "subtests": [{"name": "time", "value": 0.0789186954498291}, {"name": "cpu_percent", "value": 0}]}, {"name": "xpcshell.xpcshell.run-tests", "subtests": [{"name": "time", "value": 372.1125900745392}, {"name": "cpu_percent", "value": 53.67189189189191}]}, {"name": "xpcshell.xpcshell.uninstall", "subtests": [{"name": "time", "value": 0.0002961158752441406}, {"name": "cpu_percent", "value": 0}]}]}
[task 2023-03-29T19:12:43.936Z] 19:12:43     INFO - Total resource usage - Wall time: 414s; CPU: Can't collect data; Read bytes: 39284736; Write bytes: 3219386368; Read time: 1156; Write time: 940916
[task 2023-03-29T19:12:43.937Z] 19:12:43     INFO - TinderboxPrint: I/O read bytes / time<br/>39,284,736 / 1,156
[task 2023-03-29T19:12:43.938Z] 19:12:43     INFO - TinderboxPrint: I/O write bytes / time<br/>3,219,386,368 / 940,916
[task 2023-03-29T19:12:43.939Z] 19:12:43     INFO - TinderboxPrint: CPU idle<br/>383.1 (46.5%)
[task 2023-03-29T19:12:43.939Z] 19:12:43     INFO - TinderboxPrint: CPU system<br/>49.2 (6.0%)
[task 2023-03-29T19:12:43.940Z] 19:12:43     INFO - TinderboxPrint: CPU user<br/>391.3 (47.5%)
[task 2023-03-29T19:12:43.941Z] 19:12:43     INFO - TinderboxPrint: Swap in / out<br/>0 / 0
[task 2023-03-29T19:12:43.941Z] 19:12:43     INFO - start-pulseaudio - Wall time: 0s; CPU: Can't collect data; Read bytes: 0; Write bytes: 0; Read time: 0; Write time: 0
[task 2023-03-29T19:12:43.941Z] 19:12:43     INFO - install - Wall time: 42s; CPU: 51%; Read bytes: 229376; Write bytes: 1741168640; Read time: 0; Write time: 824944
[task 2023-03-29T19:12:43.941Z] 19:12:43     INFO - stage-files - Wall time: 0s; CPU: Can't collect data; Read bytes: 0; Write bytes: 0; Read time: 0; Write time: 0
[task 2023-03-29T19:12:43.941Z] 19:12:43     INFO - run-tests - Wall time: 372s; CPU: 54%; Read bytes: 38719488; Write bytes: 1476685824; Read time: 996; Write time: 115972
[task 2023-03-29T19:12:43.941Z] 19:12:43     INFO - uninstall - Wall time: 0s; CPU: Can't collect data; Read bytes: 0; Write bytes: 0; Read time: 0; Write time: 0
[task 2023-03-29T19:12:43.977Z] 19:12:43  WARNING - returning nonzero exit status 2
[task 2023-03-29T19:12:44.001Z] cleanup
Flags: needinfo?(jimb)
Pushed by jblandy@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/34c784e1c608 Make WebGPU interfaces available only in secure contexts. r=webgpu-reviewers,webidl,saschanaz,jgilbert
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
Regressions: 1825785
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: