[Autofill] Revise ownership in the AuthenticatorSelectionDialog. [chromium/src : main]

0 views
Skip to first unread message

Timofey Chudakov (Gerrit)

unread,
Apr 27, 2026, 10:24:23 AMApr 27
to Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, tmartino+tran...@chromium.org, vinnypersky+...@google.com
Attention needed from Christoph Schwering

Timofey Chudakov voted and added 1 comment

Votes added by Timofey Chudakov

Commit-Queue+1

1 comment

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Timofey Chudakov . resolved

Hey Chris, I wanted to get your feedback on the CL before sending it to other reviewers. We could walk through it on a call.

Open in Gerrit

Related details

Attention is currently required from:
  • Christoph Schwering
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: I28fc815e0cba3c135dd20e7fd38e3795ed846dd9
Gerrit-Change-Number: 7789965
Gerrit-PatchSet: 9
Gerrit-Owner: Timofey Chudakov <tchu...@google.com>
Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
Gerrit-Attention: Christoph Schwering <schw...@google.com>
Gerrit-Comment-Date: Mon, 27 Apr 2026 14:24:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Christoph Schwering (Gerrit)

unread,
Apr 27, 2026, 7:37:09 PMApr 27
to Timofey Chudakov, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, tmartino+tran...@chromium.org, vinnypersky+...@google.com
Attention needed from Timofey Chudakov

Christoph Schwering added 9 comments

Commit Message
Line 26, Patchset 9 (Latest):2. AuthenticatorSelectionDialogViewAndroid::Dismiss calls the Java
dismiss.
3. The dialog is dismissed asynchronously.
4. AuthenticatorSelectionDialogViewAndroid::OnDismissed is called.
5. controller_->OnDialogClosed is called when the controller is already
destroyed.
File chrome/browser/ui/android/autofill/authenticator_selection_dialog_view_android.cc
Line 46, Patchset 9 (Latest): // The dismissal can happen either from C++ or from Java. `Dismiss` is
Christoph Schwering . unresolved

What do you mean by "the dismissal" here?

The call of `AuthenticatorSelectionDialogViewAndroid::Dismiss()`? The next sentence sounds like it's saying the opposite.

Or do you mean the union of `Dismiss()` and `OnDismissed()`?

Line 89, Patchset 9 (Latest): // Don't show the dialog twice. This should not be possible because
Christoph Schwering . unresolved

Do you mean "should not be possible" as in "we believe it's impossible" or "we want it to be impossible"? Could you rephrase this?

Line 90, Patchset 9 (Latest): // `ShowDialog` is always called once from the
Christoph Schwering . unresolved

nitty nit: remove

Line 153, Patchset 9 (Latest): // Destroy the view immediately
Christoph Schwering . unresolved

nitty nit: punctuation

File chrome/browser/ui/views/autofill/payments/card_unmask_authentication_selection_dialog_view.cc
Line 7, Patchset 9 (Latest):#include <memory>
Christoph Schwering . unresolved

nit: not needed, is it?

File components/autofill/core/browser/ui/payments/card_unmask_authentication_selection_dialog_wrapper.h
Line 20, Patchset 9 (Latest): typedef std::unique_ptr<CardUnmaskAuthenticationSelectionDialog> DialogHolder;
Christoph Schwering . unresolved

nit: use modern syntax: `using DialogHolder = ...;`?

Line 17, Patchset 9 (Latest):class CardUnmaskAuthenticationSelectionDialogWrapper {
Christoph Schwering . unresolved

nit: could you add documentation?

File components/autofill/core/browser/ui/payments/card_unmask_authentication_selection_dialog_wrapper.cc
Line 20, Patchset 9 (Latest): dialog_view_.reset();
Christoph Schwering . unresolved

nit: `dialog_view_ = nullptr` has the same effect on as `dialog_view_.reset()`, so the `#if` isn't necessary.

Open in Gerrit

Related details

Attention is currently required from:
  • Timofey Chudakov
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: I28fc815e0cba3c135dd20e7fd38e3795ed846dd9
    Gerrit-Change-Number: 7789965
    Gerrit-PatchSet: 9
    Gerrit-Owner: Timofey Chudakov <tchu...@google.com>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
    Gerrit-Attention: Timofey Chudakov <tchu...@google.com>
    Gerrit-Comment-Date: Mon, 27 Apr 2026 23:36:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Timofey Chudakov (Gerrit)

    unread,
    Apr 28, 2026, 4:38:52 AMApr 28
    to Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, tmartino+tran...@chromium.org, vinnypersky+...@google.com
    Attention needed from Christoph Schwering

    Timofey Chudakov added 9 comments

    Commit Message
    Line 26, Patchset 9:2. AuthenticatorSelectionDialogViewAndroid::Dismiss calls the Java

    dismiss.
    3. The dialog is dismissed asynchronously.
    4. AuthenticatorSelectionDialogViewAndroid::OnDismissed is called.
    5. controller_->OnDialogClosed is called when the controller is already
    destroyed.
    Timofey Chudakov

    You're right, I updated the scenario. The C++ memory management appears to be correct, but I would like to get rid of `delete this` calls to simplify lifecycle reasoning.

    File chrome/browser/ui/android/autofill/authenticator_selection_dialog_view_android.cc
    Line 46, Patchset 9: // The dismissal can happen either from C++ or from Java. `Dismiss` is
    Christoph Schwering . unresolved

    What do you mean by "the dismissal" here?

    The call of `AuthenticatorSelectionDialogViewAndroid::Dismiss()`? The next sentence sounds like it's saying the opposite.

    Or do you mean the union of `Dismiss()` and `OnDismissed()`?

    Timofey Chudakov

    I rephrased the comment, PTAL

    Line 89, Patchset 9: // Don't show the dialog twice. This should not be possible because
    Christoph Schwering . unresolved

    Do you mean "should not be possible" as in "we believe it's impossible" or "we want it to be impossible"? Could you rephrase this?

    Timofey Chudakov

    Rephrased, PTAL.

    Line 90, Patchset 9: // `ShowDialog` is always called once from the
    Christoph Schwering . resolved

    nitty nit: remove

    Timofey Chudakov

    Done

    Line 153, Patchset 9: // Destroy the view immediately
    Christoph Schwering . resolved

    nitty nit: punctuation

    Timofey Chudakov

    Done

    File chrome/browser/ui/views/autofill/payments/card_unmask_authentication_selection_dialog_view.cc
    Line 7, Patchset 9:#include <memory>
    Christoph Schwering . resolved

    nit: not needed, is it?

    Timofey Chudakov

    Done

    File components/autofill/core/browser/ui/payments/card_unmask_authentication_selection_dialog_wrapper.h
    Line 20, Patchset 9: typedef std::unique_ptr<CardUnmaskAuthenticationSelectionDialog> DialogHolder;
    Christoph Schwering . resolved

    nit: use modern syntax: `using DialogHolder = ...;`?

    Timofey Chudakov

    Done

    Line 17, Patchset 9:class CardUnmaskAuthenticationSelectionDialogWrapper {
    Christoph Schwering . resolved

    nit: could you add documentation?

    Timofey Chudakov

    Done

    File components/autofill/core/browser/ui/payments/card_unmask_authentication_selection_dialog_wrapper.cc
    Line 20, Patchset 9: dialog_view_.reset();
    Christoph Schwering . resolved

    nit: `dialog_view_ = nullptr` has the same effect on as `dialog_view_.reset()`, so the `#if` isn't necessary.

    Timofey Chudakov

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christoph Schwering
    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: I28fc815e0cba3c135dd20e7fd38e3795ed846dd9
    Gerrit-Change-Number: 7789965
    Gerrit-PatchSet: 10
    Gerrit-Owner: Timofey Chudakov <tchu...@google.com>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Tue, 28 Apr 2026 08:38:35 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Christoph Schwering <schw...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Christoph Schwering (Gerrit)

    unread,
    Apr 28, 2026, 11:23:34 AMApr 28
    to Timofey Chudakov, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, tmartino+tran...@chromium.org, vinnypersky+...@google.com
    Attention needed from Timofey Chudakov

    Christoph Schwering added 5 comments

    Patchset-level comments
    File-level comment, Patchset 11 (Latest):
    Christoph Schwering . resolved

    Thanks! Just a few nits.

    File chrome/browser/ui/android/autofill/authenticator_selection_dialog_view_android.cc
    Line 52, Patchset 11 (Latest): JNIEnv* env = base::android::AttachCurrentThread();
    Christoph Schwering . unresolved

    nitty nit: move inside `if`?

    Line 89, Patchset 9: // Don't show the dialog twice. This should not be possible because
    Christoph Schwering . unresolved

    Do you mean "should not be possible" as in "we believe it's impossible" or "we want it to be impossible"? Could you rephrase this?

    Timofey Chudakov

    Rephrased, PTAL.

    Christoph Schwering

    My confusion came from the "should": It can be understood as "we hope that" or "we enforce that". You mean the former, right? IMO we should avoid "should" because it's often ambiguous.

    WDYT about adding `CHECK(controller_, base::NotFatalUntil::M1xx)`?

    File components/autofill/core/browser/ui/payments/card_unmask_authentication_selection_dialog_wrapper.h
    Line 47, Patchset 11 (Latest): CardUnmaskAuthenticationSelectionDialog* operator->();
    const CardUnmaskAuthenticationSelectionDialog* operator->() const;
    Christoph Schwering . unresolved

    nit: to avoid surprises, I'd also overload `operator*()` so that `a->b` is the same as `(*a).b`.

    Line 22, Patchset 11 (Latest):class CardUnmaskAuthenticationSelectionDialogWrapper {
    Christoph Schwering . unresolved

    Doesn't it suffices to use `DialogHolder` directly everywhere?

    Both `raw_ptr` and `std::unique_ptr` define `operator*()`, `operator->()`, `operator bool()`, and even a `get()` function. You'd just have to use `x = nullptr` instead of `x.Reset()`, I think.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Timofey Chudakov
    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: I28fc815e0cba3c135dd20e7fd38e3795ed846dd9
    Gerrit-Change-Number: 7789965
    Gerrit-PatchSet: 11
    Gerrit-Owner: Timofey Chudakov <tchu...@google.com>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
    Gerrit-Attention: Timofey Chudakov <tchu...@google.com>
    Gerrit-Comment-Date: Tue, 28 Apr 2026 15:23:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Timofey Chudakov <tchu...@google.com>
    Comment-In-Reply-To: Christoph Schwering <schw...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Timofey Chudakov (Gerrit)

    unread,
    Apr 29, 2026, 5:25:09 AMApr 29
    to Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, tmartino+tran...@chromium.org, vinnypersky+...@google.com
    Attention needed from Christoph Schwering

    Timofey Chudakov added 3 comments

    File chrome/browser/ui/android/autofill/authenticator_selection_dialog_view_android.cc
    Line 46, Patchset 9: // The dismissal can happen either from C++ or from Java. `Dismiss` is
    Christoph Schwering . resolved

    What do you mean by "the dismissal" here?

    The call of `AuthenticatorSelectionDialogViewAndroid::Dismiss()`? The next sentence sounds like it's saying the opposite.

    Or do you mean the union of `Dismiss()` and `OnDismissed()`?

    Timofey Chudakov

    I rephrased the comment, PTAL

    Timofey Chudakov

    Done

    Line 52, Patchset 11: JNIEnv* env = base::android::AttachCurrentThread();
    Christoph Schwering . resolved

    nitty nit: move inside `if`?

    Timofey Chudakov

    Done

    Line 89, Patchset 9: // Don't show the dialog twice. This should not be possible because
    Christoph Schwering . resolved

    Do you mean "should not be possible" as in "we believe it's impossible" or "we want it to be impossible"? Could you rephrase this?

    Timofey Chudakov

    Rephrased, PTAL.

    Christoph Schwering

    My confusion came from the "should": It can be understood as "we hope that" or "we enforce that". You mean the former, right? IMO we should avoid "should" because it's often ambiguous.

    WDYT about adding `CHECK(controller_, base::NotFatalUntil::M1xx)`?

    Timofey Chudakov

    Done, I assume you mean `CHECK(!java_object_, base::NotFatalUntil::M150);`

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christoph Schwering
    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: I28fc815e0cba3c135dd20e7fd38e3795ed846dd9
    Gerrit-Change-Number: 7789965
    Gerrit-PatchSet: 12
    Gerrit-Owner: Timofey Chudakov <tchu...@google.com>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Wed, 29 Apr 2026 09:24:53 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Timofey Chudakov (Gerrit)

    unread,
    Apr 29, 2026, 5:26:27 AMApr 29
    to Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, tmartino+tran...@chromium.org, vinnypersky+...@google.com
    Attention needed from Christoph Schwering

    Timofey Chudakov added 2 comments

    File components/autofill/core/browser/ui/payments/card_unmask_authentication_selection_dialog_wrapper.h
    Line 47, Patchset 11: CardUnmaskAuthenticationSelectionDialog* operator->();

    const CardUnmaskAuthenticationSelectionDialog* operator->() const;
    Christoph Schwering . resolved

    nit: to avoid surprises, I'd also overload `operator*()` so that `a->b` is the same as `(*a).b`.

    Timofey Chudakov

    Done

    Line 22, Patchset 11:class CardUnmaskAuthenticationSelectionDialogWrapper {
    Christoph Schwering . resolved

    Doesn't it suffices to use `DialogHolder` directly everywhere?

    Both `raw_ptr` and `std::unique_ptr` define `operator*()`, `operator->()`, `operator bool()`, and even a `get()` function. You'd just have to use `x = nullptr` instead of `x.Reset()`, I think.

    Timofey Chudakov

    Good point.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christoph Schwering
    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: I28fc815e0cba3c135dd20e7fd38e3795ed846dd9
    Gerrit-Change-Number: 7789965
    Gerrit-PatchSet: 13
    Gerrit-Owner: Timofey Chudakov <tchu...@google.com>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Wed, 29 Apr 2026 09:26:09 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Christoph Schwering <schw...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Christoph Schwering (Gerrit)

    unread,
    Apr 29, 2026, 6:22:34 AMApr 29
    to Timofey Chudakov, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, tmartino+tran...@chromium.org, vinnypersky+...@google.com
    Attention needed from Timofey Chudakov

    Christoph Schwering voted and added 4 comments

    Votes added by Christoph Schwering

    Code-Review+1

    4 comments

    Patchset-level comments
    File-level comment, Patchset 14 (Latest):
    Christoph Schwering . resolved

    THanks!

    Commit Message
    Line 26, Patchset 9:2. AuthenticatorSelectionDialogViewAndroid::Dismiss calls the Java
    dismiss.
    3. The dialog is dismissed asynchronously.
    4. AuthenticatorSelectionDialogViewAndroid::OnDismissed is called.
    5. controller_->OnDialogClosed is called when the controller is already
    destroyed.
    Christoph Schwering . resolved

    I don't see yet how this crashes: Doesn't [this](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/android/autofill/authenticator_selection_dialog_view_android.cc;l=43-46;drc=f4718a40657cbf0de22a483cc1389ac95a6685ba) in Step 2 prevent us from enterining [the `if` statement](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/android/autofill/authenticator_selection_dialog_view_android.cc;l=72-76;drc=d648b1b5371523e04f0955321a24422d928c49e4) that leads to Step 5?

    Timofey Chudakov

    You're right, I updated the scenario. The C++ memory management appears to be correct, but I would like to get rid of `delete this` calls to simplify lifecycle reasoning.

    Christoph Schwering

    Acknowledged

    File chrome/browser/ui/android/autofill/authenticator_selection_dialog_view_android.cc
    Line 89, Patchset 9: // Don't show the dialog twice. This should not be possible because
    Christoph Schwering . resolved

    Do you mean "should not be possible" as in "we believe it's impossible" or "we want it to be impossible"? Could you rephrase this?

    Timofey Chudakov

    Rephrased, PTAL.

    Christoph Schwering

    My confusion came from the "should": It can be understood as "we hope that" or "we enforce that". You mean the former, right? IMO we should avoid "should" because it's often ambiguous.

    WDYT about adding `CHECK(controller_, base::NotFatalUntil::M1xx)`?

    Timofey Chudakov

    Done, I assume you mean `CHECK(!java_object_, base::NotFatalUntil::M150);`

    Christoph Schwering

    Oops yes :)

    File components/autofill/core/browser/ui/payments/card_unmask_authentication_selection_dialog_controller_impl.h
    Line 24, Patchset 14 (Latest):// A wrapper around a pointer to a CardUnmaskAuthenticationSelectionDialog. This
    Christoph Schwering . unresolved

    nitty nit: it's not a wrapper anymore :)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Timofey Chudakov
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: I28fc815e0cba3c135dd20e7fd38e3795ed846dd9
    Gerrit-Change-Number: 7789965
    Gerrit-PatchSet: 14
    Gerrit-Owner: Timofey Chudakov <tchu...@google.com>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
    Gerrit-Attention: Timofey Chudakov <tchu...@google.com>
    Gerrit-Comment-Date: Wed, 29 Apr 2026 10:22:18 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Timofey Chudakov (Gerrit)

    unread,
    Apr 29, 2026, 7:16:32 AMApr 29
    to Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, tmartino+tran...@chromium.org, vinnypersky+...@google.com
    Attention needed from Christoph Schwering

    Timofey Chudakov added 1 comment

    File components/autofill/core/browser/ui/payments/card_unmask_authentication_selection_dialog_controller_impl.h
    Line 24, Patchset 14 (Latest):// A wrapper around a pointer to a CardUnmaskAuthenticationSelectionDialog. This
    Christoph Schwering . unresolved

    nitty nit: it's not a wrapper anymore :)

    Timofey Chudakov

    I meant that either the `raw_ptr` or `std::unique_ptr` is a wrapper the controller uses.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christoph Schwering
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: I28fc815e0cba3c135dd20e7fd38e3795ed846dd9
    Gerrit-Change-Number: 7789965
    Gerrit-PatchSet: 14
    Gerrit-Owner: Timofey Chudakov <tchu...@google.com>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Wed, 29 Apr 2026 11:16:12 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Timofey Chudakov (Gerrit)

    unread,
    Apr 29, 2026, 7:16:40 AMApr 29
    to Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, tmartino+tran...@chromium.org, vinnypersky+...@google.com
    Attention needed from Christoph Schwering

    Timofey Chudakov added 1 comment

    File components/autofill/core/browser/ui/payments/card_unmask_authentication_selection_dialog_controller_impl.h
    Line 24, Patchset 14 (Latest):// A wrapper around a pointer to a CardUnmaskAuthenticationSelectionDialog. This
    Christoph Schwering . resolved

    nitty nit: it's not a wrapper anymore :)

    Timofey Chudakov

    I meant that either the `raw_ptr` or `std::unique_ptr` is a wrapper the controller uses.

    Timofey Chudakov

    Acknowledged

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christoph Schwering
    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: I28fc815e0cba3c135dd20e7fd38e3795ed846dd9
      Gerrit-Change-Number: 7789965
      Gerrit-PatchSet: 14
      Gerrit-Owner: Timofey Chudakov <tchu...@google.com>
      Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
      Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
      Gerrit-Attention: Christoph Schwering <schw...@google.com>
      Gerrit-Comment-Date: Wed, 29 Apr 2026 11:16:24 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      open
      diffy

      Timofey Chudakov (Gerrit)

      unread,
      Apr 29, 2026, 7:16:47 AMApr 29
      to Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, tmartino+tran...@chromium.org, vinnypersky+...@google.com
      Attention needed from Christoph Schwering

      Timofey Chudakov voted Commit-Queue+2

      Commit-Queue+2
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Christoph Schwering
      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: I28fc815e0cba3c135dd20e7fd38e3795ed846dd9
      Gerrit-Change-Number: 7789965
      Gerrit-PatchSet: 14
      Gerrit-Owner: Timofey Chudakov <tchu...@google.com>
      Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
      Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
      Gerrit-Attention: Christoph Schwering <schw...@google.com>
      Gerrit-Comment-Date: Wed, 29 Apr 2026 11:16:29 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Apr 29, 2026, 7:20:41 AMApr 29
      to Timofey Chudakov, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, tmartino+tran...@chromium.org, vinnypersky+...@google.com

      Chromium LUCI CQ submitted the change

      Change information

      Commit message:
      [Autofill] Revise ownership in the AuthenticatorSelectionDialog.

      CardUnmaskAuthenticationSelectionDialogControllerImpl used to store the
      CardUnmaskAuthenticationSelectionDialog as a raw pointer. This makes
      sense on Desktop because the created view is owned by the dialog
      manager.

      The Android's AuthenticatorSelectionDialogView is not owned by the
      system component and was responsible for deleting itself. This is
      problematic from the memory management perspective.

      The root cause of the memory issue is that the Android dialog can be
      dismissed both from C++ and from Java. The C++ dismissal happens when
      the server request fails or the WebContents is destroyed. The Java
      dismissal happens when the use clicks a dialog button.

      The crashing scenario is following:
      1. CardUnmaskAuthenticationSelectionDialogControllerImpl destructor is
      called.

      2. AuthenticatorSelectionDialogViewAndroid::Dismiss calls the Java
      dismiss.
      3. The dialog is dismissed asynchronously.
      4. AuthenticatorSelectionDialogViewAndroid::OnDismissed is called, which
      deletes the native view.
      5. AuthenticatorSelectionDialog still holds the native pointer. The user
      clicks one of the dialog buttons.
      6. AuthenticatorSelectionDialogBridge calls the native view in response
      to the button click, but the view has already been destroyed.

      (1) The AuthenticatorSelectionDialogViewAndroid is now owned by the
      unique pointer to simplify the memory management. A special wrapper is
      created to store the native view via a raw pointer on Desktop and iOS.

      (2) AuthenticatorSelectionDialogViewAndroid is destroyed immediately
      by the controller after it's dismissed. This means that Java will never
      call the C++ view if the dismissal call was coming from C++.

      (3) AuthenticatorSelectionDialogBridge now resets the native pointer
      immediately when the dismissal happens. This means that Java side will
      never get called by the C++ side after the view is dismissed by the
      user.

      [1] https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/views/autofill/payments/card_unmask_authentication_selection_dialog_view.cc;l=282-286;drc=0be01c1048de19d23525ffb5eaae17d9979282fb
      Bug: 501594107
      Change-Id: I28fc815e0cba3c135dd20e7fd38e3795ed846dd9
      Reviewed-by: Christoph Schwering <schw...@google.com>
      Commit-Queue: Timofey Chudakov <tchu...@google.com>
      Cr-Commit-Position: refs/heads/main@{#1622344}
      Files:
      • M chrome/browser/ui/android/autofill/authenticator_selection_dialog_view_android.cc
      • M chrome/browser/ui/android/autofill/internal/java/src/org/chromium/chrome/browser/ui/autofill/AuthenticatorSelectionDialogBridge.java
      • M chrome/browser/ui/android/autofill/internal/java/src/org/chromium/chrome/browser/ui/autofill/AuthenticatorSelectionDialogBridgeTest.java
      • M components/autofill/core/browser/ui/payments/card_unmask_authentication_selection_dialog_controller_impl.cc
      • M components/autofill/core/browser/ui/payments/card_unmask_authentication_selection_dialog_controller_impl.h
      Change size: M
      Delta: 5 files changed, 98 insertions(+), 25 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Christoph Schwering
      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: I28fc815e0cba3c135dd20e7fd38e3795ed846dd9
      Gerrit-Change-Number: 7789965
      Gerrit-PatchSet: 15
      Gerrit-Owner: Timofey Chudakov <tchu...@google.com>
      Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
      open
      diffy
      satisfied_requirement

      Timofey Chudakov (Gerrit)

      unread,
      5:20 AM (4 hours ago) 5:20 AM
      to Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, tmartino+tran...@chromium.org, vinnypersky+...@google.com

      Timofey Chudakov has created a revert of this change

      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: revert
      satisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages