Skip to content

Commit a65f61f

Browse files
Expose WebNN API to shared workers and service workers (#823)
Resolves #804
1 parent 9f58451 commit a65f61f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

index.bs

+7-7
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ API {#api}
757757

758758
## The navigator.ml interface ## {#api-navigator-ml}
759759

760-
An {{ML}} object is available in the {{Window}} and {{DedicatedWorkerGlobalScope}} contexts through the {{Navigator}}
760+
An {{ML}} object is available in the {{Window}} and {{WorkerGlobalScope}} contexts through the {{Navigator}}
761761
and {{WorkerNavigator}} interfaces respectively and is exposed via `navigator.ml`.
762762

763763
<script type=idl>
@@ -780,7 +780,7 @@ dictionary MLContextOptions {
780780
MLPowerPreference powerPreference = "default";
781781
};
782782

783-
[SecureContext, Exposed=(Window, DedicatedWorker)]
783+
[SecureContext, Exposed=(Window, Worker)]
784784
interface ML {
785785
Promise<MLContext> createContext(optional MLContextOptions options = {});
786786
Promise<MLContext> createContext(GPUDevice gpuDevice);
@@ -865,7 +865,7 @@ dictionary MLContextLostInfo {
865865
DOMString message;
866866
};
867867

868-
[SecureContext, Exposed=(Window, DedicatedWorker)]
868+
[SecureContext, Exposed=(Window, Worker)]
869869
interface MLContext {
870870
undefined dispatch(MLGraph graph, MLNamedTensors inputs, MLNamedTensors outputs);
871871

@@ -1284,7 +1284,7 @@ A {{MLContext}} <dfn for=MLContext lt="is lost|is not lost">is lost</dfn> if its
12841284
The {{MLGraph}} interface represents a compiled computational graph. A compiled graph once constructed is immutable and cannot be subsequently changed.
12851285

12861286
<script type=idl>
1287-
[SecureContext, Exposed=(Window, DedicatedWorker)]
1287+
[SecureContext, Exposed=(Window, Worker)]
12881288
interface MLGraph {
12891289
undefined destroy();
12901290
};
@@ -1418,7 +1418,7 @@ An {{MLOperand}} represents an intermediary graph being constructed as a result
14181418
For instance, an {{MLOperand}} can represent a constant feeding to an operation or the result from combining multiple constants together into an operation. See also [[#programming-model]].
14191419

14201420
<script type=idl>
1421-
[SecureContext, Exposed=(Window, DedicatedWorker)]
1421+
[SecureContext, Exposed=(Window, Worker)]
14221422
interface MLOperand {
14231423
readonly attribute MLOperandDataType dataType;
14241424
readonly attribute FrozenArray<unsigned long> shape;
@@ -1542,7 +1542,7 @@ The {{MLTensor}} interface represents a tensor which may be used as an input or
15421542
The [=implementation-defined=] requirements of how an {{MLTensor}} is allocated may include constraints such as that the memory is allocated with a particular byte alignment or in a particular memory pool.
15431543

15441544
<script type=idl>
1545-
[SecureContext, Exposed=(Window, DedicatedWorker)]
1545+
[SecureContext, Exposed=(Window, Worker)]
15461546
interface MLTensor {
15471547
readonly attribute MLOperandDataType dataType;
15481548
readonly attribute FrozenArray<unsigned long> shape;
@@ -1629,7 +1629,7 @@ The {{MLGraphBuilder}} interface defines a set of operations as identified by th
16291629
<script type=idl>
16301630
typedef record<USVString, MLOperand> MLNamedOperands;
16311631

1632-
[SecureContext, Exposed=(Window, DedicatedWorker)]
1632+
[SecureContext, Exposed=(Window, Worker)]
16331633
interface MLGraphBuilder {
16341634
// Construct the graph builder from the context.
16351635
constructor(MLContext context);

0 commit comments

Comments
 (0)