card.is_user_confirmed() ? std::string(autofill::kSettingsOrigin)
: std::string(),I'll look into propagating the change to Java in a followup.
void PaymentsDataCleaner::ClearCreditCardNonSettingsOrigins() {As the review agent:
By removing this cleanup, we are now relying on cards being saved to the database to clear their non-settings origin strings (lazy migration). Since CreditCardFromStatement already maps any non-settings string to is_user_confirmed = false, this is safe, but it means the DB will contain stale URL strings for a longer period than before.
I think that's partially right, but it doesn't matter:
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Tommy, could you ptal at //ios?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
void PaymentsDataCleaner::ClearCreditCardNonSettingsOrigins() {As the review agent:
By removing this cleanup, we are now relying on cards being saved to the database to clear their non-settings origin strings (lazy migration). Since CreditCardFromStatement already maps any non-settings string to is_user_confirmed = false, this is safe, but it means the DB will contain stale URL strings for a longer period than before.
I think that's partially right, but it doesn't matter:
- AFAICT, today the only origins that we pass to `CreditCard` are `""` and `"Chrome settings"`. So there's nothing to be cleared. I didn't check old code, of course.
- The database schema should be updated to remove the `"origin"` column. That'd implicitly clean up all origins.
The database schema should be updated to remove the "origin" column.
s/should/will/: the schema update is in the followup https://crrev.com/c/8112597
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
autofill::CreditCard credit_card(
base::Uuid::GenerateRandomV4().AsLowercaseString(),
"https://www.example.com/");It seems we also set the origin here.. Should this be set as user_confirmed so that we don't change the behavior of these cards?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
autofill::CreditCard credit_card(
base::Uuid::GenerateRandomV4().AsLowercaseString(),
"https://www.example.com/");It seems we also set the origin here.. Should this be set as user_confirmed so that we don't change the behavior of these cards?
That'd be wrong:
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
autofill::CreditCard credit_card(
base::Uuid::GenerateRandomV4().AsLowercaseString(),
"https://www.example.com/");Christoph SchweringIt seems we also set the origin here.. Should this be set as user_confirmed so that we don't change the behavior of these cards?
That'd be wrong:
- We want that `is_user_confirmed()` in the new code is equivalent to `IsVerified()` in the old code.)
- Therefore, in the new code, we need to call `set_is_user_confirmed(true)` iff in the old code, the origin is a non-empty but **in**valid URL. (I find that super confusing.)
- Since `https://www.example.com/` is a valid URL (in the sense that `GURL("https://www.example.com/").is_valid()`), we want `!is_user_confirmed()` here.
I... totally missed the invalid URL piece.
That's... awful. Thanks for cleaning this up haha
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
Thanks!
card.is_user_confirmed() ? std::string(autofill::kSettingsOrigin)
: std::string(),I'll look into propagating the change to Java in a followup.
Done
void PaymentsDataCleaner::ClearCreditCardNonSettingsOrigins() {Christoph SchweringAs the review agent:
By removing this cleanup, we are now relying on cards being saved to the database to clear their non-settings origin strings (lazy migration). Since CreditCardFromStatement already maps any non-settings string to is_user_confirmed = false, this is safe, but it means the DB will contain stale URL strings for a longer period than before.
I think that's partially right, but it doesn't matter:
- AFAICT, today the only origins that we pass to `CreditCard` are `""` and `"Chrome settings"`. So there's nothing to be cleared. I didn't check old code, of course.
- The database schema should be updated to remove the `"origin"` column. That'd implicitly clean up all origins.
The database schema should be updated to remove the "origin" column.
s/should/will/: the schema update is in the followup https://crrev.com/c/8112597
Acknowledged
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
6 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
[Autofill] Replace CreditCard::origin(), IsVerified() with a bool
The semantics of CreditCard::origin() boils down to a single bool:
origin() == "Chrome settings" iff the user confirmed the card in
chrome://settings.
The documented semantics is even stranger: origin() is a non-empty
invalid URL iff the user confirmed the card in chrome://settings.
The above simplification comes from the actual usage in the code.
See crbug.com/535623365 for a more detailed argument.
This CL therefore replaces CreditCard::origin_ with a single bool.
Followup CLs will simplify UpdateFromImportedCard() and remove the
origin from the PaymentsAutofillTable.
The CL is supposed to make no behavior change.
TAG=agy
CONV=8b078322-df0d-4996-a59b-e2e316eafee0
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |