[AutofillAi - M4] Implement get/update entity on the c++ side [chromium/src : main]

0 views
Skip to first unread message

Timofey Chudakov (Gerrit)

unread,
Dec 14, 2025, 3:23:58 AM (6 days ago) Dec 14
to Bruno Braga, Chromium LUCI CQ, Dirk Schulze, Stephen Chenney, AyeAye, Jan Keitel, chromium...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, sloboda...@chromium.org, blink-reviews-p...@chromium.org, drott+bl...@chromium.org, fserb...@chromium.org, browser-comp...@chromium.org
Attention needed from Bruno Braga and Jan Keitel

Timofey Chudakov added 5 comments

File chrome/browser/autofill/android/entity_data_manager_android.cc
Line 62, Patchset 1:EntityDataManagerAndroid::GetEntityInstance(const std::string& guid) {
Timofey Chudakov . unresolved

Please write Jni type converter for `EntityInstance` and `AttributeInstance`, [example](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/ui/addresses/android/autofill_address_ui_component_android.h;drc=6abb42116c6059a2c2fe94860ea3488e08644f42).

Bruno Braga

We do not have the equivalent for an Autofill Profile, do you know why? IIUC the advantage of what you are suggesting is that creating an Entity Instance will be easier to read since we will avoid all the boilerplate jni code and could use regular c++ instead?

Timofey Chudakov

We do not have the equivalent for an Autofill Profile, do you know why

It's a tech debt, the address editor was written before JNI converters were added to chrome.

The advantage is that the conversion is a implemented separately from the logic inside the `EntityDataManagerAndroid` (improves readability significantly in my opinion)

Line 74, Patchset 7 (Latest): entity_data_manager().AddOrUpdateEntityInstance(
Timofey Chudakov . unresolved

This will work fine for adding a new entity instance % we call `FinalizeInfo` when the Java -> C++ conversion happens. This will reset the name structure after every conversion.

I would pull somebody familiar with the name data model in Autofill and Autofill AI specifically to validate this like @vizcay

Line 88, Patchset 1: base::android::ConvertUTF16ToJavaString(
env, !is_date ? attribute.GetCompleteInfo(app_locale) : u"");
Jan Keitel . resolved

@tchu...@google.com: Is there a more ergonomic way of doing this? Can we just pass null values instead of empty strings?

Timofey Chudakov

Yes, we should just pass strings themself and use `@JniType("std::u16string")` on the Java side. C++ doesn't have `nullptr` strings, so there won't be any `null` strings on the Java side.

Bruno Braga

Please take a look, this is obsolete now.

Timofey Chudakov

Acknowledged

File chrome/browser/autofill/android/entity_instance_android.cc
Line 73, Patchset 7 (Latest): EntityInstance::EntityId(
Timofey Chudakov . unresolved

Could you please annotate parameters here with `/*parameter=*/`

Line 76, Patchset 7 (Latest): "", base::Time::Now(), 0, base::Time(), record_type,
Timofey Chudakov . unresolved

This will overwrite the use count and use date after every conversion.

This will work only if you retrieve an existing entity and then set all attributes there.

[for discussion] I would still pass these values to Java for consistency.

Open in Gerrit

Related details

Attention is currently required from:
  • Bruno Braga
  • Jan Keitel
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: Iad7ab28dc23fa6c6d334d2aa22f0eefbafe00d8c
Gerrit-Change-Number: 7210630
Gerrit-PatchSet: 7
Gerrit-Owner: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Jan Keitel <jke...@google.com>
Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Jan Keitel <jke...@google.com>
Gerrit-Attention: Bruno Braga <bruno...@google.com>
Gerrit-Comment-Date: Sun, 14 Dec 2025 08:23:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Jan Keitel <jke...@google.com>
Comment-In-Reply-To: Bruno Braga <bruno...@google.com>
Comment-In-Reply-To: Timofey Chudakov <tchu...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Bruno Braga (Gerrit)

unread,
Dec 17, 2025, 7:56:35 AM (3 days ago) Dec 17
to Jihad Hanna, Chromium LUCI CQ, Dirk Schulze, Stephen Chenney, AyeAye, Timofey Chudakov, chromium...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, sloboda...@chromium.org, blink-reviews-p...@chromium.org, drott+bl...@chromium.org, fserb...@chromium.org, browser-comp...@chromium.org
Attention needed from Jihad Hanna and Timofey Chudakov

Bruno Braga added 5 comments

File chrome/browser/autofill/android/entity_data_manager_android.cc
Line 62, Patchset 1:EntityDataManagerAndroid::GetEntityInstance(const std::string& guid) {
Timofey Chudakov . resolved

Please write Jni type converter for `EntityInstance` and `AttributeInstance`, [example](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/ui/addresses/android/autofill_address_ui_component_android.h;drc=6abb42116c6059a2c2fe94860ea3488e08644f42).

Bruno Braga

We do not have the equivalent for an Autofill Profile, do you know why? IIUC the advantage of what you are suggesting is that creating an Entity Instance will be easier to read since we will avoid all the boilerplate jni code and could use regular c++ instead?

Bruno Braga

Done

Line 74, Patchset 7: entity_data_manager().AddOrUpdateEntityInstance(
Timofey Chudakov . unresolved

This will work fine for adding a new entity instance % we call `FinalizeInfo` when the Java -> C++ conversion happens. This will reset the name structure after every conversion.

I would pull somebody familiar with the name data model in Autofill and Autofill AI specifically to validate this like @vizcay

Bruno Braga

I believe we just need to call `FinalizeInfo()` for each attribute. @jihad...@google.com

Line 88, Patchset 1: base::android::ConvertUTF16ToJavaString(
env, !is_date ? attribute.GetCompleteInfo(app_locale) : u"");
Jan Keitel . resolved

@tchu...@google.com: Is there a more ergonomic way of doing this? Can we just pass null values instead of empty strings?

Timofey Chudakov

Yes, we should just pass strings themself and use `@JniType("std::u16string")` on the Java side. C++ doesn't have `nullptr` strings, so there won't be any `null` strings on the Java side.

Bruno Braga

Please take a look, this is obsolete now.

Bruno Braga

Done

File chrome/browser/autofill/android/entity_instance_android.cc
Line 73, Patchset 7: EntityInstance::EntityId(
Timofey Chudakov . resolved

Could you please annotate parameters here with `/*parameter=*/`

Bruno Braga

Done

Line 76, Patchset 7: "", base::Time::Now(), 0, base::Time(), record_type,
Timofey Chudakov . unresolved

This will overwrite the use count and use date after every conversion.

This will work only if you retrieve an existing entity and then set all attributes there.

[for discussion] I would still pass these values to Java for consistency.

Bruno Braga

This is what we want to do and is also the behaviour for desktop. If the user just edited an entity it means they are showing interest in it.

We have a frecency logic that pushes recently used entities to the top, same would happen if the user just manually corrected and entity.

Open in Gerrit

Related details

Attention is currently required from:
  • Jihad Hanna
  • 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: Iad7ab28dc23fa6c6d334d2aa22f0eefbafe00d8c
Gerrit-Change-Number: 7210630
Gerrit-PatchSet: 10
Gerrit-Owner: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Jihad Hanna <jihad...@google.com>
Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Jihad Hanna <jihad...@google.com>
Gerrit-Attention: Timofey Chudakov <tchu...@google.com>
Gerrit-Comment-Date: Wed, 17 Dec 2025 12:56:22 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Jihad Hanna (Gerrit)

unread,
Dec 17, 2025, 11:12:20 AM (3 days ago) Dec 17
to Bruno Braga, Chromium LUCI CQ, Dirk Schulze, Stephen Chenney, AyeAye, Timofey Chudakov, chromium...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, sloboda...@chromium.org, blink-reviews-p...@chromium.org, drott+bl...@chromium.org, fserb...@chromium.org, browser-comp...@chromium.org
Attention needed from Bruno Braga and Timofey Chudakov

Jihad Hanna added 1 comment

File chrome/browser/autofill/android/entity_data_manager_android.cc
Line 74, Patchset 7: entity_data_manager().AddOrUpdateEntityInstance(
Timofey Chudakov . unresolved

This will work fine for adding a new entity instance % we call `FinalizeInfo` when the Java -> C++ conversion happens. This will reset the name structure after every conversion.

I would pull somebody familiar with the name data model in Autofill and Autofill AI specifically to validate this like @vizcay

Bruno Braga

I believe we just need to call `FinalizeInfo()` for each attribute. @jihad...@google.com

Jihad Hanna

We usually call `FinalizeInfo()` when creating an entity.

When does the Java conversion happen?

Open in Gerrit

Related details

Attention is currently required from:
  • Bruno Braga
  • 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: Iad7ab28dc23fa6c6d334d2aa22f0eefbafe00d8c
Gerrit-Change-Number: 7210630
Gerrit-PatchSet: 10
Gerrit-Owner: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Jihad Hanna <jihad...@google.com>
Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Bruno Braga <bruno...@google.com>
Gerrit-Attention: Timofey Chudakov <tchu...@google.com>
Gerrit-Comment-Date: Wed, 17 Dec 2025 16:12:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Bruno Braga (Gerrit)

unread,
Dec 18, 2025, 7:37:17 AM (2 days ago) Dec 18
to Jihad Hanna, Chromium LUCI CQ, Dirk Schulze, Stephen Chenney, AyeAye, Timofey Chudakov, chromium...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, sloboda...@chromium.org, blink-reviews-p...@chromium.org, drott+bl...@chromium.org, fserb...@chromium.org, browser-comp...@chromium.org
Attention needed from Jihad Hanna and Timofey Chudakov

Bruno Braga added 1 comment

File chrome/browser/autofill/android/entity_data_manager_android.cc
Line 74, Patchset 7: entity_data_manager().AddOrUpdateEntityInstance(
Timofey Chudakov . unresolved

This will work fine for adding a new entity instance % we call `FinalizeInfo` when the Java -> C++ conversion happens. This will reset the name structure after every conversion.

I would pull somebody familiar with the name data model in Autofill and Autofill AI specifically to validate this like @vizcay

Bruno Braga

I believe we just need to call `FinalizeInfo()` for each attribute. @jihad...@google.com

Jihad Hanna

We usually call `FinalizeInfo()` when creating an entity.

When does the Java conversion happen?

Bruno Braga

We also call it when updating an entity from the settings page. Is this a problem?

The conversion from java to c++ happens in the line above:

```
EntityInstanceAndroid entity_android =
EntityInstanceAndroid::FromJavaEntityInstance(env, jEntity);
```
Open in Gerrit

Related details

Attention is currently required from:
  • Jihad Hanna
  • 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: Iad7ab28dc23fa6c6d334d2aa22f0eefbafe00d8c
Gerrit-Change-Number: 7210630
Gerrit-PatchSet: 10
Gerrit-Owner: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Jihad Hanna <jihad...@google.com>
Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Jihad Hanna <jihad...@google.com>
Gerrit-Attention: Timofey Chudakov <tchu...@google.com>
Gerrit-Comment-Date: Thu, 18 Dec 2025 12:37:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Jihad Hanna <jihad...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Jihad Hanna (Gerrit)

unread,
Dec 18, 2025, 7:50:18 AM (2 days ago) Dec 18
to Bruno Braga, Chromium LUCI CQ, Dirk Schulze, Stephen Chenney, AyeAye, Timofey Chudakov, chromium...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, sloboda...@chromium.org, blink-reviews-p...@chromium.org, drott+bl...@chromium.org, fserb...@chromium.org, browser-comp...@chromium.org
Attention needed from Bruno Braga and Timofey Chudakov

Jihad Hanna added 1 comment

File chrome/browser/autofill/android/entity_data_manager_android.cc
Line 74, Patchset 7: entity_data_manager().AddOrUpdateEntityInstance(
Timofey Chudakov . unresolved

This will work fine for adding a new entity instance % we call `FinalizeInfo` when the Java -> C++ conversion happens. This will reset the name structure after every conversion.

I would pull somebody familiar with the name data model in Autofill and Autofill AI specifically to validate this like @vizcay

Bruno Braga

I believe we just need to call `FinalizeInfo()` for each attribute. @jihad...@google.com

Jihad Hanna

We usually call `FinalizeInfo()` when creating an entity.

When does the Java conversion happen?

Bruno Braga

We also call it when updating an entity from the settings page. Is this a problem?

The conversion from java to c++ happens in the line above:

```
EntityInstanceAndroid entity_android =
EntityInstanceAndroid::FromJavaEntityInstance(env, jEntity);
```
Jihad Hanna

We also call it when updating an entity from the settings page. Is this a problem?

I think it's a small problem, but since [addresses do the same](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/extensions/api/autofill_private/autofill_private_api.cc;l=285;drc=7666bc1983c2a5b98e5dc6fa6c28f8f53c07d06f) I think it's something we so far accept.

I think the function you're currently implementing is supposed to also be used for settings (but correct me if I'm wrong), and in that case I agree with Bruno that we should call `FinalizeInfo()` there.

Open in Gerrit

Related details

Attention is currently required from:
  • Bruno Braga
  • 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: Iad7ab28dc23fa6c6d334d2aa22f0eefbafe00d8c
Gerrit-Change-Number: 7210630
Gerrit-PatchSet: 10
Gerrit-Owner: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Jihad Hanna <jihad...@google.com>
Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Bruno Braga <bruno...@google.com>
Gerrit-Attention: Timofey Chudakov <tchu...@google.com>
Gerrit-Comment-Date: Thu, 18 Dec 2025 12:50:05 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Bruno Braga (Gerrit)

unread,
Dec 18, 2025, 9:30:35 AM (2 days ago) Dec 18
to Jihad Hanna, Chromium LUCI CQ, Dirk Schulze, Stephen Chenney, AyeAye, Timofey Chudakov, chromium...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, sloboda...@chromium.org, blink-reviews-p...@chromium.org, drott+bl...@chromium.org, fserb...@chromium.org, browser-comp...@chromium.org
Attention needed from Jihad Hanna and Timofey Chudakov

Bruno Braga added 1 comment

File chrome/browser/autofill/android/entity_data_manager_android.cc
Line 74, Patchset 7: entity_data_manager().AddOrUpdateEntityInstance(
Timofey Chudakov . unresolved

This will work fine for adding a new entity instance % we call `FinalizeInfo` when the Java -> C++ conversion happens. This will reset the name structure after every conversion.

I would pull somebody familiar with the name data model in Autofill and Autofill AI specifically to validate this like @vizcay

Bruno Braga

I believe we just need to call `FinalizeInfo()` for each attribute. @jihad...@google.com

Jihad Hanna

We usually call `FinalizeInfo()` when creating an entity.

When does the Java conversion happen?

Bruno Braga

We also call it when updating an entity from the settings page. Is this a problem?

The conversion from java to c++ happens in the line above:

```
EntityInstanceAndroid entity_android =
EntityInstanceAndroid::FromJavaEntityInstance(env, jEntity);
```
Jihad Hanna

We also call it when updating an entity from the settings page. Is this a problem?

I think it's a small problem, but since [addresses do the same](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/extensions/api/autofill_private/autofill_private_api.cc;l=285;drc=7666bc1983c2a5b98e5dc6fa6c28f8f53c07d06f) I think it's something we so far accept.

I think the function you're currently implementing is supposed to also be used for settings (but correct me if I'm wrong), and in that case I agree with Bruno that we should call `FinalizeInfo()` there.

Bruno Braga

I added a TODO to handle this in a follow up.

Open in Gerrit

Related details

Attention is currently required from:
  • Jihad Hanna
  • 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: Iad7ab28dc23fa6c6d334d2aa22f0eefbafe00d8c
Gerrit-Change-Number: 7210630
Gerrit-PatchSet: 10
Gerrit-Owner: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Jihad Hanna <jihad...@google.com>
Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Jihad Hanna <jihad...@google.com>
Gerrit-Attention: Timofey Chudakov <tchu...@google.com>
Gerrit-Comment-Date: Thu, 18 Dec 2025 14:30:18 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Jihad Hanna (Gerrit)

unread,
Dec 18, 2025, 9:49:34 AM (2 days ago) Dec 18
to Bruno Braga, Chromium LUCI CQ, Dirk Schulze, Stephen Chenney, AyeAye, Timofey Chudakov, chromium...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, sloboda...@chromium.org, blink-reviews-p...@chromium.org, drott+bl...@chromium.org, fserb...@chromium.org, browser-comp...@chromium.org
Attention needed from Bruno Braga and Timofey Chudakov

Jihad Hanna added 1 comment

File chrome/browser/autofill/android/attribute_instance_android.cc
Line 85, Patchset 11 (Latest): if (std::holds_alternative<AttributeInstanceAndroidDateType>(value)) {
const std::string& app_locale = g_browser_process->GetApplicationLocale();
autofill::FieldType field_type =
attribute_type.ToAttributeType().field_type();
const AttributeInstanceAndroidDateType& date_value =
std::get<AttributeInstanceAndroidDateType>(value);
instance.SetInfo(
field_type, date_value.day, app_locale,
AutofillFormatString(u"D", autofill::FormatString_Type_DATE),
VerificationStatus::kUserVerified);
instance.SetInfo(
field_type, date_value.month, app_locale,
AutofillFormatString(u"M", autofill::FormatString_Type_DATE),
VerificationStatus::kUserVerified);
instance.SetInfo(
field_type, date_value.year, app_locale,
AutofillFormatString(u"YYYY", autofill::FormatString_Type_DATE),
VerificationStatus::kUserVerified);
} else {
instance.SetRawInfo(attribute_type.ToAttributeType().field_type(),
std::get<std::u16string>(value),
VerificationStatus::kUserVerified);
}
Jihad Hanna . unresolved

I think this is incomplete, you should iterate over `AttributeType::field_subtypes()` and set each of them, like [in the database logic](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/webdata/autofill_ai/entity_table.cc;l=685;drc=89424e3fec685efa12c7a6f598dbf3e9ebfbcf4d)

Open in Gerrit

Related details

Attention is currently required from:
  • Bruno Braga
  • 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: Iad7ab28dc23fa6c6d334d2aa22f0eefbafe00d8c
Gerrit-Change-Number: 7210630
Gerrit-PatchSet: 11
Gerrit-Owner: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Jihad Hanna <jihad...@google.com>
Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Bruno Braga <bruno...@google.com>
Gerrit-Attention: Timofey Chudakov <tchu...@google.com>
Gerrit-Comment-Date: Thu, 18 Dec 2025 14:49:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Timofey Chudakov (Gerrit)

unread,
Dec 18, 2025, 10:26:10 AM (2 days ago) Dec 18
to Bruno Braga, Jihad Hanna, Chromium LUCI CQ, Dirk Schulze, Stephen Chenney, AyeAye, chromium...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, sloboda...@chromium.org, blink-reviews-p...@chromium.org, drott+bl...@chromium.org, fserb...@chromium.org, browser-comp...@chromium.org
Attention needed from Bruno Braga and Jihad Hanna

Timofey Chudakov added 3 comments

File chrome/browser/autofill/android/entity_data_manager_android.cc
Line 74, Patchset 7: entity_data_manager().AddOrUpdateEntityInstance(
Timofey Chudakov . resolved

This will work fine for adding a new entity instance % we call `FinalizeInfo` when the Java -> C++ conversion happens. This will reset the name structure after every conversion.

I would pull somebody familiar with the name data model in Autofill and Autofill AI specifically to validate this like @vizcay

Bruno Braga

I believe we just need to call `FinalizeInfo()` for each attribute. @jihad...@google.com

Jihad Hanna

We usually call `FinalizeInfo()` when creating an entity.

When does the Java conversion happen?

Bruno Braga

We also call it when updating an entity from the settings page. Is this a problem?

The conversion from java to c++ happens in the line above:

```
EntityInstanceAndroid entity_android =
EntityInstanceAndroid::FromJavaEntityInstance(env, jEntity);
```
Jihad Hanna

We also call it when updating an entity from the settings page. Is this a problem?

I think it's a small problem, but since [addresses do the same](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/extensions/api/autofill_private/autofill_private_api.cc;l=285;drc=7666bc1983c2a5b98e5dc6fa6c28f8f53c07d06f) I think it's something we so far accept.

I think the function you're currently implementing is supposed to also be used for settings (but correct me if I'm wrong), and in that case I agree with Bruno that we should call `FinalizeInfo()` there.

Bruno Braga

I added a TODO to handle this in a follow up.

Timofey Chudakov

Acknowledged

File chrome/browser/autofill/android/entity_instance_android.cc
Line 76, Patchset 7: "", base::Time::Now(), 0, base::Time(), record_type,
Timofey Chudakov . unresolved

This will overwrite the use count and use date after every conversion.

This will work only if you retrieve an existing entity and then set all attributes there.

[for discussion] I would still pass these values to Java for consistency.

Bruno Braga

This is what we want to do and is also the behaviour for desktop. If the user just edited an entity it means they are showing interest in it.

We have a frecency logic that pushes recently used entities to the top, same would happen if the user just manually corrected and entity.

Timofey Chudakov

Okay, so we want to reset the `date_modified` and `use_date`. What about the `use_count`?

Line 76, Patchset 11 (Latest): /*nickname=*/"", /*use_date=*/base::Time::Now(), /*use_count=*/0,
Timofey Chudakov . unresolved

Please fix this WARNING reported by ClangTidy: check: bugprone-argument-comment

argument name 'use_date' in comment does not m...

check: bugprone-argument-comment

argument name 'use_date' in comment does not match parameter name 'date_modified' (https://clang.llvm.org/extra/clang-tidy/checks/bugprone/argument-comment.html)

(Note: You can add `Skip-Clang-Tidy-Checks: bugprone-argument-comment` footer to the CL description to skip the check)

(Lint observed on `android-clang-tidy-rel`, but not on `linux-clang-tidy-rel` or `mac-clang-tidy-rel`)

Open in Gerrit

Related details

Attention is currently required from:
  • Bruno Braga
  • Jihad Hanna
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: Iad7ab28dc23fa6c6d334d2aa22f0eefbafe00d8c
Gerrit-Change-Number: 7210630
Gerrit-PatchSet: 11
Gerrit-Owner: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Jihad Hanna <jihad...@google.com>
Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Jihad Hanna <jihad...@google.com>
Gerrit-Attention: Bruno Braga <bruno...@google.com>
Gerrit-Comment-Date: Thu, 18 Dec 2025 15:25:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Bruno Braga (Gerrit)

unread,
Dec 19, 2025, 9:10:42 AM (23 hours ago) Dec 19
to Jihad Hanna, Chromium LUCI CQ, Dirk Schulze, Stephen Chenney, AyeAye, Timofey Chudakov, chromium...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, sloboda...@chromium.org, blink-reviews-p...@chromium.org, drott+bl...@chromium.org, fserb...@chromium.org, browser-comp...@chromium.org
Attention needed from Jihad Hanna

Bruno Braga added 1 comment

File chrome/browser/autofill/android/attribute_instance_android.cc
Line 85, Patchset 11: if (std::holds_alternative<AttributeInstanceAndroidDateType>(value)) {

const std::string& app_locale = g_browser_process->GetApplicationLocale();
autofill::FieldType field_type =
attribute_type.ToAttributeType().field_type();
const AttributeInstanceAndroidDateType& date_value =
std::get<AttributeInstanceAndroidDateType>(value);
instance.SetInfo(
field_type, date_value.day, app_locale,
AutofillFormatString(u"D", autofill::FormatString_Type_DATE),
VerificationStatus::kUserVerified);
instance.SetInfo(
field_type, date_value.month, app_locale,
AutofillFormatString(u"M", autofill::FormatString_Type_DATE),
VerificationStatus::kUserVerified);
instance.SetInfo(
field_type, date_value.year, app_locale,
AutofillFormatString(u"YYYY", autofill::FormatString_Type_DATE),
VerificationStatus::kUserVerified);
} else {
instance.SetRawInfo(attribute_type.ToAttributeType().field_type(),
std::get<std::u16string>(value),
VerificationStatus::kUserVerified);
}
Jihad Hanna . unresolved

I think this is incomplete, you should iterate over `AttributeType::field_subtypes()` and set each of them, like [in the database logic](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/webdata/autofill_ai/entity_table.cc;l=685;drc=89424e3fec685efa12c7a6f598dbf3e9ebfbcf4d)

Bruno Braga

PTAL, now I just copy the whole attribute instance if its new or was not modified

Open in Gerrit

Related details

Attention is currently required from:
  • Jihad Hanna
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: Iad7ab28dc23fa6c6d334d2aa22f0eefbafe00d8c
Gerrit-Change-Number: 7210630
Gerrit-PatchSet: 14
Gerrit-Owner: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Jihad Hanna <jihad...@google.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Jihad Hanna <jihad...@google.com>
Gerrit-Comment-Date: Fri, 19 Dec 2025 14:10:29 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Jihad Hanna (Gerrit)

unread,
Dec 19, 2025, 6:08:21 PM (15 hours ago) Dec 19
to Bruno Braga, Chromium LUCI CQ, Dirk Schulze, Stephen Chenney, AyeAye, Timofey Chudakov, chromium...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, sloboda...@chromium.org, blink-reviews-p...@chromium.org, drott+bl...@chromium.org, fserb...@chromium.org, browser-comp...@chromium.org
Attention needed from Bruno Braga and Timofey Chudakov

Jihad Hanna added 1 comment

File chrome/browser/autofill/android/attribute_instance_android.cc
Jihad Hanna

The commented block didn't change at all ?¿

Open in Gerrit

Related details

Attention is currently required from:
  • Bruno Braga
  • 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: Iad7ab28dc23fa6c6d334d2aa22f0eefbafe00d8c
Gerrit-Change-Number: 7210630
Gerrit-PatchSet: 14
Gerrit-Owner: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Bruno Braga <bruno...@google.com>
Gerrit-Reviewer: Timofey Chudakov <tchu...@google.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Jihad Hanna <jihad...@google.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Bruno Braga <bruno...@google.com>
Gerrit-Attention: Timofey Chudakov <tchu...@google.com>
Gerrit-Comment-Date: Fri, 19 Dec 2025 23:08:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Jihad Hanna <jihad...@google.com>
Comment-In-Reply-To: Bruno Braga <bruno...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages