Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d3034d8

Browse files
committedJun 24, 2024·
Replace setCacheMode with setCacheBypass
This just takes a single true/false value for whether to bypass the cache.
1 parent 7ef9e47 commit d3034d8

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
@@ -4598,7 +4598,7 @@ NetworkCommand = (
45984598
network.FailRequest //
45994599
network.ProvideResponse //
46004600
network.RemoveIntercept //
4601-
network.SetCacheMode //
4601+
network.SetCacheBypass //
46024602
)
46034603

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

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

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

46354635
### Network Intercepts ### {#network-intercepts}
46364636

@@ -6445,22 +6445,22 @@ requests will be affected.
64456445

64466446
</div>
64476447

6448-
#### The network.setCacheMode Command #### {#command-network-setCacheMode}
6448+
#### The network.setCacheBypass Command #### {#command-network-setCacheBypass}
64496449

6450-
The <dfn export for=commands>network.setCacheMode</dfn> command overrides
6451-
the network cache behaviour for certain requests.
6450+
The <dfn export for=commands>network.setCacheBypass</dfn> command bypasses the
6451+
network cache for certain requests.
64526452

64536453
<dl>
64546454
<dt>Command Type</dt>
64556455
<dd>
64566456
<pre class="cddl remote-cddl">
6457-
network.SetCacheMode = (
6458-
method: "network.setCacheMode",
6459-
params: network.SetCacheModeParameters
6457+
network.SetCacheBypass = (
6458+
method: "network.setCacheBypass",
6459+
params: network.SetCacheBypassParameters
64606460
)
64616461

6462-
network.SetCacheModeParameters = {
6463-
mode: "no-store" / null,
6462+
network.SetCacheBypassParameters = {
6463+
bypass: bool,
64646464
? contexts: [+browsingContext.BrowsingContext]
64656465
}
64666466
</pre>
@@ -6474,8 +6474,7 @@ the network cache behaviour for certain requests.
64746474
</dl>
64756475

64766476
<div algorithm>
6477-
The <dfn export>WebDriver BiDi update request cache mode</dfn> steps given
6478-
|request| are:
6477+
The <dfn export>WebDriver BiDi bypass cache</dfn> steps given |request| are:
64796478

64806479
1. Let |context| be null.
64816480

@@ -6485,46 +6484,54 @@ The <dfn export>WebDriver BiDi update request cache mode</dfn> steps given
64856484

64866485
1. If there is a [=/browsing context=] whose [=active window=] is |environment
64876486
settings|' [=environment settings object/global object=], set |context| to
6488-
the [=top-level browsing context=] for that context.
6487+
the [=top-level browsing context=] for that browsing context.
64896488

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

6492-
1. If [=cache mode override map=] [=map/contains=] |context|, set
6493-
|request|'s [=request/cache mode=] to [=cache mode override
6494-
map=][|context|] and return.
6495-
6496-
1. If [=default cache mode override=] is not null, set
6497-
|request|'s [=request/cache mode=] to [=default cache mode override=].
6492+
1. Return [=default cache bypass=].
64986493

64996494
</div>
65006495

6501-
<div algorithm="remote end steps for network.setCacheMode">
6496+
<div algorithm="remote end steps for network.setCacheBypass">
65026497
The [=remote end steps=] given <var ignore>session</var> and |command parameters| are:
65036498

6504-
1. Let |mode| be |command parameters|["<code>mode</code>"].
6499+
1. Let |bypass| be |command parameters|["<code>bypass</code>"].
65056500

6506-
1. If |command parameters| does not [=map/contain=] "<code>contexts</code>", set
6507-
the [=default cache mode override=] to |mode| and return [=success=] with
6508-
data null.
6501+
1. If |command parameters| does not [=map/contain=] "<code>contexts</code>":
65096502

6510-
1. Let |contexts| be an empty [=/list=].
6503+
1. Set the [=default cache bypass=] to |bypass|.
6504+
6505+
1. If |bypass| is true, perform implementation-defined steps to disable any
6506+
implementation-specific resource caches for network requests. Otherwise
6507+
re-enable any implementation-specific resource caches for all contexts.
6508+
6509+
1. Return [=success=] with data null.
6510+
6511+
1. Let |contexts| be an empty [=/set=].
65116512

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

6514-
1. Let |context| be the result of [=trying=] to [=get a browsing context=]
6515-
with |context id|.
6515+
1. Let |context| be the result of [=trying=] to [=get a browsing context=]
6516+
with |context id|.
65166517

6517-
1. If |context| is not a [=top-level browsing context=], return [=error=]
6518-
with [=error code=] [=invalid argument=].
6518+
1. If |context| is not a [=top-level browsing context=], return [=error=]
6519+
with [=error code=] [=invalid argument=].
65196520

6520-
1. [=list/Append=] |context| to |contexts|.
6521+
1. [=list/Append=] |context| to |contexts|.
65216522

65226523
1. For each |context| in |contexts|:
65236524

6524-
1. If |mode| is null and [=cache mode override map=] [=map/contains=]
6525-
|context| [=map/remove=] |context| from [=cache mode override map=].
6525+
1. If |bypass| is true:
6526+
6527+
1. [=set/append=] |context| to [=navigable cache bypass set=].
6528+
6529+
1. Perform implementation-defined steps to disable any implementation-specific
6530+
resource caches for network requests originating from |context|.
6531+
6532+
1. Otherwise, if [=navigable cache bypass set=] [=set/contains=]
6533+
|context|, [=set/remove=] |context| from [=navigable cache bypass set=].
65266534

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

65296536
1. Return [=success=] with data null.
65306537

0 commit comments

Comments
 (0)
Please sign in to comment.