Skip to content

Commit 0477a70

Browse files
committed
Replace setCacheMode with setCacheBypass
This just takes a single true/false value for whether to bypass the cache.
1 parent 29dd853 commit 0477a70

File tree

1 file changed

+45
-38
lines changed

1 file changed

+45
-38
lines changed

index.bs

+45-38
Original file line numberDiff line numberDiff line change
@@ -4690,7 +4690,7 @@ NetworkCommand = (
46904690
network.FailRequest //
46914691
network.ProvideResponse //
46924692
network.RemoveIntercept //
4693-
network.SetCacheMode //
4693+
network.SetCacheBypass //
46944694
)
46954695

46964696
</pre>
@@ -4717,12 +4717,12 @@ A [=remote end=] has a <dfn>before request sent map</dfn> which is initially an
47174717
empty map. It's used to track the network events for which a
47184718
<code>network.beforeRequestSent</code> event has already been sent.
47194719

4720-
A [=remote end=] has a <dfn>default cache mode override</dfn> which is null or a
4721-
string. It is initially null.
4720+
A [=remote end=] has a <dfn>default cache bypass</dfn> which is a boolean. It is
4721+
initially false.
47224722

4723-
A [=remote end=] has a <dfn>cache mode override map</dfn> which is initially an
4724-
empty weak map. It's used to track the cache mode to use for requests from
4725-
specific browsing contexts.
4723+
A [=remote end=] has a <dfn>navigable cache bypass set</dfn> which is initially an
4724+
empty weak set. It's used to track the [=/top-level traversables=] in which
4725+
network caches are bypassed.
47264726

47274727
### Network Intercepts ### {#network-intercepts}
47284728

@@ -6561,22 +6561,22 @@ requests will be affected.
65616561

65626562
</div>
65636563

6564-
#### The network.setCacheMode Command #### {#command-network-setCacheMode}
6564+
#### The network.setCacheBypass Command #### {#command-network-setCacheBypass}
65656565

6566-
The <dfn export for=commands>network.setCacheMode</dfn> command overrides
6567-
the network cache behaviour for certain requests.
6566+
The <dfn export for=commands>network.setCacheBypass</dfn> command bypasses the
6567+
network cache for certain requests.
65686568

65696569
<dl>
65706570
<dt>Command Type</dt>
65716571
<dd>
65726572
<pre class="cddl remote-cddl">
6573-
network.SetCacheMode = (
6574-
method: "network.setCacheMode",
6575-
params: network.SetCacheModeParameters
6573+
network.SetCacheBypass = (
6574+
method: "network.setCacheBypass",
6575+
params: network.SetCacheBypassParameters
65766576
)
65776577

6578-
network.SetCacheModeParameters = {
6579-
mode: "no-store" / null,
6578+
network.SetCacheBypassParameters = {
6579+
bypass: bool,
65806580
? contexts: [+browsingContext.BrowsingContext]
65816581
}
65826582
</pre>
@@ -6590,8 +6590,7 @@ the network cache behaviour for certain requests.
65906590
</dl>
65916591

65926592
<div algorithm>
6593-
The <dfn export>WebDriver BiDi update request cache mode</dfn> steps given
6594-
|request| are:
6593+
The <dfn export>WebDriver BiDi bypass cache</dfn> steps given |request| are:
65956594

65966595
1. Let |context| be null.
65976596

@@ -6601,46 +6600,54 @@ The <dfn export>WebDriver BiDi update request cache mode</dfn> steps given
66016600

66026601
1. If there is a [=/browsing context=] whose [=active window=] is |environment
66036602
settings|' [=environment settings object/global object=], set |context| to
6604-
the [=top-level browsing context=] for that context.
6603+
the [=top-level browsing context=] for that browsing context.
66056604

6606-
1. If |context| is not null:
6605+
1. If |context| is not null and [=navigable cache bypass set=] [=set/contains=]
6606+
|context|, return true.
66076607

6608-
1. If [=cache mode override map=] [=map/contains=] |context|, set
6609-
|request|'s [=request/cache mode=] to [=cache mode override
6610-
map=][|context|] and return.
6611-
6612-
1. If [=default cache mode override=] is not null, set
6613-
|request|'s [=request/cache mode=] to [=default cache mode override=].
6608+
1. Return [=default cache bypass=].
66146609

66156610
</div>
66166611

6617-
<div algorithm="remote end steps for network.setCacheMode">
6612+
<div algorithm="remote end steps for network.setCacheBypass">
66186613
The [=remote end steps=] given <var ignore>session</var> and |command parameters| are:
66196614

6620-
1. Let |mode| be |command parameters|["<code>mode</code>"].
6615+
1. Let |bypass| be |command parameters|["<code>bypass</code>"].
66216616

6622-
1. If |command parameters| does not [=map/contain=] "<code>contexts</code>", set
6623-
the [=default cache mode override=] to |mode| and return [=success=] with
6624-
data null.
6617+
1. If |command parameters| does not [=map/contain=] "<code>contexts</code>":
66256618

6626-
1. Let |contexts| be an empty [=/list=].
6619+
1. Set the [=default cache bypass=] to |bypass|.
6620+
6621+
1. If |bypass| is true, perform implementation-defined steps to disable any
6622+
implementation-specific resource caches for network requests. Otherwise
6623+
re-enable any implementation-specific resource caches for all contexts.
6624+
6625+
1. Return [=success=] with data null.
6626+
6627+
1. Let |contexts| be an empty [=/set=].
66276628

66286629
1. For each |context id| of |command parameters|["<code>contexts</code>"]:
66296630

6630-
1. Let |context| be the result of [=trying=] to [=get a browsing context=]
6631-
with |context id|.
6631+
1. Let |context| be the result of [=trying=] to [=get a browsing context=]
6632+
with |context id|.
66326633

6633-
1. If |context| is not a [=top-level browsing context=], return [=error=]
6634-
with [=error code=] [=invalid argument=].
6634+
1. If |context| is not a [=top-level browsing context=], return [=error=]
6635+
with [=error code=] [=invalid argument=].
66356636

6636-
1. [=list/Append=] |context| to |contexts|.
6637+
1. [=list/Append=] |context| to |contexts|.
66376638

66386639
1. For each |context| in |contexts|:
66396640

6640-
1. If |mode| is null and [=cache mode override map=] [=map/contains=]
6641-
|context| [=map/remove=] |context| from [=cache mode override map=].
6641+
1. If |bypass| is true:
6642+
6643+
1. [=set/append=] |context| to [=navigable cache bypass set=].
6644+
6645+
1. Perform implementation-defined steps to disable any implementation-specific
6646+
resource caches for network requests originating from |context|.
6647+
6648+
1. Otherwise, if [=navigable cache bypass set=] [=set/contains=]
6649+
|context|, [=set/remove=] |context| from [=navigable cache bypass set=].
66426650

6643-
1. Otherwise, set [=cache mode override map=][|context|] to |mode|.
66446651

66456652
1. Return [=success=] with data null.
66466653

0 commit comments

Comments
 (0)