[DOM Storage] Replace string source with StorageAreaSource struct [chromium/src : main]

0 views
Skip to first unread message

Xiaohan Zhao (Gerrit)

unread,
Feb 24, 2026, 2:56:52 PM (9 days ago) Feb 24
to Steve Becker, Evan Stade, Chromium IPC Reviews, Chromium LUCI CQ, Mirko Bonadei, Jerome Jiang, AyeAye, chromium...@chromium.org, extension...@chromium.org, dullweb...@chromium.org, chromium-a...@chromium.org, msrame...@chromium.org, chrome-intelligence-te...@google.com, cblume...@chromium.org, fuzzin...@chromium.org, devtools...@chromium.org, feature-me...@chromium.org, jz...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, mar...@chromium.org, chrome-intell...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, dmurph+watchi...@chromium.org, dmurph+watching...@chromium.org, dmurph+watch...@chromium.org, edgesto...@microsoft.com, ipc-securi...@chromium.org, kinuko...@chromium.org, storage...@chromium.org
Attention needed from Chromium IPC Reviews, Evan Stade and Steve Becker

Xiaohan Zhao added 1 comment

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Xiaohan Zhao . resolved

Hi folks, please take a look when you have time. Thanks in advance for reviewing!

Open in Gerrit

Related details

Attention is currently required from:
  • Chromium IPC Reviews
  • Evan Stade
  • Steve Becker
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: I3cb2a79b41740bad0ca9f8fa60fad807f69c408b
Gerrit-Change-Number: 7597837
Gerrit-PatchSet: 4
Gerrit-Owner: Xiaohan Zhao <xiaoh...@microsoft.com>
Gerrit-Reviewer: Chromium IPC Reviews <chrome-ip...@google.com>
Gerrit-Reviewer: Evan Stade <evan...@microsoft.com>
Gerrit-Reviewer: Steve Becker <ste...@microsoft.com>
Gerrit-Reviewer: Xiaohan Zhao <xiaoh...@microsoft.com>
Gerrit-CC: Jerome Jiang <ji...@chromium.org>
Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
Gerrit-Attention: Evan Stade <evan...@microsoft.com>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Chromium IPC Reviews <chrome-ip...@google.com>
Gerrit-Comment-Date: Tue, 24 Feb 2026 19:56:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

gwsq (Gerrit)

unread,
Feb 24, 2026, 2:59:29 PM (9 days ago) Feb 24
to Xiaohan Zhao, Chromium IPC Reviews, Takashi Toyoshima, Steve Becker, Evan Stade, Chromium LUCI CQ, Mirko Bonadei, Jerome Jiang, AyeAye, chromium...@chromium.org, extension...@chromium.org, dullweb...@chromium.org, chromium-a...@chromium.org, msrame...@chromium.org, chrome-intelligence-te...@google.com, cblume...@chromium.org, fuzzin...@chromium.org, devtools...@chromium.org, feature-me...@chromium.org, jz...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, mar...@chromium.org, chrome-intell...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, dmurph+watchi...@chromium.org, dmurph+watching...@chromium.org, dmurph+watch...@chromium.org, edgesto...@microsoft.com, ipc-securi...@chromium.org, kinuko...@chromium.org, storage...@chromium.org
Attention needed from Evan Stade, Steve Becker and Takashi Toyoshima

Message from gwsq

From googleclient/chrome/chromium_gwsq/ipc/config.gwsq:
IPC: toyo...@chromium.org

📎 It looks like you’re making a possibly security-sensitive change! 📎 IPC security review isn’t a rubberstamp, so your friendly security reviewer will need a fair amount of context to review your CL effectively. Please review your CL description and code comments to make sure they provide context for someone unfamiliar with your project/area. Pay special attention to where data comes from and which processes it flows between (and their privilege levels). Feel free to point your security reviewer at design docs, bugs, or other links if you can’t reasonably make a self-contained CL description. (Also see https://cbea.ms/git-commit/).

IPC reviewer(s): toyo...@chromium.org


Reviewer source(s):
toyo...@chromium.org is from context(googleclient/chrome/chromium_gwsq/ipc/config.gwsq)

Open in Gerrit

Related details

Attention is currently required from:
  • Evan Stade
  • Steve Becker
  • Takashi Toyoshima
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: I3cb2a79b41740bad0ca9f8fa60fad807f69c408b
Gerrit-Change-Number: 7597837
Gerrit-PatchSet: 4
Gerrit-Owner: Xiaohan Zhao <xiaoh...@microsoft.com>
Gerrit-Reviewer: Evan Stade <evan...@microsoft.com>
Gerrit-Reviewer: Steve Becker <ste...@microsoft.com>
Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
Gerrit-Reviewer: Xiaohan Zhao <xiaoh...@microsoft.com>
Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
Gerrit-CC: Jerome Jiang <ji...@chromium.org>
Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
Gerrit-CC: gwsq
Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
Gerrit-Attention: Evan Stade <evan...@microsoft.com>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Comment-Date: Tue, 24 Feb 2026 19:59:05 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Evan Stade (Gerrit)

unread,
Feb 24, 2026, 5:19:52 PM (9 days ago) Feb 24
to Xiaohan Zhao, Chromium IPC Reviews, Takashi Toyoshima, Steve Becker, Chromium LUCI CQ, Mirko Bonadei, Jerome Jiang, AyeAye, chromium...@chromium.org, extension...@chromium.org, dullweb...@chromium.org, chromium-a...@chromium.org, msrame...@chromium.org, chrome-intelligence-te...@google.com, cblume...@chromium.org, fuzzin...@chromium.org, devtools...@chromium.org, feature-me...@chromium.org, jz...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, mar...@chromium.org, chrome-intell...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, dmurph+watchi...@chromium.org, dmurph+watching...@chromium.org, dmurph+watch...@chromium.org, edgesto...@microsoft.com, ipc-securi...@chromium.org, kinuko...@chromium.org, storage...@chromium.org
Attention needed from Steve Becker, Takashi Toyoshima and Xiaohan Zhao

Evan Stade added 2 comments

File third_party/blink/public/mojom/dom_storage/storage_area.mojom
Line 100, Patchset 4 (Latest): StorageAreaSource source)
Evan Stade . unresolved

probably ideal for all of these to be optional, i.e. `StorageAreaSource?`, since there are cases where we're passing an empty value.

File third_party/blink/renderer/modules/storage/cached_storage_area.cc
Line 177, Patchset 4 (Latest): String id = String::Number(base::RandUint64());
Evan Stade . unresolved

so while we're at it can we make this a `base::Token`? (In some cases one might want to use an `UnguessableToken`, but here we explicitly do not need use this for security, instead relying on the mojo pipes between renderer and browser to correctly direct information, so it's better not to imply the unguessable nature of the token is a security measure.)

Open in Gerrit

Related details

Attention is currently required from:
  • Steve Becker
  • Takashi Toyoshima
  • Xiaohan Zhao
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: I3cb2a79b41740bad0ca9f8fa60fad807f69c408b
    Gerrit-Change-Number: 7597837
    Gerrit-PatchSet: 4
    Gerrit-Owner: Xiaohan Zhao <xiaoh...@microsoft.com>
    Gerrit-Reviewer: Evan Stade <evan...@microsoft.com>
    Gerrit-Reviewer: Steve Becker <ste...@microsoft.com>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Reviewer: Xiaohan Zhao <xiaoh...@microsoft.com>
    Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
    Gerrit-CC: Jerome Jiang <ji...@chromium.org>
    Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
    Gerrit-CC: gwsq
    Gerrit-Attention: Xiaohan Zhao <xiaoh...@microsoft.com>
    Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Attention: Steve Becker <ste...@microsoft.com>
    Gerrit-Comment-Date: Tue, 24 Feb 2026 22:19:44 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Evan Stade (Gerrit)

    unread,
    Feb 24, 2026, 5:19:59 PM (9 days ago) Feb 24
    to Xiaohan Zhao, Chromium IPC Reviews, Takashi Toyoshima, Steve Becker, Chromium LUCI CQ, Mirko Bonadei, Jerome Jiang, AyeAye, chromium...@chromium.org, extension...@chromium.org, dullweb...@chromium.org, chromium-a...@chromium.org, msrame...@chromium.org, chrome-intelligence-te...@google.com, cblume...@chromium.org, fuzzin...@chromium.org, devtools...@chromium.org, feature-me...@chromium.org, jz...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, mar...@chromium.org, chrome-intell...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, dmurph+watchi...@chromium.org, dmurph+watching...@chromium.org, dmurph+watch...@chromium.org, edgesto...@microsoft.com, ipc-securi...@chromium.org, kinuko...@chromium.org, storage...@chromium.org
    Attention needed from Steve Becker, Takashi Toyoshima and Xiaohan Zhao

    Evan Stade added 1 comment

    Patchset-level comments
    Evan Stade . resolved

    and thanks for doing this!

    Gerrit-Comment-Date: Tue, 24 Feb 2026 22:19:53 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Xiaohan Zhao (Gerrit)

    unread,
    Feb 27, 2026, 2:24:39 PM (6 days ago) Feb 27
    to Chromium IPC Reviews, Takashi Toyoshima, Steve Becker, Evan Stade, Chromium LUCI CQ, Mirko Bonadei, Jerome Jiang, AyeAye, chromium...@chromium.org, extension...@chromium.org, dullweb...@chromium.org, chromium-a...@chromium.org, msrame...@chromium.org, chrome-intelligence-te...@google.com, cblume...@chromium.org, fuzzin...@chromium.org, devtools...@chromium.org, feature-me...@chromium.org, jz...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, mar...@chromium.org, chrome-intell...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, dmurph+watchi...@chromium.org, dmurph+watching...@chromium.org, dmurph+watch...@chromium.org, edgesto...@microsoft.com, ipc-securi...@chromium.org, kinuko...@chromium.org, storage...@chromium.org
    Attention needed from Evan Stade, Steve Becker and Takashi Toyoshima

    Xiaohan Zhao added 2 comments

    File third_party/blink/public/mojom/dom_storage/storage_area.mojom
    Line 100, Patchset 4: StorageAreaSource source)
    Evan Stade . resolved

    probably ideal for all of these to be optional, i.e. `StorageAreaSource?`, since there are cases where we're passing an empty value.

    Xiaohan Zhao

    Done

    File third_party/blink/renderer/modules/storage/cached_storage_area.cc
    Line 177, Patchset 4: String id = String::Number(base::RandUint64());
    Evan Stade . resolved

    so while we're at it can we make this a `base::Token`? (In some cases one might want to use an `UnguessableToken`, but here we explicitly do not need use this for security, instead relying on the mojo pipes between renderer and browser to correctly direct information, so it's better not to imply the unguessable nature of the token is a security measure.)

    Xiaohan Zhao

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Evan Stade
    • Steve Becker
    • Takashi Toyoshima
    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: I3cb2a79b41740bad0ca9f8fa60fad807f69c408b
      Gerrit-Change-Number: 7597837
      Gerrit-PatchSet: 6
      Gerrit-Owner: Xiaohan Zhao <xiaoh...@microsoft.com>
      Gerrit-Reviewer: Evan Stade <evan...@microsoft.com>
      Gerrit-Reviewer: Steve Becker <ste...@microsoft.com>
      Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
      Gerrit-Reviewer: Xiaohan Zhao <xiaoh...@microsoft.com>
      Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-CC: Jerome Jiang <ji...@chromium.org>
      Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
      Gerrit-CC: gwsq
      Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
      Gerrit-Attention: Evan Stade <evan...@microsoft.com>
      Gerrit-Attention: Steve Becker <ste...@microsoft.com>
      Gerrit-Comment-Date: Fri, 27 Feb 2026 19:24:33 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Evan Stade <evan...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Evan Stade (Gerrit)

      unread,
      Feb 27, 2026, 3:15:42 PM (6 days ago) Feb 27
      to Xiaohan Zhao, Chromium IPC Reviews, Takashi Toyoshima, Steve Becker, Chromium LUCI CQ, Mirko Bonadei, Jerome Jiang, AyeAye, chromium...@chromium.org, extension...@chromium.org, dullweb...@chromium.org, chromium-a...@chromium.org, msrame...@chromium.org, chrome-intelligence-te...@google.com, cblume...@chromium.org, fuzzin...@chromium.org, devtools...@chromium.org, feature-me...@chromium.org, jz...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, mar...@chromium.org, chrome-intell...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, dmurph+watchi...@chromium.org, dmurph+watching...@chromium.org, dmurph+watch...@chromium.org, edgesto...@microsoft.com, ipc-securi...@chromium.org, kinuko...@chromium.org, storage...@chromium.org
      Attention needed from Steve Becker, Takashi Toyoshima and Xiaohan Zhao

      Evan Stade added 1 comment

      File third_party/blink/renderer/modules/storage/cached_storage_area.cc
      Line 177, Patchset 4: String id = String::Number(base::RandUint64());
      Evan Stade . unresolved

      so while we're at it can we make this a `base::Token`? (In some cases one might want to use an `UnguessableToken`, but here we explicitly do not need use this for security, instead relying on the mojo pipes between renderer and browser to correctly direct information, so it's better not to imply the unguessable nature of the token is a security measure.)

      Xiaohan Zhao

      Done

      Evan Stade

      Sorry, I meant to use `Token` throughout code, not just to generate a string. `Token` has native mojom support, `mojo_base.mojom.Token`.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Steve Becker
      • Takashi Toyoshima
      • Xiaohan Zhao
      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: I3cb2a79b41740bad0ca9f8fa60fad807f69c408b
        Gerrit-Change-Number: 7597837
        Gerrit-PatchSet: 6
        Gerrit-Owner: Xiaohan Zhao <xiaoh...@microsoft.com>
        Gerrit-Reviewer: Evan Stade <evan...@microsoft.com>
        Gerrit-Reviewer: Steve Becker <ste...@microsoft.com>
        Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
        Gerrit-Reviewer: Xiaohan Zhao <xiaoh...@microsoft.com>
        Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
        Gerrit-CC: Jerome Jiang <ji...@chromium.org>
        Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
        Gerrit-CC: gwsq
        Gerrit-Attention: Xiaohan Zhao <xiaoh...@microsoft.com>
        Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
        Gerrit-Attention: Steve Becker <ste...@microsoft.com>
        Gerrit-Comment-Date: Fri, 27 Feb 2026 20:15:36 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Xiaohan Zhao <xiaoh...@microsoft.com>
        Comment-In-Reply-To: Evan Stade <evan...@microsoft.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Takashi Toyoshima (Gerrit)

        unread,
        Mar 1, 2026, 11:44:55 PM (4 days ago) Mar 1
        to Xiaohan Zhao, Chromium IPC Reviews, Steve Becker, Evan Stade, Chromium LUCI CQ, Mirko Bonadei, Jerome Jiang, AyeAye, chromium...@chromium.org, extension...@chromium.org, dullweb...@chromium.org, chromium-a...@chromium.org, msrame...@chromium.org, chrome-intelligence-te...@google.com, cblume...@chromium.org, fuzzin...@chromium.org, devtools...@chromium.org, feature-me...@chromium.org, jz...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, mar...@chromium.org, chrome-intell...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, dmurph+watchi...@chromium.org, dmurph+watching...@chromium.org, dmurph+watch...@chromium.org, edgesto...@microsoft.com, ipc-securi...@chromium.org, kinuko...@chromium.org, storage...@chromium.org
        Attention needed from Steve Becker and Xiaohan Zhao

        Takashi Toyoshima added 3 comments

        File third_party/blink/public/mojom/dom_storage/storage_area.mojom
        Line 19, Patchset 6 (Latest): // null, the key was newly added and had no previous value stored. `source`
        // is null when the mutation was not initiated by a specific page (e.g.
        // browser-initiated or internal reconciliation).
        Takashi Toyoshima . unresolved

        As this seems relevant to other methods below, we may have this part in the interface comment?

        Line 52, Patchset 6 (Latest):// Identifies the source of a storage mutation for observer notifications.
        Takashi Toyoshima . unresolved

        This can compile, but it may be nicer to declare before the first use above.

        Line 62, Patchset 6 (Latest):// store.
        Takashi Toyoshima . unresolved

        Let's add an explanation on the nullability of the `source` parameter.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Steve Becker
        • Xiaohan Zhao
        Gerrit-Attention: Steve Becker <ste...@microsoft.com>
        Gerrit-Comment-Date: Mon, 02 Mar 2026 04:44:30 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Takashi Toyoshima (Gerrit)

        unread,
        Mar 2, 2026, 12:36:39 AM (4 days ago) Mar 2
        to Xiaohan Zhao, Chromium IPC Reviews, Steve Becker, Evan Stade, Chromium LUCI CQ, Mirko Bonadei, Jerome Jiang, AyeAye, chromium...@chromium.org, extension...@chromium.org, dullweb...@chromium.org, chromium-a...@chromium.org, msrame...@chromium.org, chrome-intelligence-te...@google.com, cblume...@chromium.org, fuzzin...@chromium.org, devtools...@chromium.org, feature-me...@chromium.org, jz...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, mar...@chromium.org, chrome-intell...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, dmurph+watchi...@chromium.org, dmurph+watching...@chromium.org, dmurph+watch...@chromium.org, edgesto...@microsoft.com, ipc-securi...@chromium.org, kinuko...@chromium.org, storage...@chromium.org
        Attention needed from Steve Becker and Xiaohan Zhao

        Takashi Toyoshima added 1 comment

        File third_party/blink/renderer/modules/storage/cached_storage_area.cc
        Line 178, Patchset 6 (Latest): String id = String(base::Token::CreateRandom().ToString());
        Takashi Toyoshima . unresolved

        We may clarify this change in the CL description?

        Another question is shall we use base::UnguessableToken that can be mapped to mojom_base.UnguessableToken directly rather than using string in Mojo.

        Gerrit-Comment-Date: Mon, 02 Mar 2026 05:36:31 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Xiaohan Zhao (Gerrit)

        unread,
        Mar 3, 2026, 7:44:49 PM (2 days ago) Mar 3
        to Chromium IPC Reviews, Takashi Toyoshima, Steve Becker, Evan Stade, Chromium LUCI CQ, Mirko Bonadei, Jerome Jiang, AyeAye, chromium...@chromium.org, extension...@chromium.org, dullweb...@chromium.org, chromium-a...@chromium.org, msrame...@chromium.org, chrome-intelligence-te...@google.com, cblume...@chromium.org, fuzzin...@chromium.org, devtools...@chromium.org, feature-me...@chromium.org, jz...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, mar...@chromium.org, chrome-intell...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, dmurph+watchi...@chromium.org, dmurph+watching...@chromium.org, dmurph+watch...@chromium.org, edgesto...@microsoft.com, ipc-securi...@chromium.org, kinuko...@chromium.org, storage...@chromium.org
        Attention needed from Evan Stade, Steve Becker and Takashi Toyoshima

        Xiaohan Zhao added 6 comments

        Patchset-level comments
        File-level comment, Patchset 7 (Latest):
        Xiaohan Zhao . resolved

        Thanks for the review!

        File third_party/blink/public/mojom/dom_storage/storage_area.mojom
        Line 19, Patchset 6: // null, the key was newly added and had no previous value stored. `source`

        // is null when the mutation was not initiated by a specific page (e.g.
        // browser-initiated or internal reconciliation).
        Takashi Toyoshima . resolved

        As this seems relevant to other methods below, we may have this part in the interface comment?

        Xiaohan Zhao

        Done

        Line 52, Patchset 6:// Identifies the source of a storage mutation for observer notifications.
        Takashi Toyoshima . resolved

        This can compile, but it may be nicer to declare before the first use above.

        Xiaohan Zhao

        Done

        Line 62, Patchset 6:// store.
        Takashi Toyoshima . resolved

        Let's add an explanation on the nullability of the `source` parameter.

        Xiaohan Zhao

        Done

        File third_party/blink/renderer/modules/storage/cached_storage_area.cc
        Line 177, Patchset 4: String id = String::Number(base::RandUint64());
        Evan Stade . resolved

        so while we're at it can we make this a `base::Token`? (In some cases one might want to use an `UnguessableToken`, but here we explicitly do not need use this for security, instead relying on the mojo pipes between renderer and browser to correctly direct information, so it's better not to imply the unguessable nature of the token is a security measure.)

        Xiaohan Zhao

        Done

        Evan Stade

        Sorry, I meant to use `Token` throughout code, not just to generate a string. `Token` has native mojom support, `mojo_base.mojom.Token`.

        Xiaohan Zhao

        Sorry I misunderstood it. Updated. Thank you!

        Line 178, Patchset 6: String id = String(base::Token::CreateRandom().ToString());
        Takashi Toyoshima . resolved

        We may clarify this change in the CL description?

        Another question is shall we use base::UnguessableToken that can be mapped to mojom_base.UnguessableToken directly rather than using string in Mojo.

        Xiaohan Zhao

        I've updated String with `base::Token` since this ID is not a security token and the mojo pipe already provides the security boundary, so the token doesn't need to be unguessable. But thanks for the suggestion!

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Evan Stade
        • Steve Becker
        • Takashi Toyoshima
        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: I3cb2a79b41740bad0ca9f8fa60fad807f69c408b
          Gerrit-Change-Number: 7597837
          Gerrit-PatchSet: 7
          Gerrit-Owner: Xiaohan Zhao <xiaoh...@microsoft.com>
          Gerrit-Reviewer: Evan Stade <evan...@microsoft.com>
          Gerrit-Reviewer: Steve Becker <ste...@microsoft.com>
          Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
          Gerrit-Reviewer: Xiaohan Zhao <xiaoh...@microsoft.com>
          Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
          Gerrit-CC: Jerome Jiang <ji...@chromium.org>
          Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
          Gerrit-CC: gwsq
          Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
          Gerrit-Attention: Evan Stade <evan...@microsoft.com>
          Gerrit-Attention: Steve Becker <ste...@microsoft.com>
          Gerrit-Comment-Date: Wed, 04 Mar 2026 00:44:41 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Takashi Toyoshima <toyo...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Steve Becker (Gerrit)

          unread,
          Mar 4, 2026, 5:11:23 PM (yesterday) Mar 4
          to Xiaohan Zhao, Chromium IPC Reviews, Takashi Toyoshima, Evan Stade, Chromium LUCI CQ, Mirko Bonadei, Jerome Jiang, AyeAye, chromium...@chromium.org, extension...@chromium.org, dullweb...@chromium.org, chromium-a...@chromium.org, msrame...@chromium.org, chrome-intelligence-te...@google.com, cblume...@chromium.org, fuzzin...@chromium.org, devtools...@chromium.org, feature-me...@chromium.org, jz...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, mar...@chromium.org, chrome-intell...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, dmurph+watchi...@chromium.org, dmurph+watching...@chromium.org, dmurph+watch...@chromium.org, edgesto...@microsoft.com, ipc-securi...@chromium.org, kinuko...@chromium.org, storage...@chromium.org
          Attention needed from Evan Stade, Takashi Toyoshima and Xiaohan Zhao

          Steve Becker added 9 comments

          Patchset-level comments
          File-level comment, Patchset 8 (Latest):
          Steve Becker . resolved

          Thanks for this cleanup. I'm still reviewing the tests, but here are some initial comments.

          File third_party/blink/renderer/modules/storage/cached_storage_area.h
          Line 234, Patchset 8 (Latest): // StorageAreaObserver events. This map is keyed by storage_area_id (a unique
          Steve Becker . unresolved

          nit: this does not map to any variable or code in this file.

          Line 198, Patchset 8 (Latest): const base::Token& storage_area_id);
          Steve Becker . unresolved

          nit: I think the new name loses some meaning without source. Including source in the name makes it very clear that it is the source of the mutation.

          Same applies to `pending_mutations_by_source_` member.

          Line 51, Patchset 8 (Latest):// An in-process implementation of LocalStorage using a LevelDB Mojo service.
          Steve Becker . unresolved

          Thanks for cleaning up this comment. Can we also remove this reference to LevelDB?

          Line 36, Patchset 8 (Latest): // base::Token() is all-zero, matching the zero-initialized empty slot.
          static constexpr bool kEmptyValueIsZero = true;
          // Use the all-ones token as the deleted-value sentinel.
          static void ConstructDeletedValue(base::Token& slot) {
          slot = base::Token(std::numeric_limits<uint64_t>::max(),
          std::numeric_limits<uint64_t>::max());
          }
          static bool IsDeletedValue(const base::Token& token) {
          return token.high() == std::numeric_limits<uint64_t>::max() &&
          token.low() == std::numeric_limits<uint64_t>::max();
          }
          Steve Becker . unresolved

          nit: Can we implement DeletedValue() instead of ConstructDeletedValue() and IsDeletedValue()?

          See the comment above DeletedValue() here:

          https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/wtf/hash_traits.h;drc=c026b8dc3b0f14e246aa11ad81f7958e8b1b7dd8;l=151

          Line 33, Patchset 8 (Latest): return HashInts(static_cast<unsigned>(token.high()),
          Steve Becker . unresolved

          This cast will truncate the 64-bit token.high(), reducing it to 32-bit. To hash the entire token, we need to call HashInt() on the first 32-bits of the token. Afterwards, we need to call AddIntToHash() on the remaining three 32-bit parts of the token.

          See:

          [1] HashInt()

          https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/wtf/hash_functions.h;bpv=1;bpt=1;l=63?q=HashInts%20filepath:third_party%2Fblink&ss=chromium%2Fchromium%2Fsrc

          [2] AddIntToHash()

          https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/wtf/hash_functions.h;drc=0087ec9e7fe00858d46c7906fb10c6a24d21bd62;l=146

          File third_party/blink/renderer/modules/storage/cached_storage_area.cc
          Line 95, Patchset 8 (Latest): auto mojo_source =
          Steve Becker . unresolved

          nit: mojo does not describe this variable since mojo is used everywhere to communicate between processes and threads. Maybe we should use something like `storage_area_source` or `source_url_and_id` instead?

          Same applies below.

          Line 522, Patchset 8 (Latest): const base::Token& storage_area_id) {
          Steve Becker . unresolved

          Can/should we check assert that storage_area_id is not 0?

          Line 546, Patchset 8 (Latest): // A zero token means no source (browser-initiated mutation), so there can't
          // be a matching pending local mutation. Also, base::Token() is the
          // empty-bucket sentinel in the HashMap, so we must not look it up.
          if (storage_area_id.is_zero()) {
          return nullptr;
          }
          Steve Becker . unresolved

          Are these lines necessary? Should searching for a zero token return the end iterator below instead?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Evan Stade
          • Takashi Toyoshima
          • Xiaohan Zhao
          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: I3cb2a79b41740bad0ca9f8fa60fad807f69c408b
            Gerrit-Change-Number: 7597837
            Gerrit-PatchSet: 8
            Gerrit-Owner: Xiaohan Zhao <xiaoh...@microsoft.com>
            Gerrit-Reviewer: Evan Stade <evan...@microsoft.com>
            Gerrit-Reviewer: Steve Becker <ste...@microsoft.com>
            Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
            Gerrit-Reviewer: Xiaohan Zhao <xiaoh...@microsoft.com>
            Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
            Gerrit-CC: Jerome Jiang <ji...@chromium.org>
            Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
            Gerrit-CC: gwsq
            Gerrit-Attention: Xiaohan Zhao <xiaoh...@microsoft.com>
            Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
            Gerrit-Attention: Evan Stade <evan...@microsoft.com>
            Gerrit-Comment-Date: Wed, 04 Mar 2026 22:11:13 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Evan Stade (Gerrit)

            unread,
            Mar 4, 2026, 8:09:27 PM (21 hours ago) Mar 4
            to Xiaohan Zhao, Chromium IPC Reviews, Takashi Toyoshima, Steve Becker, Chromium LUCI CQ, Mirko Bonadei, Jerome Jiang, AyeAye, chromium...@chromium.org, extension...@chromium.org, dullweb...@chromium.org, chromium-a...@chromium.org, msrame...@chromium.org, chrome-intelligence-te...@google.com, cblume...@chromium.org, fuzzin...@chromium.org, devtools...@chromium.org, feature-me...@chromium.org, jz...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, mar...@chromium.org, chrome-intell...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, dmurph+watchi...@chromium.org, dmurph+watching...@chromium.org, dmurph+watch...@chromium.org, edgesto...@microsoft.com, ipc-securi...@chromium.org, kinuko...@chromium.org, storage...@chromium.org
            Attention needed from Takashi Toyoshima and Xiaohan Zhao

            Evan Stade added 1 comment

            File third_party/blink/renderer/modules/storage/cached_storage_area.h
            Line 33, Patchset 8 (Latest): return HashInts(static_cast<unsigned>(token.high()),
            Steve Becker . unresolved

            This cast will truncate the 64-bit token.high(), reducing it to 32-bit. To hash the entire token, we need to call HashInt() on the first 32-bits of the token. Afterwards, we need to call AddIntToHash() on the remaining three 32-bit parts of the token.

            See:

            [1] HashInt()

            https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/wtf/hash_functions.h;bpv=1;bpt=1;l=63?q=HashInts%20filepath:third_party%2Fblink&ss=chromium%2Fchromium%2Fsrc

            [2] AddIntToHash()

            https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/wtf/hash_functions.h;drc=0087ec9e7fe00858d46c7906fb10c6a24d21bd62;l=146

            Evan Stade

            Bit unfortunate we are not allowed to just use absl::flat_hash_map (for reasons that aren't that well explained in the documentation). I see a good deal of `base::flat_map` and `std::map` in Blink, even though they are supposed discouraged? I think it's worth seeking an exception here to avoid this complexity. Would also be good to understand what the tradeoffs actually are.

            Failing that, I would still bail on this added complexity and use the stringified token for the key.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Takashi Toyoshima
            • Xiaohan Zhao
            Gerrit-Comment-Date: Thu, 05 Mar 2026 01:09:19 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Steve Becker <ste...@microsoft.com>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Takashi Toyoshima (Gerrit)

            unread,
            12:30 AM (17 hours ago) 12:30 AM
            to Xiaohan Zhao, Chromium IPC Reviews, Steve Becker, Evan Stade, Chromium LUCI CQ, Mirko Bonadei, Jerome Jiang, AyeAye, chromium...@chromium.org, extension...@chromium.org, dullweb...@chromium.org, chromium-a...@chromium.org, msrame...@chromium.org, chrome-intelligence-te...@google.com, cblume...@chromium.org, fuzzin...@chromium.org, devtools...@chromium.org, feature-me...@chromium.org, jz...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, mar...@chromium.org, chrome-intell...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, dmurph+watchi...@chromium.org, dmurph+watching...@chromium.org, dmurph+watch...@chromium.org, edgesto...@microsoft.com, ipc-securi...@chromium.org, kinuko...@chromium.org, storage...@chromium.org
            Attention needed from Xiaohan Zhao

            Takashi Toyoshima voted Code-Review+1

            Code-Review+1
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Xiaohan Zhao
            Gerrit-Comment-Date: Thu, 05 Mar 2026 05:30:28 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Evan Stade (Gerrit)

            unread,
            10:34 AM (7 hours ago) 10:34 AM
            to Xiaohan Zhao, Takashi Toyoshima, Chromium IPC Reviews, Steve Becker, Chromium LUCI CQ, Mirko Bonadei, Jerome Jiang, AyeAye, chromium...@chromium.org, extension...@chromium.org, dullweb...@chromium.org, chromium-a...@chromium.org, msrame...@chromium.org, chrome-intelligence-te...@google.com, cblume...@chromium.org, fuzzin...@chromium.org, devtools...@chromium.org, feature-me...@chromium.org, jz...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, mar...@chromium.org, chrome-intell...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, dmurph+watchi...@chromium.org, dmurph+watching...@chromium.org, dmurph+watch...@chromium.org, edgesto...@microsoft.com, ipc-securi...@chromium.org, kinuko...@chromium.org, storage...@chromium.org
            Attention needed from Xiaohan Zhao

            Evan Stade added 1 comment

            File third_party/blink/renderer/modules/storage/cached_storage_area.h
            Line 33, Patchset 8 (Latest): return HashInts(static_cast<unsigned>(token.high()),
            Steve Becker . unresolved

            This cast will truncate the 64-bit token.high(), reducing it to 32-bit. To hash the entire token, we need to call HashInt() on the first 32-bits of the token. Afterwards, we need to call AddIntToHash() on the remaining three 32-bit parts of the token.

            See:

            [1] HashInt()

            https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/wtf/hash_functions.h;bpv=1;bpt=1;l=63?q=HashInts%20filepath:third_party%2Fblink&ss=chromium%2Fchromium%2Fsrc

            [2] AddIntToHash()

            https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/wtf/hash_functions.h;drc=0087ec9e7fe00858d46c7906fb10c6a24d21bd62;l=146

            Evan Stade

            Bit unfortunate we are not allowed to just use absl::flat_hash_map (for reasons that aren't that well explained in the documentation). I see a good deal of `base::flat_map` and `std::map` in Blink, even though they are supposed discouraged? I think it's worth seeking an exception here to avoid this complexity. Would also be good to understand what the tradeoffs actually are.

            Failing that, I would still bail on this added complexity and use the stringified token for the key.

            Gerrit-Comment-Date: Thu, 05 Mar 2026 15:34:26 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Evan Stade <evan...@microsoft.com>
            Comment-In-Reply-To: Steve Becker <ste...@microsoft.com>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Evan Stade (Gerrit)

            unread,
            11:30 AM (6 hours ago) 11:30 AM
            to Xiaohan Zhao, Takashi Toyoshima, Chromium IPC Reviews, Steve Becker, Chromium LUCI CQ, Mirko Bonadei, Jerome Jiang, AyeAye, chromium...@chromium.org, extension...@chromium.org, dullweb...@chromium.org, chromium-a...@chromium.org, msrame...@chromium.org, chrome-intelligence-te...@google.com, cblume...@chromium.org, fuzzin...@chromium.org, devtools...@chromium.org, feature-me...@chromium.org, jz...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, mar...@chromium.org, chrome-intell...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, dmurph+watchi...@chromium.org, dmurph+watching...@chromium.org, dmurph+watch...@chromium.org, edgesto...@microsoft.com, ipc-securi...@chromium.org, kinuko...@chromium.org, storage...@chromium.org
            Attention needed from Xiaohan Zhao

            Evan Stade added 1 comment

            File third_party/blink/renderer/modules/storage/cached_storage_area.h
            Line 33, Patchset 8 (Latest): return HashInts(static_cast<unsigned>(token.high()),
            Steve Becker . unresolved

            This cast will truncate the 64-bit token.high(), reducing it to 32-bit. To hash the entire token, we need to call HashInt() on the first 32-bits of the token. Afterwards, we need to call AddIntToHash() on the remaining three 32-bit parts of the token.

            See:

            [1] HashInt()

            https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/wtf/hash_functions.h;bpv=1;bpt=1;l=63?q=HashInts%20filepath:third_party%2Fblink&ss=chromium%2Fchromium%2Fsrc

            [2] AddIntToHash()

            https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/wtf/hash_functions.h;drc=0087ec9e7fe00858d46c7906fb10c6a24d21bd62;l=146

            Evan Stade

            Bit unfortunate we are not allowed to just use absl::flat_hash_map (for reasons that aren't that well explained in the documentation). I see a good deal of `base::flat_map` and `std::map` in Blink, even though they are supposed discouraged? I think it's worth seeking an exception here to avoid this complexity. Would also be good to understand what the tradeoffs actually are.

            Failing that, I would still bail on this added complexity and use the stringified token for the key.

            Evan Stade

            I asked this question here: https://chromium.slack.com/archives/CGJNSDHA7/p1772724774596959

            Evan Stade

            Seems like folks thinks it's ok to use some non-Blink container such as `absl::flat_hash_map` since the map's value is not a GCed type, although we'll still need to update `audit_non_blink_usage.py` (and also use `ALLOW_DISCOURAGED_TYPE`?) which triggers a final approval.

            Gerrit-Comment-Date: Thu, 05 Mar 2026 16:29:46 +0000
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages