Skip to content

Commit 3bb4b06

Browse files
Allow for global setting + use struct
1 parent 61b281e commit 3bb4b06

File tree

1 file changed

+37
-16
lines changed

1 file changed

+37
-16
lines changed

index.bs

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,9 +1545,15 @@ An <dfn>emulated network conditions struct</dfn> is a [=struct=] with:
15451545
* [=struct/item=] named <dfn id="emulated-network-conditions-struct-offline"
15461546
for="emulated-network-conditions-struct">offline</dfn> which is a boolean or null.
15471547

1548-
A [=BiDi session=] has an <dfn>emulated network conditions map</dfn>, which is a weak
1549-
map between [=navigables=] or [=user contexts=] and
1550-
[=emulated network conditions struct=] or null.
1548+
A [=BiDi session=] has a <dfn for=session>emulated network conditions</dfn> which is
1549+
a [=struct=] with an [=struct/item=] named <dfn
1550+
for="emulated network conditions">default network conditions</dfn>, which is an
1551+
[=emulated network conditions struct=] or null, an [=struct/item=] named
1552+
<dfn for="emulated network conditions">user context network conditions</dfn>, which
1553+
is a weak map between [=user contexts=] and [=emulated network conditions struct=],
1554+
and a [=struct/item=] named
1555+
<dfn for="emulated network conditions">navigable network conditions</dfn>, which is a
1556+
weak map between [=navigables=] and [=emulated network conditions struct=].
15511557

15521558
When a [=user context=] is [=set/remove|removed=] from the
15531559
[=set of user contexts=], [=remove user context subscriptions=].
@@ -6210,16 +6216,12 @@ context.
62106216

62116217
<div algorithm="remote end steps for emulation.setNetworkConditions">
62126218

6213-
The [=remote end steps=] with |command parameters| are:
6219+
The [=remote end steps=] with |command parameters| and |session| are:
62146220

62156221
1. If |command parameters| [=map/contains=] "<code>userContexts</code>"
62166222
and |command parameters| [=map/contains=] "<code>context</code>",
62176223
return [=error=] with [=error code=] [=invalid argument=].
62186224

6219-
1. If |command parameters| doesn't [=map/contain=] "<code>userContexts</code>"
6220-
and |command parameters| doesn't [=map/contain=] "<code>context</code>",
6221-
return [=error=] with [=error code=] [=invalid argument=].
6222-
62236225
1. Let |emulated network conditions| be null.
62246226

62256227
1. If |command parameters|["<code>networkConditions</code>"] is not null and
@@ -6236,7 +6238,8 @@ The [=remote end steps=] with |command parameters| are:
62366238

62376239
1. For each |navigable| of |navigables|:
62386240

6239-
1. [=map/Set=] [=emulated network conditions map=][|navigable|] to
6241+
1. [=map/Set=] |session|'s [=emulated network conditions=]'s
6242+
[=emulated network conditions/navigable network conditions=][|navigable|] to
62406243
|emulated network conditions|.
62416244

62426245
1. If the <code>userContexts</code> field of |command parameters| is present:
@@ -6246,7 +6249,15 @@ The [=remote end steps=] with |command parameters| are:
62466249

62476250
1. For each |user context| of |user contexts|:
62486251

6249-
1. [=map/Set=] [=emulated network conditions map=][|user context|] to |emulated network conditions|.
6252+
1. [=map/Set=] |session|'s [=emulated network conditions=]'s
6253+
[=emulated network conditions/user context network conditions=][|user context|]
6254+
to |emulated network conditions|.
6255+
6256+
1. If |command parameters| doesn't [=map/contain=] "<code>userContexts</code>"
6257+
and |command parameters| doesn't [=map/contain=] "<code>context</code>",
6258+
[=map/set=] |session|'s [=emulated network conditions=]'s
6259+
[=emulated network conditions/default network conditions=][|user context|] to
6260+
|emulated network conditions|.
62506261

62516262
1. Return [=success=] with data null.
62526263

@@ -9608,12 +9619,22 @@ are:
96089619

96099620
1. For each |session| in [=active BiDI sessions=]:
96109621

9611-
1. If |session|'s [=emulated network conditions map=] [=map/contains=]
9612-
|top-level traversable|, return
9613-
[=emulated network conditions map=][|top-level traversable|].
9614-
9615-
1. If |session|'s [=emulated network conditions map=] [=map/contains=]
9616-
|user context|, return [=emulated network conditions map=][|user context|].
9622+
1. If |session|'s [=emulated network conditions=]'s
9623+
[=emulated network conditions/navigable network conditions=]
9624+
[=map/contains=] |top-level traversable|, return |session|'s
9625+
[=emulated network conditions=]'s
9626+
[=emulated network conditions/navigable network conditions=][|top-level traversable|].
9627+
9628+
1. If |session|'s [=emulated network conditions=]'s
9629+
[=emulated network conditions/user context network conditions=]
9630+
[=map/contains=] |user context|, return |session|'s
9631+
[=emulated network conditions=]'s
9632+
[=emulated network conditions/user context network conditions=][|user context|].
9633+
9634+
1. If |session|'s [=emulated network conditions=]'s
9635+
[=emulated network conditions/default network conditions=] is not null,
9636+
return |session|'s [=emulated network conditions=]'s
9637+
[=emulated network conditions/default network conditions=].
96179638

96189639
1. Return null.
96199640

0 commit comments

Comments
 (0)