Skip to content

Commit

Permalink
perf_hooks: fix webperf idlharness
Browse files Browse the repository at this point in the history
1. Enforce receiver checks on IDL interfaces.
2. Avoid prototype manipulation on constructing IDL interfaces with
   `ReflectConstruct`.
3. `defineReplaceableAttribute` should create IDL getter/setter.
4. Event handler properties defined by `defineEventHandler` should check
   if the receiver is a valid `EventTarget`.
5. Corrected `PerformanceResourceTiming` to inherit the public interface
   `PerformanceEntry` instead of the internal interface
   `InternalPerformanceResourceTiming`.
  • Loading branch information
legendecas committed Sep 14, 2022
1 parent 5ec2c99 commit a0363be
Show file tree
Hide file tree
Showing 220 changed files with 8,022 additions and 512 deletions.
153 changes: 153 additions & 0 deletions doc/api/perf_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ Node.js instance. It is similar to [`window.performance`][] in browsers.

<!-- YAML
added: v8.5.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This method must be called with the `performance` object as
the receiver.
-->

* `name` {string}
Expand All @@ -60,6 +65,11 @@ Performance Timeline. If `name` is provided, removes only the named mark.

<!-- YAML
added: v16.7.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This method must be called with the `performance` object as
the receiver.
-->

* `name` {string}
Expand All @@ -73,6 +83,11 @@ Performance Timeline. If `name` is provided, removes only the named measure.
added:
- v18.2.0
- v16.17.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This method must be called with the `performance` object as
the receiver.
-->

* `name` {string}
Expand Down Expand Up @@ -147,6 +162,11 @@ are not guaranteed to reflect any correct state of the event loop.

<!-- YAML
added: v16.7.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This method must be called with the `performance` object as
the receiver.
-->

* Returns: {PerformanceEntry\[]}
Expand All @@ -160,6 +180,11 @@ performance entries of certain types or that have certain names, see

<!-- YAML
added: v16.7.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This method must be called with the `performance` object as
the receiver.
-->

* `name` {string}
Expand All @@ -175,6 +200,11 @@ equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to

<!-- YAML
added: v16.7.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This method must be called with the `performance` object as
the receiver.
-->

* `type` {string}
Expand All @@ -189,6 +219,10 @@ is equal to `type`.
<!-- YAML
added: v8.5.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This method must be called with the `performance` object as
the receiver.
- version: v16.0.0
pr-url: https://github.com/nodejs/node/pull/37136
description: Updated to conform to the User Timing Level 3 specification.
Expand Down Expand Up @@ -244,6 +278,10 @@ Performance Timeline manually with `performance.clearResourceTimings`.
<!-- YAML
added: v8.5.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This method must be called with the `performance` object as
the receiver.
- version: v16.0.0
pr-url: https://github.com/nodejs/node/pull/37136
description: Updated to conform to the User Timing Level 3 specification.
Expand Down Expand Up @@ -305,6 +343,11 @@ metrics for specific Node.js operational milestones.

<!-- YAML
added: v8.5.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This method must be called with the `performance` object as
the receiver.
-->

* Returns: {number}
Expand All @@ -316,6 +359,11 @@ the start of the current `node` process.

<!-- YAML
added: v18.8.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This method must be called with the `performance` object as
the receiver.
-->

Sets the global performance resource timing buffer size to the specified number
Expand Down Expand Up @@ -393,6 +441,11 @@ invoked.

<!-- YAML
added: v16.1.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This method must be called with the `performance` object as
the receiver.
-->

An object which is JSON representation of the `performance` object. It
Expand Down Expand Up @@ -420,6 +473,11 @@ added: v8.5.0

<!-- YAML
added: v16.0.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceEntry` object as the receiver.
-->

* {any}
Expand All @@ -430,6 +488,11 @@ Additional detail specific to the `entryType`.

<!-- YAML
added: v8.5.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceEntry` object as the receiver.
-->

* {number}
Expand All @@ -441,6 +504,11 @@ be meaningful for all Performance Entry types.

<!-- YAML
added: v8.5.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceEntry` object as the receiver.
-->

* {string}
Expand Down Expand Up @@ -488,6 +556,11 @@ The value may be one of:

<!-- YAML
added: v8.5.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceEntry` object as the receiver.
-->

* {string}
Expand Down Expand Up @@ -522,6 +595,11 @@ The value may be one of:

<!-- YAML
added: v8.5.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceEntry` object as the receiver.
-->

* {number}
Expand Down Expand Up @@ -758,6 +836,11 @@ The constructor of this class is not exposed to users directly.
added:
- v18.2.0
- v16.17.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceResourceTiming` object as the receiver.
-->

* {number}
Expand All @@ -772,6 +855,11 @@ will always return 0.
added:
- v18.2.0
- v16.17.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceResourceTiming` object as the receiver.
-->

* {number}
Expand All @@ -785,6 +873,11 @@ of the fetch which initiates the redirect.
added:
- v18.2.0
- v16.17.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceResourceTiming` object as the receiver.
-->

* {number}
Expand All @@ -798,6 +891,11 @@ receiving the last byte of the response of the last redirect.
added:
- v18.2.0
- v16.17.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceResourceTiming` object as the receiver.
-->

* {number}
Expand All @@ -811,6 +909,11 @@ to fetch the resource.
added:
- v18.2.0
- v16.17.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceResourceTiming` object as the receiver.
-->

* {number}
Expand All @@ -824,6 +927,11 @@ the domain name lookup for the resource.
added:
- v18.2.0
- v16.17.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceResourceTiming` object as the receiver.
-->

* {number}
Expand All @@ -837,6 +945,11 @@ after the Node.js finished the domain name lookup for the resource.
added:
- v18.2.0
- v16.17.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceResourceTiming` object as the receiver.
-->

* {number}
Expand All @@ -851,6 +964,11 @@ the resource.
added:
- v18.2.0
- v16.17.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceResourceTiming` object as the receiver.
-->

* {number}
Expand All @@ -865,6 +983,11 @@ the resource.
added:
- v18.2.0
- v16.17.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceResourceTiming` object as the receiver.
-->

* {number}
Expand All @@ -878,6 +1001,11 @@ before Node.js starts the handshake process to secure the current connection.
added:
- v18.2.0
- v16.17.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceResourceTiming` object as the receiver.
-->

* {number}
Expand All @@ -891,6 +1019,11 @@ before Node.js receives the first byte of the response from the server.
added:
- v18.2.0
- v16.17.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceResourceTiming` object as the receiver.
-->

* {number}
Expand All @@ -905,6 +1038,11 @@ the transport connection is closed, whichever comes first.
added:
- v18.2.0
- v16.17.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceResourceTiming` object as the receiver.
-->

* {number}
Expand All @@ -918,6 +1056,11 @@ includes the response header fields plus the response payload body.
added:
- v18.2.0
- v16.17.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceResourceTiming` object as the receiver.
-->

* {number}
Expand All @@ -932,6 +1075,11 @@ content-codings.
added:
- v18.2.0
- v16.17.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This property getter must be called with the
`PerformanceResourceTiming` object as the receiver.
-->

* {number}
Expand All @@ -946,6 +1094,11 @@ content-codings.
added:
- v18.2.0
- v16.17.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44483
description: This method must be called with the
`PerformanceResourceTiming` object as the receiver.
-->

Returns a `object` that is the JSON representation of the
Expand Down
Loading

0 comments on commit a0363be

Please sign in to comment.