[Blink] Add CloneableMessage support to WebSerializedScriptValue [chromium/src : main]

38 views
Skip to first unread message

Justin Lulejian (Gerrit)

unread,
Feb 4, 2026, 12:01:11 PM (7 days ago) Feb 4
to Dave Tapuska, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jbroma...@chromium.org
Attention needed from Dave Tapuska

Justin Lulejian added 2 comments

Patchset-level comments
File-level comment, Patchset 12 (Latest):
Justin Lulejian . resolved

Hi Dave! I realized that BigBuffer will send many things except Blob so switching to CloneableMessage will give us that.

File third_party/blink/renderer/core/exported/web_serialized_script_value.cc
Line 46, Patchset 8:// Converts a `blink::CloneableMessage` (Mojo type in public/common) to a
// `mojom::blink::CloneableMessagePtr` (Blink variant Mojo type).
//
// Note: This conversion does not include fields like `sender_origin`,
// `stack_trace`, or `file_system_access_tokens` as they are not currently
// needed for this use case. It only populates `encoded_message`,
// `sender_agent_cluster_id`, `locked_to_sender_agent_cluster`, and `blobs`.
// This partial conversion is sufficient for the current purposes of
// WebSerializedScriptValue and specifically the extension messaging use-case.
mojom::blink::CloneableMessagePtr ToMojoCloneableMessage(
CloneableMessage input) {
auto output = mojom::blink::CloneableMessage::New();
output->encoded_message = mojo_base::BigBuffer(input.encoded_message);
output->sender_agent_cluster_id = input.sender_agent_cluster_id;
output->locked_to_sender_agent_cluster = input.locked_to_sender_agent_cluster;
for (auto& blob : input.blobs) {
output->blobs.push_back(
BlobDataHandle::Create(String::FromUTF8(blob->uuid),
String::FromUTF8(blob->content_type), blob->size,
mojo::PendingRemote<mojom::blink::Blob>(
std::move(blob->blob).PassPipe(), 0)));
}
return output;
}

// Converts a `mojom::blink::CloneableMessagePtr` (Blink variant Mojo type) to a
// `blink::CloneableMessage` (Mojo type in public/common).
//
// Note: This conversion only populates the basic fields needed for structured
// clone: `encoded_message`, `sender_agent_cluster_id`,
// `locked_to_sender_agent_cluster`, and `blobs`. Other fields in
// `blink::CloneableMessage` are left with their default values. This partial
// conversion is sufficient for the current purposes of
// WebSerializedScriptValue and specifically the extension messaging use-case.
CloneableMessage ToCloneableMessage(mojom::blink::CloneableMessagePtr input) {
CloneableMessage output;
auto encoded_span = base::span(input->encoded_message);
output.owned_encoded_message =
std::vector<uint8_t>(encoded_span.begin(), encoded_span.end());
output.encoded_message = output.owned_encoded_message;
output.sender_agent_cluster_id = input->sender_agent_cluster_id;
output.locked_to_sender_agent_cluster = input->locked_to_sender_agent_cluster;
for (auto& blob_handle : input->blobs) {
output.blobs.push_back(mojom::SerializedBlob::New(
blob_handle->Uuid().Utf8(), blob_handle->GetType().Utf8(),
blob_handle->size(),
mojo::PendingRemote<mojom::Blob>(
blob_handle->CloneBlobRemote().PassPipe(), 0)));
}
return output;
}
Justin Lulejian . resolved

I created ToMojoCloneableMessage/ToCloneableMessage at this level to keep the //extensions-specific logic as as high-level as possible, but since WebSerializedScriptValue seems to be more of a wrapper around SerializedScriptValue, I'd be happy to move it down to the SerializedScriptValue class itself if that is more appropriate. Then we don't need the new unit test file either.

Open in Gerrit

Related details

Attention is currently required from:
  • Dave Tapuska
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: I096288a35b345461c3cd2339632272dc58be10d2
Gerrit-Change-Number: 7411966
Gerrit-PatchSet: 12
Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
Gerrit-Comment-Date: Wed, 04 Feb 2026 17:01:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

AI Code Reviewer (Gerrit)

unread,
Feb 4, 2026, 12:04:04 PM (7 days ago) Feb 4
to Justin Lulejian, Dave Tapuska, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jbroma...@chromium.org
Attention needed from Dave Tapuska

AI Code Reviewer added 1 comment

File third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h
Line 451, Patchset 12 (Latest): bool locked_to_sender_agent_cluster_ = false;
AI Code Reviewer . unresolved

nit: Blink Style Guide: Naming - Precede boolean values with words like “is” and “did”. Consider renaming 'locked_to_sender_agent_cluster_' to 'is_locked_to_sender_agent_cluster_'.

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 is currently required from:
  • Dave Tapuska
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: I096288a35b345461c3cd2339632272dc58be10d2
    Gerrit-Change-Number: 7411966
    Gerrit-PatchSet: 12
    Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
    Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Comment-Date: Wed, 04 Feb 2026 17:04:00 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dave Tapuska (Gerrit)

    unread,
    Feb 4, 2026, 4:08:06 PM (7 days ago) Feb 4
    to Justin Lulejian, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jbroma...@chromium.org
    Attention needed from Justin Lulejian

    Dave Tapuska added 1 comment

    File third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h
    Line 450, Patchset 12 (Latest): base::UnguessableToken sender_agent_cluster_id_;
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Justin Lulejian
    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: I096288a35b345461c3cd2339632272dc58be10d2
    Gerrit-Change-Number: 7411966
    Gerrit-PatchSet: 12
    Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
    Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Justin Lulejian <jlul...@chromium.org>
    Gerrit-Comment-Date: Wed, 04 Feb 2026 21:08:01 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Justin Lulejian (Gerrit)

    unread,
    Feb 4, 2026, 7:03:36 PM (7 days ago) Feb 4
    to AI Code Reviewer, Dave Tapuska, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jbroma...@chromium.org
    Attention needed from Dave Tapuska

    Justin Lulejian added 2 comments

    File third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h
    Line 451, Patchset 12: bool locked_to_sender_agent_cluster_ = false;
    AI Code Reviewer . resolved

    nit: Blink Style Guide: Naming - Precede boolean values with words like “is” and “did”. Consider renaming 'locked_to_sender_agent_cluster_' to 'is_locked_to_sender_agent_cluster_'.

    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)_

    Justin Lulejian

    Done

    Line 450, Patchset 12: base::UnguessableToken sender_agent_cluster_id_;
    Dave Tapuska . resolved
    Justin Lulejian

    Realized that while sender_agent_cluster_id has to be populated to satisfy the mojom serializer, it's not something we use/need and so we don't need to store this. Changed it to just set a value when converting from/to CloneableMessage.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dave Tapuska
    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: I096288a35b345461c3cd2339632272dc58be10d2
      Gerrit-Change-Number: 7411966
      Gerrit-PatchSet: 13
      Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
      Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
      Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
      Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
      Gerrit-Comment-Date: Thu, 05 Feb 2026 00:03:30 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Comment-In-Reply-To: Dave Tapuska <dtap...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dave Tapuska (Gerrit)

      unread,
      Feb 5, 2026, 2:25:21 PM (6 days ago) Feb 5
      to Justin Lulejian, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jbroma...@chromium.org
      Attention needed from Justin Lulejian

      Dave Tapuska added 2 comments

      File third_party/blink/renderer/core/exported/web_serialized_script_value.cc
      Line 54, Patchset 13 (Latest):mojom::blink::CloneableMessagePtr ToMojoCloneableMessage(
      Dave Tapuska . unresolved

      I'm confused. why can't we just the mojo message traits?

      Why do we need specific implementations here?

      Line 68, Patchset 13 (Latest): // The `CloneableMessage` mojo definition requires `sender_agent_cluster_id`
      Dave Tapuska . unresolved

      I feel this comment should be in SerializedScriptValue::GetCloneableMessage

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Justin Lulejian
      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: I096288a35b345461c3cd2339632272dc58be10d2
        Gerrit-Change-Number: 7411966
        Gerrit-PatchSet: 13
        Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
        Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
        Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-Attention: Justin Lulejian <jlul...@chromium.org>
        Gerrit-Comment-Date: Thu, 05 Feb 2026 19:25:16 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Justin Lulejian (Gerrit)

        unread,
        Feb 5, 2026, 3:11:17 PM (6 days ago) Feb 5
        to AI Code Reviewer, Dave Tapuska, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jbroma...@chromium.org
        Attention needed from Dave Tapuska and Justin Lulejian

        Justin Lulejian added 1 comment

        File third_party/blink/renderer/core/exported/web_serialized_script_value.cc
        Line 54, Patchset 13 (Latest):mojom::blink::CloneableMessagePtr ToMojoCloneableMessage(
        Dave Tapuska . unresolved

        I'm confused. why can't we just the mojo message traits?

        Why do we need specific implementations here?

        Justin Lulejian
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Dave Tapuska
        • Justin Lulejian
        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: I096288a35b345461c3cd2339632272dc58be10d2
        Gerrit-Change-Number: 7411966
        Gerrit-PatchSet: 13
        Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
        Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
        Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-Attention: Justin Lulejian <jlul...@chromium.org>
        Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
        Gerrit-Comment-Date: Thu, 05 Feb 2026 20:11:12 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Dave Tapuska <dtap...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Dave Tapuska (Gerrit)

        unread,
        Feb 5, 2026, 3:14:56 PM (6 days ago) Feb 5
        to Justin Lulejian, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jbroma...@chromium.org
        Attention needed from Justin Lulejian

        Dave Tapuska added 1 comment

        File third_party/blink/renderer/core/exported/web_serialized_script_value.cc
        Line 54, Patchset 13 (Latest):mojom::blink::CloneableMessagePtr ToMojoCloneableMessage(
        Dave Tapuska . unresolved

        I'm confused. why can't we just the mojo message traits?

        Why do we need specific implementations here?

        Justin Lulejian

        Could you clarify which mojo message traits you think we could use? This [one](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/common/messaging/cloneable_message_mojom_traits.h)?

        Dave Tapuska

        Yes

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Justin Lulejian
        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: I096288a35b345461c3cd2339632272dc58be10d2
        Gerrit-Change-Number: 7411966
        Gerrit-PatchSet: 13
        Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
        Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
        Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-Attention: Justin Lulejian <jlul...@chromium.org>
        Gerrit-Comment-Date: Thu, 05 Feb 2026 20:14:51 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Justin Lulejian <jlul...@chromium.org>
        Comment-In-Reply-To: Dave Tapuska <dtap...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Dave Tapuska (Gerrit)

        unread,
        Feb 5, 2026, 3:20:58 PM (6 days ago) Feb 5
        to Justin Lulejian, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jbroma...@chromium.org
        Attention needed from Justin Lulejian

        Dave Tapuska added 1 comment

        File third_party/blink/renderer/core/exported/web_serialized_script_value.cc
        Line 54, Patchset 13 (Latest):mojom::blink::CloneableMessagePtr ToMojoCloneableMessage(
        Dave Tapuska . unresolved

        I'm confused. why can't we just the mojo message traits?

        Why do we need specific implementations here?

        Justin Lulejian

        Could you clarify which mojo message traits you think we could use? This [one](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/common/messaging/cloneable_message_mojom_traits.h)?

        Dave Tapuska

        Yes

        Dave Tapuska

        Or why do we need to convert

        third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h

        to/from mojom can't it use
        https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/common/messaging/cloneable_message.h?q=CloneableMessage%20third_party%2Fblink%20-path:out&ss=chromium%2Fchromium%2Fsrc

        Is it layering?

        Gerrit-Comment-Date: Thu, 05 Feb 2026 20:20:53 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Justin Lulejian (Gerrit)

        unread,
        Feb 9, 2026, 6:56:08 PM (2 days ago) Feb 9
        to AyeAye, AI Code Reviewer, Dave Tapuska, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jbroma...@chromium.org
        Attention needed from Dave Tapuska

        Justin Lulejian voted and added 2 comments

        Votes added by Justin Lulejian

        Commit-Queue+1

        2 comments

        File third_party/blink/renderer/core/exported/web_serialized_script_value.cc
        Line 54, Patchset 13:mojom::blink::CloneableMessagePtr ToMojoCloneableMessage(
        Dave Tapuska . resolved

        I'm confused. why can't we just the mojo message traits?

        Why do we need specific implementations here?

        Justin Lulejian

        Could you clarify which mojo message traits you think we could use? This [one](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/common/messaging/cloneable_message_mojom_traits.h)?

        Dave Tapuska

        Yes

        Dave Tapuska

        Or why do we need to convert

        third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h

        to/from mojom can't it use
        https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/common/messaging/cloneable_message.h?q=CloneableMessage%20third_party%2Fblink%20-path:out&ss=chromium%2Fchromium%2Fsrc

        Is it layering?

        Justin Lulejian

        Thanks! Was able to use traits, but it required adding some missing includes into third_party/blink/public/common/messaging/cloneable_message_mojom_traits.h and third_party/blink/renderer/platform/blob/serialized_blob_mojom_traits.h to fix compile errors. I moved the impl down to SerializedScriptValue vs WebSerializedScriptValue (and the tests) to keep the current design intact. PTAL.

        Line 68, Patchset 13: // The `CloneableMessage` mojo definition requires `sender_agent_cluster_id`
        Dave Tapuska . resolved

        I feel this comment should be in SerializedScriptValue::GetCloneableMessage

        Justin Lulejian

        I moved the essence of this comment to WebSerializedScriptValue since that is where we pass the ID in now.

        When thinking about it I don't think we should restrict callers to have to accept a randomly generated ID from this impl if they wanted to specify it, but for the current purposes it is a randomly generated token (but provided by the //extensions layer to keep that detail out of the blink layer). LMK if it would be better to generated it inside of blink though.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Dave Tapuska
        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: I096288a35b345461c3cd2339632272dc58be10d2
          Gerrit-Change-Number: 7411966
          Gerrit-PatchSet: 19
          Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
          Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
          Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
          Gerrit-CC: Kentaro Hara <har...@chromium.org>
          Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
          Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Comment-Date: Mon, 09 Feb 2026 23:56:03 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Justin Lulejian (Gerrit)

          unread,
          Feb 10, 2026, 1:34:45 PM (21 hours ago) Feb 10
          to AyeAye, AI Code Reviewer, Dave Tapuska, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jbroma...@chromium.org
          Attention needed from Dave Tapuska

          Justin Lulejian added 1 comment

          File third_party/blink/renderer/core/exported/web_serialized_script_value.cc
          Line 54, Patchset 13:mojom::blink::CloneableMessagePtr ToMojoCloneableMessage(
          Dave Tapuska . resolved

          I'm confused. why can't we just the mojo message traits?

          Why do we need specific implementations here?

          Justin Lulejian

          Could you clarify which mojo message traits you think we could use? This [one](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/common/messaging/cloneable_message_mojom_traits.h)?

          Dave Tapuska

          Yes

          Dave Tapuska

          Or why do we need to convert

          third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h

          to/from mojom can't it use
          https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/common/messaging/cloneable_message.h?q=CloneableMessage%20third_party%2Fblink%20-path:out&ss=chromium%2Fchromium%2Fsrc

          Is it layering?

          Justin Lulejian

          Thanks! Was able to use traits, but it required adding some missing includes into third_party/blink/public/common/messaging/cloneable_message_mojom_traits.h and third_party/blink/renderer/platform/blob/serialized_blob_mojom_traits.h to fix compile errors. I moved the impl down to SerializedScriptValue vs WebSerializedScriptValue (and the tests) to keep the current design intact. PTAL.

          Justin Lulejian

          I moved the impl back up to WebSerializedScriptValue from SerializedScriptValue since it balloons the compile-size to add the necessary includes for the mojom traits.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Dave Tapuska
          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: I096288a35b345461c3cd2339632272dc58be10d2
          Gerrit-Change-Number: 7411966
          Gerrit-PatchSet: 23
          Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
          Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
          Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
          Gerrit-CC: Kentaro Hara <har...@chromium.org>
          Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
          Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Comment-Date: Tue, 10 Feb 2026 18:34:40 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy
          Reply all
          Reply to author
          Forward
          0 new messages