Ash: Move TPM firmware update notification to MessageCenter [chromium/src : main]

0 views
Skip to first unread message

Georg Neis (Gerrit)

unread,
Jul 14, 2026, 4:55:43 AM (7 days ago) Jul 14
to Di Wu, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Di Wu

Georg Neis added 2 comments

File chrome/browser/ash/tpm/tpm_firmware_update_notification.cc
Line 90, Patchset 1 (Latest): const user_manager::User& user = CHECK_DEREF(
Georg Neis . unresolved

Please fix this WARNING reported by autoreview issue finding: There is an inconsistency here regarding whether the `User` can be null.

Here, `CHECK_DEREF` will crash if `GetUserByBrowserContext` returns null. However, in `Click()` above, there is a null check (`if (user)`) and a TODO asking to revisit if we always have the user.

If it is possible for this profile to not have an associated user (e.g., on the sign-in screen), this `CHECK_DEREF` will crash and we need to handle it gracefully. If it's guaranteed to always be non-null for the profiles that reach this code, we should remove the null check and TODO in `Click()` to avoid confusion.

Line 114, Patchset 1 (Latest):}
Georg Neis . unresolved

Same question as in the other CL but here even more relevant due to the retained Profile pointer: what happens when the user logs out?

Open in Gerrit

Related details

Attention is currently required from:
  • Di Wu
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: I634f526789c2a341e2315711fde14e70aec636ad
Gerrit-Change-Number: 8090208
Gerrit-PatchSet: 1
Gerrit-Owner: Di Wu <di...@google.com>
Gerrit-Reviewer: Di Wu <di...@google.com>
Gerrit-Reviewer: Georg Neis <ne...@chromium.org>
Gerrit-Attention: Di Wu <di...@google.com>
Gerrit-Comment-Date: Tue, 14 Jul 2026 08:55:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Di Wu (Gerrit)

unread,
1:49 AM (7 hours ago) 1:49 AM
to Georg Neis, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Georg Neis

Di Wu added 2 comments

File chrome/browser/ash/tpm/tpm_firmware_update_notification.cc
Line 90, Patchset 1: const user_manager::User& user = CHECK_DEREF(
Georg Neis . resolved

Please fix this WARNING reported by autoreview issue finding: There is an inconsistency here regarding whether the `User` can be null.

Here, `CHECK_DEREF` will crash if `GetUserByBrowserContext` returns null. However, in `Click()` above, there is a null check (`if (user)`) and a TODO asking to revisit if we always have the user.

If it is possible for this profile to not have an associated user (e.g., on the sign-in screen), this `CHECK_DEREF` will crash and we need to handle it gracefully. If it's guaranteed to always be non-null for the profiles that reach this code, we should remove the null check and TODO in `Click()` to avoid confusion.

Di Wu

Thanks. The TODO from `crbug.com/447287122` (which itself was a broad sweep of 20 or more CLs across the code base) was not taking into account the real UX flow here and is overly conservative. The non-null is guaranteed as can be seen [here].

The null check and the todo is now deleted.

[here]:https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ash/login/session/user_session_manager.cc;l=2284

Georg Neis . unresolved

Same question as in the other CL but here even more relevant due to the retained Profile pointer: what happens when the user logs out?

Di Wu

Great question. This touches the soul of this series of NDS removal. Message center dies with Ash shell, which dies noticeably earlier than the destruction of the profile. And this notification dies with message center. By the time the user logs out and profile starts getting torn down. Both message center and the tpm notification are long dead.

Open in Gerrit

Related details

Attention is currently required from:
  • Georg Neis
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: I634f526789c2a341e2315711fde14e70aec636ad
Gerrit-Change-Number: 8090208
Gerrit-PatchSet: 2
Gerrit-Owner: Di Wu <di...@google.com>
Gerrit-Reviewer: Di Wu <di...@google.com>
Gerrit-Reviewer: Georg Neis <ne...@chromium.org>
Gerrit-Attention: Georg Neis <ne...@chromium.org>
Gerrit-Comment-Date: Tue, 21 Jul 2026 05:49:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Georg Neis <ne...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Georg Neis (Gerrit)

unread,
3:16 AM (5 hours ago) 3:16 AM
to Di Wu, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Di Wu

Georg Neis added 3 comments

File chrome/browser/ash/tpm/tpm_firmware_update_notification.cc
Line 42, Patchset 2 (Latest): const std::string& notification_id)
Georg Neis . unresolved

Can we pass by value and use move semantics?

Line 90, Patchset 2 (Latest): "%s#%s", kTPMFirmwareUpdateNotificationId, user.username_hash().c_str());
Georg Neis . unresolved

I think we should define a function for this encoding and use it here and elsewhere. Maybe add to notification_utils.cc?

Line 114, Patchset 1:}
Georg Neis . resolved

Same question as in the other CL but here even more relevant due to the retained Profile pointer: what happens when the user logs out?

Di Wu

Great question. This touches the soul of this series of NDS removal. Message center dies with Ash shell, which dies noticeably earlier than the destruction of the profile. And this notification dies with message center. By the time the user logs out and profile starts getting torn down. Both message center and the tpm notification are long dead.

Georg Neis

I was thinking of a secondary user. But looks like it's impossible to sign out only a secondary user.

Open in Gerrit

Related details

Attention is currently required from:
  • Di Wu
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: I634f526789c2a341e2315711fde14e70aec636ad
Gerrit-Change-Number: 8090208
Gerrit-PatchSet: 2
Gerrit-Owner: Di Wu <di...@google.com>
Gerrit-Reviewer: Di Wu <di...@google.com>
Gerrit-Reviewer: Georg Neis <ne...@chromium.org>
Gerrit-Attention: Di Wu <di...@google.com>
Gerrit-Comment-Date: Tue, 21 Jul 2026 07:16:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Di Wu <di...@google.com>
Comment-In-Reply-To: Georg Neis <ne...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages