Refactor CanvasResource::GetSyncToken() [chromium/src : main]

0 views
Skip to first unread message

AI Code Reviewer (Gerrit)

unread,
Oct 14, 2025, 4:17:25 PM (yesterday) Oct 14
to Mingjing Zhang, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org

AI Code Reviewer added 1 comment

File third_party/blink/renderer/platform/graphics/canvas_resource.h
Line 108, Patchset 1 (Latest): virtual void GetSyncToken() = 0;
AI Code Reviewer . unresolved

nit: Since this function no longer returns a value, its name `GetSyncToken` can be misleading. Consider renaming it to something like `UpdateSyncToken` or `EnsureSyncToken` to better reflect its action of updating internal state. (Blink Style Guide: Naming - Precede setters with the word “Set”; use bare words for getters)

_To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **Won't fix**: reason | **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: I62e12b6168debc97cbc2eb6fdd6322d70f161b94
Gerrit-Change-Number: 7042343
Gerrit-PatchSet: 1
Gerrit-Owner: Mingjing Zhang <mjz...@chromium.org>
Gerrit-Reviewer: Mingjing Zhang <mjz...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Comment-Date: Tue, 14 Oct 2025 20:17:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Mingjing Zhang (Gerrit)

unread,
Oct 14, 2025, 10:49:58 PM (22 hours ago) Oct 14
to AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org

Mingjing Zhang added 1 comment

File third_party/blink/renderer/platform/graphics/canvas_resource.h
Line 108, Patchset 1 (Latest): virtual void GetSyncToken() = 0;
AI Code Reviewer . resolved

nit: Since this function no longer returns a value, its name `GetSyncToken` can be misleading. Consider renaming it to something like `UpdateSyncToken` or `EnsureSyncToken` to better reflect its action of updating internal state. (Blink Style Guide: Naming - Precede setters with the word “Set”; use bare words for getters)

_To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **Won't fix**: reason | **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)_

Mingjing Zhang

Won't fix: `GetSyncToken()` will be renamed to e.g. `EndScopedAccess()` in follow-up CLs soon.

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 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: I62e12b6168debc97cbc2eb6fdd6322d70f161b94
    Gerrit-Change-Number: 7042343
    Gerrit-PatchSet: 1
    Gerrit-Owner: Mingjing Zhang <mjz...@chromium.org>
    Gerrit-Reviewer: Mingjing Zhang <mjz...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-Comment-Date: Wed, 15 Oct 2025 02:49:44 +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

    Mingjing Zhang (Gerrit)

    unread,
    10:07 AM (11 hours ago) 10:07 AM
    to Vasiliy Telezhnikov, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org
    Attention needed from Vasiliy Telezhnikov

    Mingjing Zhang added 3 comments

    File third_party/blink/renderer/platform/graphics/canvas_resource.h
    Line 250, Patchset 1 (Latest): friend class CanvasResourceProviderSharedImage;
    Mingjing Zhang . resolved

    Note: this `friend` declaration is to allow the use of `sync_token()` in `CanvasResourceProviderSharedImage`.

    Line 168, Patchset 1 (Latest): friend class WebGPUMailboxTexture;
    Mingjing Zhang . resolved

    Note: this `friend` declaration is to allow the use of `sync_token()` in `WebGPUMailboxTexture`.

    File third_party/blink/renderer/platform/graphics/canvas_resource_provider_test.cc
    Line 122, Patchset 1 (Latest): void EnsureResourceRecycled(CanvasResourceProvider* provider,
    Mingjing Zhang . resolved

    Note: this function is moved here so that it can call the non-public `resource->sync_token()`.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Vasiliy Telezhnikov
    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: I62e12b6168debc97cbc2eb6fdd6322d70f161b94
    Gerrit-Change-Number: 7042343
    Gerrit-PatchSet: 1
    Gerrit-Owner: Mingjing Zhang <mjz...@chromium.org>
    Gerrit-Reviewer: Mingjing Zhang <mjz...@chromium.org>
    Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-Attention: Vasiliy Telezhnikov <vas...@chromium.org>
    Gerrit-Comment-Date: Wed, 15 Oct 2025 14:06:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Vasiliy Telezhnikov (Gerrit)

    unread,
    10:15 AM (11 hours ago) 10:15 AM
    to Mingjing Zhang, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org
    Attention needed from Mingjing Zhang

    Vasiliy Telezhnikov voted and added 2 comments

    Votes added by Vasiliy Telezhnikov

    Code-Review+1

    2 comments

    Patchset-level comments
    File-level comment, Patchset 1 (Latest):
    Vasiliy Telezhnikov . resolved

    lgtm, thanks.

    File third_party/blink/renderer/platform/graphics/gpu/webgpu_mailbox_texture.cc
    Line 119, Patchset 1 (Latest): canvas_resource->GetSyncToken();
    Vasiliy Telezhnikov . resolved

    (out of the scope here): It's quite unfortunate that we missed this one, before we removed the bool from CR it should have been no-op, because it's not matched with `WillDrawInternal`, so it would never generate one.

    We probably need to remove it (in a follow-up), otherwise we don't have ScopedAccess to pass in here.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mingjing Zhang
    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: I62e12b6168debc97cbc2eb6fdd6322d70f161b94
    Gerrit-Change-Number: 7042343
    Gerrit-PatchSet: 1
    Gerrit-Owner: Mingjing Zhang <mjz...@chromium.org>
    Gerrit-Reviewer: Mingjing Zhang <mjz...@chromium.org>
    Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-Attention: Mingjing Zhang <mjz...@chromium.org>
    Gerrit-Comment-Date: Wed, 15 Oct 2025 14:14:56 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Mingjing Zhang (Gerrit)

    unread,
    10:47 AM (10 hours ago) 10:47 AM
    to Vasiliy Telezhnikov, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org

    Mingjing Zhang added 1 comment

    File third_party/blink/renderer/platform/graphics/gpu/webgpu_mailbox_texture.cc
    Line 119, Patchset 1: canvas_resource->GetSyncToken();
    Vasiliy Telezhnikov . resolved

    (out of the scope here): It's quite unfortunate that we missed this one, before we removed the bool from CR it should have been no-op, because it's not matched with `WillDrawInternal`, so it would never generate one.

    We probably need to remove it (in a follow-up), otherwise we don't have ScopedAccess to pass in here.

    Mingjing Zhang

    Acknowledged. I'll remove it in a follow-up CL.

    Open in Gerrit

    Related details

    Attention set is empty
    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: I62e12b6168debc97cbc2eb6fdd6322d70f161b94
    Gerrit-Change-Number: 7042343
    Gerrit-PatchSet: 2
    Gerrit-Owner: Mingjing Zhang <mjz...@chromium.org>
    Gerrit-Reviewer: Mingjing Zhang <mjz...@chromium.org>
    Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-Comment-Date: Wed, 15 Oct 2025 14:46:57 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Vasiliy Telezhnikov <vas...@chromium.org>
    satisfied_requirement
    open
    diffy

    Mingjing Zhang (Gerrit)

    unread,
    3:30 PM (6 hours ago) 3:30 PM
    to Vasiliy Telezhnikov, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org

    Mingjing Zhang voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention set is empty
    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: I62e12b6168debc97cbc2eb6fdd6322d70f161b94
    Gerrit-Change-Number: 7042343
    Gerrit-PatchSet: 2
    Gerrit-Owner: Mingjing Zhang <mjz...@chromium.org>
    Gerrit-Reviewer: Mingjing Zhang <mjz...@chromium.org>
    Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-Comment-Date: Wed, 15 Oct 2025 19:29:53 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    3:33 PM (6 hours ago) 3:33 PM
    to Mingjing Zhang, Vasiliy Telezhnikov, AI Code Reviewer, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org

    Chromium LUCI CQ submitted the change

    Unreviewed changes

    1 is the latest approved patch-set.
    No files were changed between the latest approved patch-set and the submitted one.

    Change information

    Commit message:
    Refactor CanvasResource::GetSyncToken()

    This CL removes the return value of CanvasResource::GetSyncToken()
    and lets its callers use CanvasResource::sync_token() instead to get
    the sync token. This change is a prerequisite of follow-up changes of
    turning GetSyncToken() into EndScopedAccess().
    Bug: 40286368
    Change-Id: I62e12b6168debc97cbc2eb6fdd6322d70f161b94
    Reviewed-by: Vasiliy Telezhnikov <vas...@chromium.org>
    Commit-Queue: Mingjing Zhang <mjz...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1530395}
    Files:
    • M third_party/blink/renderer/platform/graphics/canvas_resource.cc
    • M third_party/blink/renderer/platform/graphics/canvas_resource.h
    • M third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc
    • M third_party/blink/renderer/platform/graphics/canvas_resource_provider_test.cc
    • M third_party/blink/renderer/platform/graphics/gpu/webgpu_mailbox_texture.cc
    Change size: M
    Delta: 5 files changed, 54 insertions(+), 43 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Vasiliy Telezhnikov
    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: I62e12b6168debc97cbc2eb6fdd6322d70f161b94
    Gerrit-Change-Number: 7042343
    Gerrit-PatchSet: 3
    Gerrit-Owner: Mingjing Zhang <mjz...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Mingjing Zhang <mjz...@chromium.org>
    Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@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