[CDP] introduce Inspector.workerScriptLoaded [chromium/src : main]

0 views
Skip to first unread message

Dmitry Gozman (Gerrit)

unread,
Oct 9, 2025, 9:50:48 AM (5 days ago) Oct 9
to Andrey Kosyakov, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, devtools-re...@chromium.org, horo+...@chromium.org, kinuko...@chromium.org, shimazu...@chromium.org
Attention needed from Andrey Kosyakov

Dmitry Gozman added 1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Dmitry Gozman . resolved

Andrey, could you please take a look?

Open in Gerrit

Related details

Attention is currently required from:
  • Andrey Kosyakov
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie800a17dae42810e077c7c0bf49f0821d728a674
Gerrit-Change-Number: 7016867
Gerrit-PatchSet: 3
Gerrit-Owner: Dmitry Gozman <dgo...@chromium.org>
Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Reviewer: Dmitry Gozman <dgo...@chromium.org>
Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Comment-Date: Thu, 09 Oct 2025 13:50:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Andrey Kosyakov (Gerrit)

unread,
Oct 10, 2025, 11:54:16 AM (4 days ago) Oct 10
to Dmitry Gozman, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, devtools-re...@chromium.org, horo+...@chromium.org, kinuko...@chromium.org, shimazu...@chromium.org
Attention needed from Dmitry Gozman

Andrey Kosyakov voted and added 4 comments

Votes added by Andrey Kosyakov

Code-Review+1

4 comments

Patchset-level comments
Andrey Kosyakov . resolved

lgtm with comments

File third_party/blink/public/devtools_protocol/domains/Inspector.pdl
Line 28, Patchset 3 (Latest): event workerScriptLoaded
Andrey Kosyakov . unresolved

`experimental`, please!

File third_party/blink/renderer/core/inspector/worker_inspector_controller.h
Line 109, Patchset 3 (Latest): inspector_agents_;
Andrey Kosyakov . unresolved

Can we avoid this and piggy-back on the probe sink instead?

File third_party/blink/renderer/core/workers/worker_global_scope.cc
Line 581, Patchset 3 (Latest): if (auto* controller = GetThread()->GetWorkerInspectorController()) {
Andrey Kosyakov . unresolved

Why not just go with a regular probe here and save on explicit session collection in the WorkerInspectorController?

Open in Gerrit

Related details

Attention is currently required from:
  • Dmitry Gozman
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ie800a17dae42810e077c7c0bf49f0821d728a674
    Gerrit-Change-Number: 7016867
    Gerrit-PatchSet: 3
    Gerrit-Owner: Dmitry Gozman <dgo...@chromium.org>
    Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Reviewer: Dmitry Gozman <dgo...@chromium.org>
    Gerrit-Attention: Dmitry Gozman <dgo...@chromium.org>
    Gerrit-Comment-Date: Fri, 10 Oct 2025 15:53:45 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dmitry Gozman (Gerrit)

    unread,
    Oct 10, 2025, 2:51:58 PM (3 days ago) Oct 10
    to Andrey Kosyakov, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, devtools-re...@chromium.org, horo+...@chromium.org, kinuko...@chromium.org, shimazu...@chromium.org
    Attention needed from Andrey Kosyakov

    Dmitry Gozman added 1 comment

    File third_party/blink/renderer/core/inspector/worker_inspector_controller.h
    Andrey Kosyakov . unresolved

    Can we avoid this and piggy-back on the probe sink instead?

    Dmitry Gozman

    We can, but we'll still need this map to addToInstrumentingAgents on attach and removeFromInstrumentingAgents on detach. So I borrowed this pattern from `WebDevToolsAgentImpl`.

    Any ideas on getting rid of this map are appreciated.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrey Kosyakov
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ie800a17dae42810e077c7c0bf49f0821d728a674
    Gerrit-Change-Number: 7016867
    Gerrit-PatchSet: 3
    Gerrit-Owner: Dmitry Gozman <dgo...@chromium.org>
    Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Reviewer: Dmitry Gozman <dgo...@chromium.org>
    Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Comment-Date: Fri, 10 Oct 2025 18:51:01 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Andrey Kosyakov <ca...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Andrey Kosyakov (Gerrit)

    unread,
    Oct 10, 2025, 7:13:11 PM (3 days ago) Oct 10
    to Dmitry Gozman, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, devtools-re...@chromium.org, horo+...@chromium.org, kinuko...@chromium.org, shimazu...@chromium.org
    Attention needed from Dmitry Gozman

    Andrey Kosyakov added 1 comment

    File third_party/blink/renderer/core/inspector/worker_inspector_controller.h
    Andrey Kosyakov . unresolved

    Can we avoid this and piggy-back on the probe sink instead?

    Dmitry Gozman

    We can, but we'll still need this map to addToInstrumentingAgents on attach and removeFromInstrumentingAgents on detach. So I borrowed this pattern from `WebDevToolsAgentImpl`.

    Any ideas on getting rid of this map are appreciated.

    Andrey Kosyakov

    Ugh. I just realized we don't have Inspector.enable and emit unsolicited events ;-)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dmitry Gozman
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ie800a17dae42810e077c7c0bf49f0821d728a674
    Gerrit-Change-Number: 7016867
    Gerrit-PatchSet: 3
    Gerrit-Owner: Dmitry Gozman <dgo...@chromium.org>
    Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Reviewer: Dmitry Gozman <dgo...@chromium.org>
    Gerrit-Attention: Dmitry Gozman <dgo...@chromium.org>
    Gerrit-Comment-Date: Fri, 10 Oct 2025 23:12:45 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dmitry Gozman <dgo...@chromium.org>
    Comment-In-Reply-To: Andrey Kosyakov <ca...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dmitry Gozman (Gerrit)

    unread,
    Oct 13, 2025, 5:41:53 AM (21 hours ago) Oct 13
    to Andrey Kosyakov, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, devtools-re...@chromium.org, horo+...@chromium.org, kinuko...@chromium.org, shimazu...@chromium.org
    Attention needed from Andrey Kosyakov

    Dmitry Gozman added 1 comment

    File third_party/blink/renderer/core/inspector/worker_inspector_controller.h
    Andrey Kosyakov . unresolved

    Can we avoid this and piggy-back on the probe sink instead?

    Dmitry Gozman

    We can, but we'll still need this map to addToInstrumentingAgents on attach and removeFromInstrumentingAgents on detach. So I borrowed this pattern from `WebDevToolsAgentImpl`.

    Any ideas on getting rid of this map are appreciated.

    Andrey Kosyakov

    Ugh. I just realized we don't have Inspector.enable and emit unsolicited events ;-)

    Dmitry Gozman

    That's correct. I tried to put this behind `Inspector.enable()`, see patchset #1, but that does not work nicely, because it now makes `Inspector.enable()` call roundtrip to the renderer, and chromedriver does not expect that. I guess it's being awaited before issuing `Runtime.runIfWaitingForDebugger()` or something along these lines.

    Interestingly, we already do this in the [Inspector domain](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/protocol/inspector_handler.cc;l=37-40;drc=62a9a00176f862e688fa47919ed6f19b59f77b5f;bpv=1;bpt=1).

    If you think this behavior is not ideal, we'll have to put this event into a different domain. Nothing comes to mind though...

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrey Kosyakov
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ie800a17dae42810e077c7c0bf49f0821d728a674
    Gerrit-Change-Number: 7016867
    Gerrit-PatchSet: 3
    Gerrit-Owner: Dmitry Gozman <dgo...@chromium.org>
    Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Reviewer: Dmitry Gozman <dgo...@chromium.org>
    Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Comment-Date: Mon, 13 Oct 2025 09:40:59 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Andrey Kosyakov (Gerrit)

    unread,
    Oct 13, 2025, 1:21:13 PM (13 hours ago) Oct 13
    to Dmitry Gozman, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, devtools-re...@chromium.org, horo+...@chromium.org, kinuko...@chromium.org, shimazu...@chromium.org
    Attention needed from Dmitry Gozman

    Andrey Kosyakov added 1 comment

    File third_party/blink/renderer/core/inspector/worker_inspector_controller.h
    Andrey Kosyakov . resolved

    Can we avoid this and piggy-back on the probe sink instead?

    Dmitry Gozman

    We can, but we'll still need this map to addToInstrumentingAgents on attach and removeFromInstrumentingAgents on detach. So I borrowed this pattern from `WebDevToolsAgentImpl`.

    Any ideas on getting rid of this map are appreciated.

    Andrey Kosyakov

    Ugh. I just realized we don't have Inspector.enable and emit unsolicited events ;-)

    Dmitry Gozman

    That's correct. I tried to put this behind `Inspector.enable()`, see patchset #1, but that does not work nicely, because it now makes `Inspector.enable()` call roundtrip to the renderer, and chromedriver does not expect that. I guess it's being awaited before issuing `Runtime.runIfWaitingForDebugger()` or something along these lines.

    Interestingly, we already do this in the [Inspector domain](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/protocol/inspector_handler.cc;l=37-40;drc=62a9a00176f862e688fa47919ed6f19b59f77b5f;bpv=1;bpt=1).

    If you think this behavior is not ideal, we'll have to put this event into a different domain. Nothing comes to mind though...

    Andrey Kosyakov

    Would putting the event into a different domain result in a different behavior though? I think present implementation is acceptable for a provisional workaround, and we should perhaps eventually come up with a cleaner solution.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dmitry Gozman
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ie800a17dae42810e077c7c0bf49f0821d728a674
    Gerrit-Change-Number: 7016867
    Gerrit-PatchSet: 3
    Gerrit-Owner: Dmitry Gozman <dgo...@chromium.org>
    Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Reviewer: Dmitry Gozman <dgo...@chromium.org>
    Gerrit-Attention: Dmitry Gozman <dgo...@chromium.org>
    Gerrit-Comment-Date: Mon, 13 Oct 2025 17:20:46 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages