Skip to content

Commit bf20c0b

Browse files
[editorial] extend type references for data collectors (#1010)
And add note clarifying behavior.
1 parent 915f5e3 commit bf20c0b

File tree

1 file changed

+78
-68
lines changed

1 file changed

+78
-68
lines changed

index.bs

Lines changed: 78 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ with the following additional codes:
652652
<dd>Tried to remove an unknown [=network intercept=].
653653

654654
<dt><dfn for=errors export>no such network data</dfn>
655-
<dd>Tried to reference an unknown [=network/data=].
655+
<dd>Tried to reference an unknown [=network data=].
656656

657657
<dt><dfn for=errors export>no such node</dfn>
658658
<dd>Tried to deserialize an unknown <code>SharedReference</code>.
@@ -1664,7 +1664,7 @@ To <dfn>cleanup the session</dfn> given |session|:
16641664

16651665
1. For each |collector| in |session|'s [=network collectors=]:
16661666

1667-
1. Let |collector id| be |collector|'s <code>collector</code>.
1667+
1. Let |collector id| be |collector|'s [=network-collector/collector=].
16681668

16691669
1. For each |collected data| in [=collected network data=], [=remove collector from data=]
16701670
with |collected data| and |collector id|.
@@ -2553,7 +2553,7 @@ To <dfn>get the client window info</dfn> given |client window|:
25532553
browser.UserContext = text;
25542554
</pre>
25552555

2556-
The <code>browser.UserContext</code> unique identifies a [=user context=].
2556+
The <code><dfn>browser.UserContext</dfn></code> unique identifies a [=user context=].
25572557

25582558
#### The browser.UserContextInfo Type #### {#type-browser-UserContextInfo}
25592559

@@ -6801,30 +6801,34 @@ between [=navigables=] and [=/header lists=].
68016801

68026802
### Network Data Collection ### {#network-data-collection}
68036803

6804-
A <dfn for="network">data</dfn> is a [=/struct=] consisting of
6805-
an [=struct/item=] named <code>bytes</code>, which is a <code>network.BytesValue</code> or null,
6806-
an [=struct/item=] named <code>cloned body</code>, which is a [=/body=] or null,
6807-
an [=struct/item=] named <code>collectors</code>, which is a list of <code>network.Collector</code>,
6808-
an [=struct/item=] named <code>pending</code>, which is a boolean,
6809-
an [=struct/item=] named <code>request</code>, which is a <code>network.Request</code>,
6810-
an [=struct/item=] named <code>size</code>, which is a js-uint or null,
6811-
an [=struct/item=] named <code>type</code>, which is a <code>network.DataType</code>.
6812-
6813-
A <dfn for="network">collector</dfn> is a [=/struct=] consisting of
6814-
an [=struct/item=] named <code>max encoded data size</code>, which is a js-uint,
6815-
an [=struct/item=] named <code>contexts</code>, which is a list of <code>browsingContext.BrowsingContext</code>,
6816-
an [=struct/item=] named <code>data types</code>, which is a list of <code>network.DataType</code>,
6817-
an [=struct/item=] named <code>collector</code>, which is a <code>network.Collector</code>,
6818-
an [=struct/item=] named <code>collector type</code>, which is a <code>network.CollectorType</code>,
6819-
an [=struct/item=] named <code>user contexts</code>, which is a list of <code>browser.UserContext</code>.
6804+
A <dfn>network data</dfn> is a [=/struct=] with:
6805+
* [=struct/Item=] named <dfn for="network-data">bytes</dfn>, which is a <code>[=network.BytesValue=]</code> or null,
6806+
* [=struct/Item=] named <dfn for="network-data">cloned body</dfn>, which is a [=/body=] or null,
6807+
* [=struct/Item=] named <dfn for="network-data">collectors</dfn>, which is a list of <code>[=network.Collector=]</code>,
6808+
* [=struct/Item=] named <dfn for="network-data">pending</dfn>, which is a boolean,
6809+
* [=struct/Item=] named <dfn for="network-data">request</dfn>, which is a [=request id=],
6810+
* [=struct/Item=] named <dfn for="network-data">size</dfn>, which is a js-uint or null,
6811+
* [=struct/Item=] named <dfn for="network-data">type</dfn>, which is a <code>[=network.DataType=]</code>.
6812+
6813+
A <dfn for="network">collector</dfn> is a [=/struct=] with:
6814+
* [=struct/Item=] named <dfn for="network-collector">max encoded item size</dfn>, which is a js-uint;
6815+
* [=struct/item=] named <dfn for="network-collector">contexts</dfn>, which is a [=/list=] of [=navigable id=];
6816+
* [=struct/item=] named <dfn for="network-collector">data types</dfn>, which is a [=/list=] of <code>[=network.DataType=]</code>;
6817+
* [=struct/item=] named <dfn for="network-collector">collector</dfn>, which is a <code>[=network.Collector=]</code>;
6818+
* [=struct/item=] named <dfn for="network-collector">collector type</dfn>, which is a <code>[=network.CollectorType=]</code>;
6819+
* [=struct/item=] named <dfn for="network-collector">user contexts</dfn>, which is a [=/list=] of <code>[=browser.UserContext=]</code>.
6820+
6821+
Note: [=network-collector/Max encoded item size=] defines the limit per item (response or request),
6822+
and does not limit the size collected by the specific collector. The total size of all collected resources is
6823+
limited by [=max total collected size=].
68206824

68216825
A [=BiDi session=] has <dfn>network collectors</dfn> which is a [=/map=] between
6822-
<code>network.Collector</code> and a [=network/collector=]. It is initially empty.
6826+
<code>[=network.Collector=]</code> and a [=network/collector=]. It is initially empty.
68236827

68246828
A [=remote end=] has <dfn>collected network data</dfn> which is a list of
6825-
[=network/data=]. It is initially empty.
6829+
[=network data=]. It is initially empty.
68266830

6827-
A [=remote end=] has a <dfn>max total data size</dfn> which is a js-uint representing
6831+
A [=remote end=] has a <dfn>max total collected size</dfn> which is a js-uint representing
68286832
the size allocated to collect network data in [=collected network data=]. Its
68296833
value is implementation-defined.
68306834

@@ -6853,17 +6857,18 @@ To <dfn>get navigable for request</dfn> given request:
68536857
<div algorithm>
68546858
To <dfn>match collector for navigable</dfn> given |collector| and |navigable|:
68556859

6856-
1. If |collector|'s <code>contexts</code> is not [=list/empty=]:
6860+
1. If |collector|'s [=network-collector/contexts=] is not [=list/empty=]:
68576861

6858-
1. If |collector|'s <code>contexts</code> [=list/contains=] |navigable|'s [=navigable id=], return true.
6862+
1. If |collector|'s [=network-collector/contexts=] [=list/contains=] |navigable|'s [=navigable id=], return true.
68596863

68606864
1. Otherwise, return false.
68616865

6862-
1. If |collector|'s <code>user contexts</code> is not [=list/empty=]:
6866+
1. If |collector|'s [=network-collector/user contexts=] is not [=list/empty=]:
68636867

68646868
1. Let |user context| be |navigable|'s [=associated user context=].
68656869

6866-
1. If |collector|'s <code>user contexts</code> [=list/contains=] |user context|'s [=user context id=], return true.
6870+
1. If |collector|'s [=network-collector/user contexts=] [=list/contains=] |user context|'s
6871+
[=user context id=], return true.
68676872

68686873
1. Otherwise, return false.
68696874

@@ -6880,14 +6885,14 @@ Note: This hook is intended to be triggered by the fetch spec when the response
68806885

68816886
1. If |session|'s [=network collectors=] is not [=list/empty=]:
68826887

6883-
1. Let |collected data| be a struct with
6884-
<code>bytes</code> field set to null,
6885-
<code>cloned body</code> field set to [=body/clone=] with |response body|,
6886-
<code>collectors</code> field set to an empty list,
6887-
<code>pending</code> field set to true,
6888-
<code>request</code> field set to |request|'s [=request id=],
6889-
<code>size</code> field set to null,
6890-
<code>type</code> field set to "response".
6888+
1. Let |collected data| be a [=network data=] with
6889+
[=network-data/bytes=] set to null,
6890+
[=network-data/cloned body=] set to [=body/clone=] of |response body|,
6891+
[=network-data/collectors=] set to an empty list,
6892+
[=network-data/pending=] set to true,
6893+
[=network-data/request=] set to |request|'s [=request id=],
6894+
[=network-data/size=] set to null,
6895+
[=network-data/type=] set to "response".
68916896

68926897
1. [=list/Append=] |collected data| to [=collected network data=].
68936898

@@ -6958,7 +6963,8 @@ To <dfn>maybe collect network response body</dfn> given |request| and |response|
69586963

69596964
1. For each |collector| in |session|'s [=network collectors=]:
69606965

6961-
1. If |collector|'s <code>data types</code> [=list/contains=] "response" and if [=match collector for navigable=] with |collector| and |top-level navigable|:
6966+
1. If |collector|'s [=network-collector/data types=] [=list/contains=] "response" and if
6967+
[=match collector for navigable=] with |collector| and |top-level navigable|:
69626968

69636969
1. [=list/Append=] |collector| to |collectors|.
69646970

@@ -6997,8 +7003,8 @@ To <dfn>maybe collect network response body</dfn> given |request| and |response|
69977003

69987004
1. For |collector| in |collectors|:
69997005

7000-
1. If |size| is less than or equal to |collector|'s <code>max encoded data size</code>,
7001-
[=list/append=] |collector|'s <code>collector</code> to |collected data|'s <code>collectors</code>.
7006+
1. If |size| is less than or equal to |collector|'s [=network-collector/max encoded item size=],
7007+
[=list/append=] |collector|'s [=network-collector/collector=] to |collected data|'s <code>collectors</code>.
70027008

70037009
1. If |collected data|'s <code>collectors</code> is not [=list/empty=]:
70047010

@@ -7017,7 +7023,7 @@ To <dfn>maybe collect network response body</dfn> given |request| and |response|
70177023
<div algorithm>
70187024
To <dfn>allocate size to record data</dfn> given |size|:
70197025

7020-
1. Let |available size| be [=max total data size=].
7026+
1. Let |available size| be [=max total collected size=].
70217027

70227028
1. Let |already collected data| be an empty list.
70237029

@@ -7355,15 +7361,15 @@ network.Base64Value = {
73557361
}
73567362
</pre>
73577363

7358-
The <code>network.BytesValue</code> type represents binary data sent over the
7364+
The <code><dfn>network.BytesValue</dfn></code> type represents binary data sent over the
73597365
network. Valid UTF-8 is represented with the <code>network.StringValue</code>
73607366
type, any other data is represented in Base64-encoded form as
73617367
<code>network.Base64Value</code>.
73627368

73637369
<div algorithm>
73647370
To <dfn>deserialize protocol bytes</dfn> given |protocol bytes|:
73657371

7366-
Note: this takes bytes encoded as a <code>network.BytesValue</code> and returns
7372+
Note: this takes bytes encoded as a <code>[=network.BytesValue=]</code> and returns
73677373
a [=byte sequence=].
73687374

73697375
1. If |protocol bytes| matches the <code>network.StringValue</code> production,
@@ -7380,7 +7386,7 @@ a [=byte sequence=].
73807386
<div algorithm>
73817387
To <dfn>serialize protocol bytes</dfn> given |bytes|:
73827388

7383-
Note: this takes a [=byte sequence=] and returns a <code>network.BytesValue</code>.
7389+
Note: this takes a [=byte sequence=] and returns a <code>[=network.BytesValue=]</code>.
73847390

73857391
1. Let |text| be [=UTF-8 decode without BOM or fail=] |bytes|.
73867392

@@ -7401,7 +7407,7 @@ Note: this takes a [=byte sequence=] and returns a <code>network.BytesValue</cod
74017407
network.Collector = text
74027408
</pre>
74037409

7404-
The <code>network.Collector</code> type represents the id of a [=network/collector=].
7410+
The <code><dfn>network.Collector</dfn></code> type represents the id of a [=network/collector=].
74057411

74067412
#### The network.CollectorType Type #### {#type-network-CollectorType}
74077413

@@ -7414,7 +7420,7 @@ network.CollectorType = "blob"
74147420
Note: In the future we might also support the "stream" collector type for clients
74157421
which want to read the data gathered by a given collector via a stream.
74167422

7417-
The <code>network.CollectorType</code> type represents the different types of data collectors
7423+
The <code><dfn>network.CollectorType</dfn></code> type represents the different types of data collectors
74187424
that can be added.
74197425

74207426
#### The network.Cookie Type #### {#type-network-Cookie}
@@ -7521,7 +7527,7 @@ To <dfn>serialize cookie header</dfn> given |protocol cookie|:
75217527
network.DataType = "response"
75227528
</pre>
75237529

7524-
The <code>network.DataType</code> type represents the different types of network data
7530+
The <code><dfn>network.DataType</dfn></code> type represents the different types of network data
75257531
that can be collected.
75267532

75277533
#### The network.FetchTimingInfo Type #### {#type-network-FetchTimingInfo}
@@ -8484,13 +8490,17 @@ The [=remote end steps=] given |session| and |command parameters| are:
84848490
1. Let |data types| be [=set/create|create a set=] with
84858491
|command parameters|["<code>dataTypes</code>"].
84868492

8487-
1. Let |max encoded data size| be |command parameters|
8493+
1. Let |max encoded item size| be |command parameters|
84888494
["<code>maxEncodedDataSize</code>"].
84898495

8496+
Note: The <code>maxEncodedDataSize</code> parameter represents
8497+
[=network-collector/max encoded item size=] and limits the size of each request collected by the
8498+
given collector, not the total collector's collected size.
8499+
84908500
Note: Different implementations might support different encodings, which means the
84918501
encoded size might be different between browsers. Therefore, for the same data collector
8492-
configuration, some network data might fit the maxEncodedDataSize only in some
8493-
implementations.
8502+
configuration, some network data might fit the [=network-collector/max encoded item size=] only
8503+
in some implementations.
84948504

84958505
1. Let |collector type| be |command parameters|
84968506
["<code>collectorType</code>"].
@@ -8504,8 +8514,8 @@ The [=remote end steps=] given |session| and |command parameters| are:
85048514
1. If |input user context ids| is not empty and |input context ids| is not
85058515
empty, return [=error=] with [=error code=] [=invalid argument=].
85068516

8507-
1. If |max encoded data size| is greater than [=max total data size=],
8508-
return [=error=] with [=error code=] [=invalid argument=].
8517+
1. If |max encoded item size| is 0 or |max encoded item size| is greater than
8518+
[=max total collected size=], return [=error=] with [=error code=] [=invalid argument=].
85098519

85108520
1. If |input context ids| is not [=set/empty=]:
85118521

@@ -8525,13 +8535,13 @@ The [=remote end steps=] given |session| and |command parameters| are:
85258535

85268536
1. If |user context| is null, return [=error=] with [=error code=] [=invalid argument=].
85278537

8528-
1. Let |collector| be a struct with
8529-
<code>max encoded data size</code> field set to |max encoded data size|,
8530-
<code>data types</code> field set to |data types|,
8531-
<code>collector</code> field set to |collector id|,
8532-
<code>collector type</code> field set to |collector type|,
8533-
<code>contexts</code> field set to |input context ids|,
8534-
<code>user contexts</code> field set to |input user context ids|.
8538+
1. Let |collector| be a [=network/collector=] with
8539+
[=network-collector/max encoded item size=] field set to |max encoded item size|,
8540+
[=network-collector/data types=] field set to |data types|,
8541+
[=network-collector/collector=] field set to |collector id|,
8542+
[=network-collector/collector type=] field set to |collector type|,
8543+
[=network-collector/contexts=] field set to |input context ids|,
8544+
[=network-collector/user contexts=] field set to |input user context ids|.
85358545

85368546
1. Set |session|'s [=network collectors=][|collector id|] to |collector|.
85378547

@@ -10529,22 +10539,22 @@ To <dfn>serialize primitive protocol value</dfn> given a |value|:
1052910539
of steps for which the associated condition is true, if any:
1053010540

1053110541
<dl>
10532-
<dt>[=Type=](|value|) is undefined
10542+
<dt>[=/Type=](|value|) is undefined
1053310543
<dd>Let |remote value| be a [=/map=] matching the <code>script.UndefinedValue</code>
1053410544
production in the {^local end definition^}.
1053510545

10536-
<dt>[=Type=](|value|) is Null
10546+
<dt>[=/Type=](|value|) is Null
1053710547
<dd>Let |remote value| be a [=/map=] matching the <code>script.NullValue</code>
1053810548
production in the {^local end definition^}.
1053910549

10540-
<dt>[=Type=](|value|) is String
10550+
<dt>[=/Type=](|value|) is String
1054110551
<dd>Let |remote value| be a [=/map=] matching the <code>script.StringValue</code>
1054210552
production in the {^local end definition^}, with the <code>value</code>
1054310553
property set to |value|.
1054410554

1054510555
Issue: This doesn't handle lone surrogates
1054610556

10547-
<dt>[=Type=](|value|) is Number
10557+
<dt>[=/Type=](|value|) is Number
1054810558
<dd>
1054910559
1. Switch on the value of |value|:
1055010560
<dl>
@@ -10564,12 +10574,12 @@ To <dfn>serialize primitive protocol value</dfn> given a |value|:
1056410574
production in the {^local end definition^}, with the <code>value</code>
1056510575
property set to |serialized|.
1056610576

10567-
<dt>[=Type=](|value|) is Boolean
10577+
<dt>[=/Type=](|value|) is Boolean
1056810578
<dd>Let |remote value| be a [=/map=] matching the <code>script.BooleanValue</code>
1056910579
production in the {^local end definition^}, with the <code>value</code>
1057010580
property set to |value|.
1057110581

10572-
<dt>[=Type=](|value|) is BigInt
10582+
<dt>[=/Type=](|value|) is BigInt
1057310583
<dd>Let |remote value| be a [=/map=] matching the <code>script.BigIntValue</code>
1057410584
production in the {^local end definition^}, with the <code>value</code>
1057510585
property set to the result of running the [=ToString=] operation on
@@ -10609,9 +10619,9 @@ To <dfn>deserialize primitive protocol value</dfn> given a |primitive protocol v
1060910619

1061010620
<dt>|type| is the string "<code>number</code>"
1061110621
<dd>
10612-
1. If [=Type=](|value|) is Number, return [=success=] with data |value|.
10622+
1. If [=/Type=](|value|) is Number, return [=success=] with data |value|.
1061310623

10614-
1. Assert: [=Type=](|value|) is String.
10624+
1. Assert: [=/Type=](|value|) is String.
1061510625

1061610626
1. If |value| is the string "<code>NaN</code>", return [=success=] with
1061710627
data NaN.
@@ -11268,7 +11278,7 @@ an |ownership type|, a |serialization internal map|, a |realm| and a |session|:
1126811278
of steps for which the associated condition is true:
1126911279

1127011280
<dl>
11271-
<dt>[=Type=](|value|) is Symbol
11281+
<dt>[=/Type=](|value|) is Symbol
1127211282
<dd>Let |remote value| be a [=/map=] matching the <code>script.SymbolRemoteValue</code>
1127311283
production in the {^local end definition^}, with the <code>handle</code>
1127411284
property set to |handle id| if it's not null, or omitted otherwise.
@@ -11530,7 +11540,7 @@ an |ownership type|, a |serialization internal map|, a |realm| and a |session|:
1153011540

1153111541
<dt>Otherwise:
1153211542
<dd>
11533-
1. [=Assert=]: [=type=](|value|) is Object
11543+
1. [=Assert=]: [=/Type=](|value|) is Object
1153411544

1153511545
1. Let |remote value| be a [=/map=] matching the <code>script.ObjectRemoteValue</code> production
1153611546
in the {^local end definition^}, with the <code>handle</code> property set
@@ -11647,7 +11657,7 @@ To <dfn>serialize as a mapping</dfn> given |iterable|, |serialization options|,
1164711657
options|["<code>maxObjectDepth</code>"] to |child serialization
1164811658
options|["<code>maxObjectDepth</code>"] - 1.
1164911659

11650-
1. If [=Type=](|key|) is String, let |serialized key| be |child key|,
11660+
1. If [=/Type=](|key|) is String, let |serialized key| be |child key|,
1165111661
otherwise let |serialized key| be the result of [=serialize as a remote value=]
1165211662
with |child key|, |child serialization options|, |ownership type|,
1165311663
|serialization internal map|, |realm|, and |session|.
@@ -13310,7 +13320,7 @@ Define the following [=console steps=] with |method|, |args|, and
1331013320

1331113321
1. Let |text| be an empty string.
1331213322

13313-
1. If [=Type=](|args|[0]) is String, and |args|[0] contains a
13323+
1. If [=/Type=](|args|[0]) is String, and |args|[0] contains a
1331413324
[=formatting specifier=], let |formatted args| be [=Formatter=](|args|). Otherwise
1331513325
let |formatted args| be |args|.
1331613326

0 commit comments

Comments
 (0)