webmcp/script tools: Support cross-document tools [chromium/src : main]

0 views
Skip to first unread message

AI Code Reviewer (Gerrit)

unread,
Jan 22, 2026, 11:16:50 PMJan 22
to Khushal Sagar, chromium...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, mfoltz+wa...@chromium.org

AI Code Reviewer added 1 comment

File third_party/blink/renderer/core/script_tools/model_context.h
Line 61, Patchset 1 (Latest): void GetCrossDocumentScriptToolResult(
AI Code Reviewer . unresolved

Blink Style Guide: Dependencies. `core/` cannot depend on `public/web/`. The usage of `WebDocument::CrossDocumentScriptToolResultCallback` violates the dependency direction. Please define the callback type locally using `base::OnceCallback` and `WTF::String` (or `WebString` from `public/platform`).

To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **OK But Won't Fix**: reason | **Later**: b/<bug_id> | **Invalid:** reason


_This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent)._
_AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve._
_[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • 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: I47e994e70c613d32ded04ba4f2e934b5b479e2a7
Gerrit-Change-Number: 7512307
Gerrit-PatchSet: 1
Gerrit-Owner: Khushal Sagar <khusha...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-Comment-Date: Fri, 23 Jan 2026 04:16:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Khushal Sagar (Gerrit)

unread,
Jan 22, 2026, 11:24:08 PMJan 22
to Ben Greenstein, Mason Freed, Tom Sepez, Dominic Farolino, Chromium Metrics Reviews, AyeAye, AI Code Reviewer, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Ben Greenstein, Mason Freed and Tom Sepez

Khushal Sagar voted

Auto-Submit+1
Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Ben Greenstein
  • Mason Freed
  • Tom Sepez
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • 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: I47e994e70c613d32ded04ba4f2e934b5b479e2a7
Gerrit-Change-Number: 7512307
Gerrit-PatchSet: 3
Gerrit-Owner: Khushal Sagar <khusha...@chromium.org>
Gerrit-Reviewer: Ben Greenstein <be...@chromium.org>
Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Dominic Farolino <d...@chromium.org>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Ben Greenstein <be...@chromium.org>
Gerrit-Attention: Tom Sepez <tse...@chromium.org>
Gerrit-Comment-Date: Fri, 23 Jan 2026 04:23:37 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Khushal Sagar (Gerrit)

unread,
Jan 22, 2026, 11:26:25 PMJan 22
to David Trainor, Chromium LUCI CQ, Ben Greenstein, Mason Freed, Tom Sepez, Dominic Farolino, Chromium Metrics Reviews, AyeAye, AI Code Reviewer, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Ben Greenstein, David Trainor, Mason Freed and Tom Sepez

Khushal Sagar added 1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Khushal Sagar . resolved

+David for chrome_render_frame_observer changes.

Open in Gerrit

Related details

Attention is currently required from:
  • Ben Greenstein
  • David Trainor
  • Mason Freed
  • Tom Sepez
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • 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: I47e994e70c613d32ded04ba4f2e934b5b479e2a7
Gerrit-Change-Number: 7512307
Gerrit-PatchSet: 3
Gerrit-Owner: Khushal Sagar <khusha...@chromium.org>
Gerrit-Reviewer: Ben Greenstein <be...@chromium.org>
Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Dominic Farolino <d...@chromium.org>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Ben Greenstein <be...@chromium.org>
Gerrit-Attention: Tom Sepez <tse...@chromium.org>
Gerrit-Attention: David Trainor <dtra...@chromium.org>
Gerrit-Comment-Date: Fri, 23 Jan 2026 04:25:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Khushal Sagar (Gerrit)

unread,
Jan 22, 2026, 11:26:43 PMJan 22
to Chris Harrelson, David Trainor, Chromium LUCI CQ, Ben Greenstein, Mason Freed, Tom Sepez, Dominic Farolino, Chromium Metrics Reviews, AyeAye, AI Code Reviewer, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Ben Greenstein, Chris Harrelson, David Trainor, Mason Freed and Tom Sepez

Khushal Sagar added 1 comment

Patchset-level comments
Khushal Sagar . resolved

+chris for blink/public.

Open in Gerrit

Related details

Attention is currently required from:
  • Ben Greenstein
  • Chris Harrelson
  • David Trainor
  • Mason Freed
  • Tom Sepez
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • 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: I47e994e70c613d32ded04ba4f2e934b5b479e2a7
Gerrit-Change-Number: 7512307
Gerrit-PatchSet: 3
Gerrit-Owner: Khushal Sagar <khusha...@chromium.org>
Gerrit-Reviewer: Ben Greenstein <be...@chromium.org>
Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Dominic Farolino <d...@chromium.org>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Ben Greenstein <be...@chromium.org>
Gerrit-Attention: Tom Sepez <tse...@chromium.org>
Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
Gerrit-Attention: David Trainor <dtra...@chromium.org>
Gerrit-Comment-Date: Fri, 23 Jan 2026 04:26:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

David Trainor (Gerrit)

unread,
Jan 22, 2026, 11:30:33 PMJan 22
to Khushal Sagar, Chris Harrelson, Chromium LUCI CQ, Ben Greenstein, Mason Freed, Tom Sepez, Dominic Farolino, Chromium Metrics Reviews, AyeAye, AI Code Reviewer, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Ben Greenstein, Chris Harrelson, Khushal Sagar, Mason Freed and Tom Sepez

David Trainor voted and added 1 comment

Votes added by David Trainor

Code-Review+1

1 comment

Patchset-level comments
David Trainor . resolved

chrome_render_frame_observer lgtm!

Open in Gerrit

Related details

Attention is currently required from:
  • Ben Greenstein
  • Chris Harrelson
  • Khushal Sagar
  • Mason Freed
  • Tom Sepez
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I47e994e70c613d32ded04ba4f2e934b5b479e2a7
    Gerrit-Change-Number: 7512307
    Gerrit-PatchSet: 3
    Gerrit-Owner: Khushal Sagar <khusha...@chromium.org>
    Gerrit-Reviewer: Ben Greenstein <be...@chromium.org>
    Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
    Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
    Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Dominic Farolino <d...@chromium.org>
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Attention: Ben Greenstein <be...@chromium.org>
    Gerrit-Attention: Khushal Sagar <khusha...@chromium.org>
    Gerrit-Attention: Tom Sepez <tse...@chromium.org>
    Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
    Gerrit-Comment-Date: Fri, 23 Jan 2026 04:30:22 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dominic Farolino (Gerrit)

    unread,
    Jan 23, 2026, 10:21:21 AMJan 23
    to Khushal Sagar, David Trainor, Chris Harrelson, Chromium LUCI CQ, Ben Greenstein, Mason Freed, Tom Sepez, Chromium Metrics Reviews, AyeAye, AI Code Reviewer, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Ben Greenstein, Chris Harrelson, Khushal Sagar, Mason Freed and Tom Sepez

    Dominic Farolino added 4 comments

    File chrome/browser/actor/tools/script_tool_host.h
    Line 80, Patchset 3 (Latest): // navigation and the result wil be provided on the new Document.
    Dominic Farolino . unresolved

    Can you just add a little more documentation here? Specifically, can you mention that `new_document_` will be null and `new_document_render_frame_` will be unbound UNTIL we're notified of the new document being committed, and finally once we determine that it is same-origin with its predecessor, these fields will be set?

    File chrome/browser/actor/tools/script_tool_host.cc
    Line 108, Patchset 3 (Latest): if (target_document_render_frame_) {
    Dominic Farolino . unresolved

    Why is this needed now?

    File chrome/test/data/actor/declarative_script_tool_cross_document.html
    Line 10, Patchset 3 (Latest): <input id="echo" type="text" name="echo" required>
    Dominic Farolino . unresolved

    Are these changes needed?

    File third_party/blink/renderer/core/script_tools/model_context.h
    Line 61, Patchset 1: void GetCrossDocumentScriptToolResult(
    AI Code Reviewer . unresolved

    Blink Style Guide: Dependencies. `core/` cannot depend on `public/web/`. The usage of `WebDocument::CrossDocumentScriptToolResultCallback` violates the dependency direction. Please define the callback type locally using `base::OnceCallback` and `WTF::String` (or `WebString` from `public/platform`).

    To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
    **Done** | **OK But Won't Fix**: reason | **Later**: b/<bug_id> | **Invalid:** reason


    _This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent)._
    _AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve._
    _[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

    Dominic Farolino

    Amazing, one of the rare times the AI Code Reviewer is right...

    Gerrit-Comment-Date: Fri, 23 Jan 2026 15:21:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Khushal Sagar (Gerrit)

    unread,
    Jan 23, 2026, 6:12:44 PMJan 23
    to David Trainor, Chris Harrelson, Chromium LUCI CQ, Ben Greenstein, Mason Freed, Tom Sepez, Dominic Farolino, Chromium Metrics Reviews, AyeAye, AI Code Reviewer, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Ben Greenstein, Chris Harrelson, David Trainor, Dominic Farolino, Mason Freed and Tom Sepez

    Khushal Sagar voted and added 4 comments

    Votes added by Khushal Sagar

    Auto-Submit+1
    Commit-Queue+1

    4 comments

    File chrome/browser/actor/tools/script_tool_host.h
    Line 80, Patchset 3: // navigation and the result wil be provided on the new Document.
    Dominic Farolino . resolved

    Can you just add a little more documentation here? Specifically, can you mention that `new_document_` will be null and `new_document_render_frame_` will be unbound UNTIL we're notified of the new document being committed, and finally once we determine that it is same-origin with its predecessor, these fields will be set?

    Khushal Sagar

    Done

    File chrome/browser/actor/tools/script_tool_host.cc
    Line 108, Patchset 3: if (target_document_render_frame_) {
    Dominic Farolino . resolved

    Why is this needed now?

    Khushal Sagar

    This notification only needs to be sent to the old Document to cancel ongoing async work for the tool execution. Earlier that was always set for `kInvokeSent` but now we tear down all connections to the old Document while we're waiting on the navigation commit/pending result.

    File chrome/test/data/actor/declarative_script_tool_cross_document.html
    Line 10, Patchset 3: <input id="echo" type="text" name="echo" required>
    Dominic Farolino . resolved

    Are these changes needed?

    Khushal Sagar

    Not strictly, I was trying to use the same input json in the tests as the imperative version.

    File third_party/blink/renderer/core/script_tools/model_context.h
    Line 61, Patchset 1: void GetCrossDocumentScriptToolResult(
    AI Code Reviewer . resolved

    Blink Style Guide: Dependencies. `core/` cannot depend on `public/web/`. The usage of `WebDocument::CrossDocumentScriptToolResultCallback` violates the dependency direction. Please define the callback type locally using `base::OnceCallback` and `WTF::String` (or `WebString` from `public/platform`).

    To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
    **Done** | **OK But Won't Fix**: reason | **Later**: b/<bug_id> | **Invalid:** reason


    _This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent)._
    _AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve._
    _[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

    Dominic Farolino

    Amazing, one of the rare times the AI Code Reviewer is right...

    Khushal Sagar

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ben Greenstein
    • Chris Harrelson
    • David Trainor
    • Dominic Farolino
    • Mason Freed
    • Tom Sepez
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not 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: I47e994e70c613d32ded04ba4f2e934b5b479e2a7
      Gerrit-Change-Number: 7512307
      Gerrit-PatchSet: 4
      Gerrit-Owner: Khushal Sagar <khusha...@chromium.org>
      Gerrit-Reviewer: Ben Greenstein <be...@chromium.org>
      Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
      Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
      Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-CC: Dominic Farolino <d...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Attention: Ben Greenstein <be...@chromium.org>
      Gerrit-Attention: Dominic Farolino <d...@chromium.org>
      Gerrit-Attention: Tom Sepez <tse...@chromium.org>
      Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
      Gerrit-Attention: David Trainor <dtra...@chromium.org>
      Gerrit-Comment-Date: Fri, 23 Jan 2026 23:12:09 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Dominic Farolino <d...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Tom Sepez (Gerrit)

      unread,
      Jan 23, 2026, 6:52:34 PMJan 23
      to Khushal Sagar, David Trainor, Chris Harrelson, Chromium LUCI CQ, Ben Greenstein, Mason Freed, Dominic Farolino, Chromium Metrics Reviews, AyeAye, AI Code Reviewer, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, mfoltz+wa...@chromium.org
      Attention needed from Ben Greenstein, Chris Harrelson, David Trainor, Dominic Farolino, Khushal Sagar and Mason Freed

      Tom Sepez voted and added 1 comment

      Votes added by Tom Sepez

      Code-Review+1

      1 comment

      File chrome/common/chrome_render_frame.mojom
      Line 127, Patchset 4 (Latest): GetCrossDocumentScriptToolResult() => (string result);
      Tom Sepez . unresolved

      nit: maybe explain what this string means/contains?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Ben Greenstein
      • Chris Harrelson
      • David Trainor
      • Dominic Farolino
      • Khushal Sagar
      • Mason Freed
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not 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: I47e994e70c613d32ded04ba4f2e934b5b479e2a7
        Gerrit-Change-Number: 7512307
        Gerrit-PatchSet: 4
        Gerrit-Owner: Khushal Sagar <khusha...@chromium.org>
        Gerrit-Reviewer: Ben Greenstein <be...@chromium.org>
        Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
        Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
        Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Dominic Farolino <d...@chromium.org>
        Gerrit-Attention: Mason Freed <mas...@chromium.org>
        Gerrit-Attention: Ben Greenstein <be...@chromium.org>
        Gerrit-Attention: Khushal Sagar <khusha...@chromium.org>
        Gerrit-Attention: Dominic Farolino <d...@chromium.org>
        Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
        Gerrit-Attention: David Trainor <dtra...@chromium.org>
        Gerrit-Comment-Date: Fri, 23 Jan 2026 23:52:21 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Khushal Sagar (Gerrit)

        unread,
        Jan 26, 2026, 11:36:26 AMJan 26
        to Tom Sepez, David Trainor, Chris Harrelson, Chromium LUCI CQ, Ben Greenstein, Mason Freed, Dominic Farolino, Chromium Metrics Reviews, AyeAye, AI Code Reviewer, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, mfoltz+wa...@chromium.org
        Attention needed from Ben Greenstein, Chris Harrelson, David Trainor, Dominic Farolino, Mason Freed and Tom Sepez

        Khushal Sagar voted and added 1 comment

        Votes added by Khushal Sagar

        Auto-Submit+1
        Commit-Queue+1

        1 comment

        File chrome/common/chrome_render_frame.mojom
        Line 127, Patchset 4: GetCrossDocumentScriptToolResult() => (string result);
        Tom Sepez . resolved

        nit: maybe explain what this string means/contains?

        Khushal Sagar

        Done

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Ben Greenstein
        • Chris Harrelson
        • David Trainor
        • Dominic Farolino
        • Mason Freed
        • Tom Sepez
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not 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: I47e994e70c613d32ded04ba4f2e934b5b479e2a7
          Gerrit-Change-Number: 7512307
          Gerrit-PatchSet: 6
          Gerrit-Owner: Khushal Sagar <khusha...@chromium.org>
          Gerrit-Reviewer: Ben Greenstein <be...@chromium.org>
          Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
          Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
          Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
          Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
          Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
          Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-CC: Dominic Farolino <d...@chromium.org>
          Gerrit-Attention: Mason Freed <mas...@chromium.org>
          Gerrit-Attention: Ben Greenstein <be...@chromium.org>
          Gerrit-Attention: Tom Sepez <tse...@chromium.org>
          Gerrit-Attention: Dominic Farolino <d...@chromium.org>
          Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
          Gerrit-Attention: David Trainor <dtra...@chromium.org>
          Gerrit-Comment-Date: Mon, 26 Jan 2026 16:35:59 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Tom Sepez <tse...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Chris Harrelson (Gerrit)

          unread,
          Jan 26, 2026, 11:49:14 AMJan 26
          to Khushal Sagar, Tom Sepez, David Trainor, Chromium LUCI CQ, Ben Greenstein, Mason Freed, Dominic Farolino, Chromium Metrics Reviews, AyeAye, AI Code Reviewer, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, mfoltz+wa...@chromium.org
          Attention needed from Ben Greenstein, David Trainor, Dominic Farolino, Khushal Sagar, Mason Freed and Tom Sepez

          Chris Harrelson voted and added 1 comment

          Votes added by Chris Harrelson

          Code-Review+1

          1 comment

          Patchset-level comments
          File-level comment, Patchset 6 (Latest):
          Chris Harrelson . resolved

          third_party/blink/public/web/web_document.h LGTM

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Ben Greenstein
          • David Trainor
          • Dominic Farolino
          • Khushal Sagar
          • Mason Freed
          • Tom Sepez
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • 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: I47e994e70c613d32ded04ba4f2e934b5b479e2a7
          Gerrit-Change-Number: 7512307
          Gerrit-PatchSet: 6
          Gerrit-Owner: Khushal Sagar <khusha...@chromium.org>
          Gerrit-Reviewer: Ben Greenstein <be...@chromium.org>
          Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
          Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
          Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
          Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
          Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
          Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-CC: Dominic Farolino <d...@chromium.org>
          Gerrit-Attention: Mason Freed <mas...@chromium.org>
          Gerrit-Attention: Ben Greenstein <be...@chromium.org>
          Gerrit-Attention: Khushal Sagar <khusha...@chromium.org>
          Gerrit-Attention: Tom Sepez <tse...@chromium.org>
          Gerrit-Attention: Dominic Farolino <d...@chromium.org>
          Gerrit-Attention: David Trainor <dtra...@chromium.org>
          Gerrit-Comment-Date: Mon, 26 Jan 2026 16:49:01 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Ben Greenstein (Gerrit)

          unread,
          Jan 26, 2026, 1:26:33 PMJan 26
          to Khushal Sagar, Chris Harrelson, Tom Sepez, David Trainor, Chromium LUCI CQ, Mason Freed, Dominic Farolino, Chromium Metrics Reviews, AyeAye, AI Code Reviewer, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, mfoltz+wa...@chromium.org
          Attention needed from David Trainor, Dominic Farolino, Khushal Sagar, Mason Freed and Tom Sepez

          Ben Greenstein voted and added 1 comment

          Votes added by Ben Greenstein

          Code-Review+1
          Commit-Queue+2

          1 comment

          File chrome/browser/actor/tools/script_tool_host.cc
          Line 226, Patchset 6 (Latest): PostErrorResult(std::move(tool_done_callback_),
          Ben Greenstein . unresolved
          Nit: I would put this first and return early for readability and to make adding to it slightly less error prone:
          if (!new_host.GetLastCommittedOrigin().IsSameOriginWith(target_document_origin_)) {
          PostErrorResult(...)
          return;
          }
          Open in Gerrit

          Related details

          Attention is currently required from:
          • David Trainor
          • Dominic Farolino
          • Khushal Sagar
          • Mason Freed
          • Tom Sepez
          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: I47e994e70c613d32ded04ba4f2e934b5b479e2a7
            Gerrit-Change-Number: 7512307
            Gerrit-PatchSet: 6
            Gerrit-Owner: Khushal Sagar <khusha...@chromium.org>
            Gerrit-Reviewer: Ben Greenstein <be...@chromium.org>
            Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
            Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
            Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
            Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
            Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
            Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-CC: Dominic Farolino <d...@chromium.org>
            Gerrit-Attention: Mason Freed <mas...@chromium.org>
            Gerrit-Attention: Khushal Sagar <khusha...@chromium.org>
            Gerrit-Attention: Tom Sepez <tse...@chromium.org>
            Gerrit-Attention: Dominic Farolino <d...@chromium.org>
            Gerrit-Attention: David Trainor <dtra...@chromium.org>
            Gerrit-Comment-Date: Mon, 26 Jan 2026 18:26:06 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Tom Sepez (Gerrit)

            unread,
            Jan 26, 2026, 1:45:39 PMJan 26
            to Khushal Sagar, Ben Greenstein, Chris Harrelson, David Trainor, Chromium LUCI CQ, Mason Freed, Dominic Farolino, Chromium Metrics Reviews, AyeAye, AI Code Reviewer, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, mfoltz+wa...@chromium.org
            Attention needed from Ben Greenstein, David Trainor, Dominic Farolino, Khushal Sagar and Mason Freed

            Tom Sepez voted Code-Review+1

            Code-Review+1
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Ben Greenstein
            • David Trainor
            • Dominic Farolino
            • Khushal Sagar
            • Mason Freed
            Gerrit-Attention: Ben Greenstein <be...@chromium.org>
            Gerrit-Attention: Khushal Sagar <khusha...@chromium.org>
            Gerrit-Attention: Dominic Farolino <d...@chromium.org>
            Gerrit-Attention: David Trainor <dtra...@chromium.org>
            Gerrit-Comment-Date: Mon, 26 Jan 2026 18:45:26 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Khushal Sagar (Gerrit)

            unread,
            Jan 26, 2026, 1:51:28 PMJan 26
            to Tom Sepez, Ben Greenstein, Chris Harrelson, David Trainor, Chromium LUCI CQ, Mason Freed, Dominic Farolino, Chromium Metrics Reviews, AyeAye, AI Code Reviewer, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, mfoltz+wa...@chromium.org
            Attention needed from Ben Greenstein, David Trainor, Dominic Farolino and Mason Freed

            Khushal Sagar voted and added 1 comment

            Votes added by Khushal Sagar

            Auto-Submit+1

            1 comment

            File chrome/browser/actor/tools/script_tool_host.cc
            Line 226, Patchset 6: PostErrorResult(std::move(tool_done_callback_),
            Ben Greenstein . resolved
            Nit: I would put this first and return early for readability and to make adding to it slightly less error prone:
            if (!new_host.GetLastCommittedOrigin().IsSameOriginWith(target_document_origin_)) {
            PostErrorResult(...)
            return;
            }
            Khushal Sagar

            Done

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Ben Greenstein
            • David Trainor
            • Dominic Farolino
            • Mason Freed
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement satisfiedCode-Owners
              • requirement satisfiedCode-Review
              • 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: I47e994e70c613d32ded04ba4f2e934b5b479e2a7
              Gerrit-Change-Number: 7512307
              Gerrit-PatchSet: 7
              Gerrit-Owner: Khushal Sagar <khusha...@chromium.org>
              Gerrit-Reviewer: Ben Greenstein <be...@chromium.org>
              Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
              Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
              Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
              Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
              Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
              Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
              Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
              Gerrit-CC: Dominic Farolino <d...@chromium.org>
              Gerrit-Attention: Mason Freed <mas...@chromium.org>
              Gerrit-Attention: Ben Greenstein <be...@chromium.org>
              Gerrit-Attention: Dominic Farolino <d...@chromium.org>
              Gerrit-Attention: David Trainor <dtra...@chromium.org>
              Gerrit-Comment-Date: Mon, 26 Jan 2026 18:50:48 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              Comment-In-Reply-To: Ben Greenstein <be...@chromium.org>
              satisfied_requirement
              open
              diffy

              Khushal Sagar (Gerrit)

              unread,
              Jan 26, 2026, 1:54:13 PMJan 26
              to Tom Sepez, Ben Greenstein, Chris Harrelson, David Trainor, Chromium LUCI CQ, Mason Freed, Dominic Farolino, Chromium Metrics Reviews, AyeAye, AI Code Reviewer, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, mfoltz+wa...@chromium.org
              Attention needed from Ben Greenstein, David Trainor, Dominic Farolino and Mason Freed

              Khushal Sagar voted Commit-Queue+2

              Commit-Queue+2
              Gerrit-Comment-Date: Mon, 26 Jan 2026 18:53:32 +0000
              Gerrit-HasComments: No
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              open
              diffy

              Khushal Sagar (Gerrit)

              unread,
              Jan 26, 2026, 3:59:05 PMJan 26
              to Tom Sepez, Ben Greenstein, Chris Harrelson, David Trainor, Chromium LUCI CQ, Mason Freed, Dominic Farolino, Chromium Metrics Reviews, AyeAye, AI Code Reviewer, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, mfoltz+wa...@chromium.org
              Gerrit-Comment-Date: Mon, 26 Jan 2026 20:58:23 +0000
              Gerrit-HasComments: No
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              open
              diffy

              Chromium LUCI CQ (Gerrit)

              unread,
              Jan 26, 2026, 4:31:46 PMJan 26
              to Khushal Sagar, Tom Sepez, Ben Greenstein, Chris Harrelson, David Trainor, Mason Freed, Dominic Farolino, Chromium Metrics Reviews, AyeAye, AI Code Reviewer, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, mfoltz+wa...@chromium.org

              Chromium LUCI CQ submitted the change with unreviewed changes

              Unreviewed changes

              6 is the latest approved patch-set.
              The change was submitted with unreviewed changes in the following files:

              ```
              The name of the file: chrome/browser/actor/tools/script_tool_host.cc
              Insertions: 14, Deletions: 15.

              @@ -207,24 +207,23 @@
              }

              auto& new_host = page.GetMainDocument();
              - if (new_host.GetLastCommittedOrigin().IsSameOriginWith(
              + if (!new_host.GetLastCommittedOrigin().IsSameOriginWith(
              target_document_origin_)) {
              - // The new navigation has committed. Send a request to the renderer to
              - // pull the result.
              - lifecycle_ = Lifecycle::kPendingResultFromNewDocment;
              - new_document_ = new_host.GetWeakDocumentPtr();
              - new_host.GetRemoteAssociatedInterfaces()->GetInterface(
              - &new_document_render_frame_);
              - new_document_render_frame_->GetCrossDocumentScriptToolResult(
              - base::BindOnce(&ScriptToolHost::OnResultReceivedFromNewDocument,
              - weak_ptr_factory_.GetWeakPtr()));
              + // If we end with a cross-origin navigation, assume execution
              + // failure.
              + PostErrorResult(std::move(tool_done_callback_),
              + mojom::ActionResultCode::kScriptToolCrossOriginNavigation);
              return;
              }
              -
              - // If we end with a cross-origin navigation, assume execution
              - // failure.
              - PostErrorResult(std::move(tool_done_callback_),
              - mojom::ActionResultCode::kScriptToolCrossOriginNavigation);
              + // The new navigation has committed. Send a request to the renderer to
              + // pull the result.
              + lifecycle_ = Lifecycle::kPendingResultFromNewDocment;
              + new_document_ = new_host.GetWeakDocumentPtr();
              + new_host.GetRemoteAssociatedInterfaces()->GetInterface(
              + &new_document_render_frame_);
              + new_document_render_frame_->GetCrossDocumentScriptToolResult(
              + base::BindOnce(&ScriptToolHost::OnResultReceivedFromNewDocument,
              + weak_ptr_factory_.GetWeakPtr()));

              // TODO(khushalsagar): We need to address the case where this navigation never
              // commits in which case PrimaryPageChanged won't be dispatched. See
              ```

              Change information

              Commit message:
              webmcp/script tools: Support cross-document tools

              The browser-side ScriptToolHost now waits for the new navigation to be
              committed if the renderer's execution of a tool indicates that. This is
              used when a form's default submit action triggers a navigation.
              Fixed: 475991228
              Change-Id: I47e994e70c613d32ded04ba4f2e934b5b479e2a7
              Commit-Queue: Khushal Sagar <khusha...@chromium.org>
              Reviewed-by: Chris Harrelson <chri...@chromium.org>
              Reviewed-by: Tom Sepez <tse...@chromium.org>
              Reviewed-by: Ben Greenstein <be...@chromium.org>
              Auto-Submit: Khushal Sagar <khusha...@chromium.org>
              Cr-Commit-Position: refs/heads/main@{#1574743}
              Files:
              • M chrome/browser/actor/execution_engine_unittest.cc
              • M chrome/browser/actor/tools/script_tool_browsertest.cc
              • M chrome/browser/actor/tools/script_tool_host.cc
              • M chrome/browser/actor/tools/script_tool_host.h
              • M chrome/common/actor.mojom
              • M chrome/common/chrome_render_frame.mojom
              • M chrome/renderer/actor/script_tool.cc
              • M chrome/renderer/chrome_render_frame_observer.cc
              • M chrome/renderer/chrome_render_frame_observer.h
              • M chrome/test/data/actor/declarative_script_tool_cross_document.html
              • M chrome/test/data/actor/declarative_script_tool_cross_document_result.html
              • M third_party/blink/public/web/web_document.h
              • M third_party/blink/renderer/core/dom/document.cc
              • M third_party/blink/renderer/core/exported/web_document.cc
              • M third_party/blink/renderer/core/script_tools/model_context.cc
              • M third_party/blink/renderer/core/script_tools/model_context.h
              • M third_party/blink/renderer/core/script_tools/model_context_supplement.cc
              • M tools/metrics/histograms/metadata/actor/enums.xml
              Change size: L
              Delta: 18 files changed, 319 insertions(+), 26 deletions(-)
              Branch: refs/heads/main
              Submit Requirements:
              • requirement satisfiedCode-Review: +1 by Ben Greenstein, +1 by Tom Sepez, +1 by Chris Harrelson
              Open in Gerrit
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: merged
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I47e994e70c613d32ded04ba4f2e934b5b479e2a7
              Gerrit-Change-Number: 7512307
              Gerrit-PatchSet: 8
              Gerrit-Owner: Khushal Sagar <khusha...@chromium.org>
              Gerrit-Reviewer: Ben Greenstein <be...@chromium.org>
              Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
              Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
              Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
              Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
              Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
              Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
              Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
              open
              diffy
              satisfied_requirement
              Reply all
              Reply to author
              Forward
              0 new messages