[webkit-changes] [WebKit/WebKit] 626aa2: Web Inspector: Console: add internal properties fo...

Devin Rousso noreply at github.com
Thu Aug 8 11:11:49 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 626aa2207e3e6402daa4dfd62a02b6cf29ab8683
      https://github.com/WebKit/WebKit/commit/626aa2207e3e6402daa4dfd62a02b6cf29ab8683
  Author: Devin Rousso <hi at devinrousso.com>
  Date:   2024-08-08 (Thu, 08 Aug 2024)

  Changed paths:
    A LayoutTests/inspector/model/remote-object/finalizationregistry-expected.txt
    A LayoutTests/inspector/model/remote-object/finalizationregistry.html
    M LayoutTests/inspector/model/remote-object/resources/remote-object-utilities.js
    M Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp
    M Source/JavaScriptCore/runtime/JSFinalizationRegistry.cpp
    M Source/JavaScriptCore/runtime/JSFinalizationRegistry.h

  Log Message:
  -----------
  Web Inspector: Console: add internal properties for registrations of a `FinalizationRegistry`
https://bugs.webkit.org/show_bug.cgi?id=276719

Reviewed by Yusuke Suzuki.

Add special handling for `FinalizationRegistry` to make it easier for developers to understand its state (e.g. what is still alive vs what is dead but not yet notified vs etc.).

* Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::getInternalProperties):
Add internal properties for
- `cleanupCallback` to help the developer know what the `FinalizationRegistry` is for if the grab it via some general means (e.g. `queryInstances`).
- `live` is the list of objects that have not been GCd, each showing the `target`, `heldValue`, and (if provided) `unregisterToken`.
- `dead` is the list of metadata for objects that have been GCd (but not yet notified), each showing the `heldValue` and (if provided) `unregisterToken`.

* Source/JavaScriptCore/runtime/JSFinalizationRegistry.h:
* Source/JavaScriptCore/runtime/JSFinalizationRegistry.cpp:
(JSC::JSFinalizationRegistry::forEachLive const): Added.
(JSC::JSFinalizationRegistry::forEachDead const): Added.
Expose ways for callers to get the above data.

* LayoutTests/inspector/model/remote-object/resources/remote-object-utilities.js:
* LayoutTests/inspector/model/remote-object/finalizationregistry.html: Added.
* LayoutTests/inspector/model/remote-object/finalizationregistry-expected.txt: Added.

Canonical link: https://commits.webkit.org/282000@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list