Propagate AvatarIconType from ProfileAttributesEntry::GetAvatarIcon() [chromium/src : main]

0 views
Skip to first unread message

qian zhuoyu (Gerrit)

unread,
Feb 27, 2026, 10:35:27 AM (15 hours ago) Feb 27
to Nicolas Dossou-Gbété, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Nicolas Dossou-Gbété

qian zhuoyu added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
qian zhuoyu . resolved

Hi Nicolas,
This change is from the comment of last commit (https://chromium-review.googlesource.com/c/chromium/src/+/7587374/comment/b15464f6_2326cf94/).
Could you please have a look at it?
Thank you!

Open in Gerrit

Related details

Attention is currently required from:
  • Nicolas Dossou-Gbété
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: I9c76595b666699abf8c4372d130360abdef4bb9b
Gerrit-Change-Number: 7613510
Gerrit-PatchSet: 1
Gerrit-Owner: qian zhuoyu <zhuoy...@microsoft.com>
Gerrit-Reviewer: Nicolas Dossou-Gbété <d...@chromium.org>
Gerrit-Reviewer: qian zhuoyu <zhuoy...@microsoft.com>
Gerrit-Attention: Nicolas Dossou-Gbété <d...@chromium.org>
Gerrit-Comment-Date: Fri, 27 Feb 2026 15:34:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Nicolas Dossou-Gbété (Gerrit)

unread,
Feb 27, 2026, 11:51:26 AM (14 hours ago) Feb 27
to qian zhuoyu, Ryan Sultanem, David Roger, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from David Roger, Ryan Sultanem and qian zhuoyu

Nicolas Dossou-Gbété voted and added 3 comments

Votes added by Nicolas Dossou-Gbété

Code-Review+1

3 comments

Patchset-level comments
Nicolas Dossou-Gbété . resolved

Thanks for the quick follow-up!

File chrome/browser/profiles/profile_attributes_entry.cc
Line 359, Patchset 1 (Latest):gfx::Image ProfileAttributesEntry::GetAvatarIcon(
Nicolas Dossou-Gbété . unresolved

opening a can of worms maybe but... @rs...@google.com or @dro...@chromium.org I see that the functions called here are returning pointers or references, and generally keep the image itself in a map in a resource bundle... so we'd be making copies of the image by returning it here right? Is that an issue?

Line 377, Patchset 1 (Latest): if (image)
Nicolas Dossou-Gbété . unresolved

nit: add braces please, and ditto in other places in this function where we use brace-less `if`. ([styleguide](https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++.md#:~:text=Use%20%7B%7D%20on%20all%20conditionals/loops)). Or we could also do

```suggestion
if (const gfx::Image* image = GetGAIAPicture()) {
```
Open in Gerrit

Related details

Attention is currently required from:
  • David Roger
  • Ryan Sultanem
  • qian zhuoyu
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: I9c76595b666699abf8c4372d130360abdef4bb9b
Gerrit-Change-Number: 7613510
Gerrit-PatchSet: 1
Gerrit-Owner: qian zhuoyu <zhuoy...@microsoft.com>
Gerrit-Reviewer: Nicolas Dossou-Gbété <d...@chromium.org>
Gerrit-Reviewer: Ryan Sultanem <rs...@google.com>
Gerrit-Reviewer: qian zhuoyu <zhuoy...@microsoft.com>
Gerrit-CC: David Roger <dro...@chromium.org>
Gerrit-Attention: David Roger <dro...@chromium.org>
Gerrit-Attention: qian zhuoyu <zhuoy...@microsoft.com>
Gerrit-Attention: Ryan Sultanem <rs...@google.com>
Gerrit-Comment-Date: Fri, 27 Feb 2026 16:51:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

qian zhuoyu (Gerrit)

unread,
Feb 27, 2026, 9:18:36 PM (5 hours ago) Feb 27
to Ryan Sultanem, Nicolas Dossou-Gbété, David Roger, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from David Roger, Nicolas Dossou-Gbété and Ryan Sultanem

qian zhuoyu added 3 comments

Patchset-level comments
File-level comment, Patchset 2 (Latest):
qian zhuoyu . resolved

Thanks for reviewing!

File chrome/browser/profiles/profile_attributes_entry.cc
Line 359, Patchset 1:gfx::Image ProfileAttributesEntry::GetAvatarIcon(
Nicolas Dossou-Gbété . unresolved

opening a can of worms maybe but... @rs...@google.com or @dro...@chromium.org I see that the functions called here are returning pointers or references, and generally keep the image itself in a map in a resource bundle... so we'd be making copies of the image by returning it here right? Is that an issue?

qian zhuoyu

Good question! gfx::Image uses a refcounted backing store internally (ImageSkia → ImageSkiaStorage, which inherits from base::RefCountedThreadSafe), so I believe copying a gfx::Image just bumps the refcount rather than duplicating any pixel data. The cost should be trivial.

In my opinion this shouldn't be a concern here — GetAvatarIcon() was already returning gfx::Image by value before this change, so this isn't new behavior we're introducing.

Line 377, Patchset 1: if (image)
Nicolas Dossou-Gbété . resolved

nit: add braces please, and ditto in other places in this function where we use brace-less `if`. ([styleguide](https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++.md#:~:text=Use%20%7B%7D%20on%20all%20conditionals/loops)). Or we could also do

```suggestion
if (const gfx::Image* image = GetGAIAPicture()) {
```
qian zhuoyu

Done

Open in Gerrit

Related details

Attention is currently required from:
  • David Roger
  • Nicolas Dossou-Gbété
  • Ryan Sultanem
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: I9c76595b666699abf8c4372d130360abdef4bb9b
Gerrit-Change-Number: 7613510
Gerrit-PatchSet: 2
Gerrit-Owner: qian zhuoyu <zhuoy...@microsoft.com>
Gerrit-Reviewer: Nicolas Dossou-Gbété <d...@chromium.org>
Gerrit-Reviewer: Ryan Sultanem <rs...@google.com>
Gerrit-Reviewer: qian zhuoyu <zhuoy...@microsoft.com>
Gerrit-CC: David Roger <dro...@chromium.org>
Gerrit-Attention: David Roger <dro...@chromium.org>
Gerrit-Attention: Nicolas Dossou-Gbété <d...@chromium.org>
Gerrit-Attention: Ryan Sultanem <rs...@google.com>
Gerrit-Comment-Date: Sat, 28 Feb 2026 02:18:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nicolas Dossou-Gbété <d...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages