Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Issue 2771833002: Password Manager should skip fields with credit card autocomplete attribute. (Closed)

Created:
3 years, 9 months ago by dvadym
Modified:
3 years, 9 months ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, jam, vabr+watchlistpasswordmanager_chromium.org, rouslan+autofill_chromium.org, rogerm+autofillwatch_chromium.org, sebsg+autofillwatch_chromium.org, browser-components-watch_chromium.org, mathp+autofillwatch_chromium.org, darin-cc_chromium.org, vabr+watchlistautofill_chromium.org, estade+watch_chromium.org, gcasto+watchlist_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Password Manager should skip fields with credit card autocomplete attribute. BUG=703491 Review-Url: https://codereview.chromium.org/2771833002 Cr-Commit-Position: refs/heads/master@{#459766} Committed: https://chromium.googlesource.com/chromium/src/+/b0bfdf4c71968db2620169a3e4056a4460beb00d

Patch Set 1 #

Patch Set 2 : Add comment #

Total comments: 5

Patch Set 3 : Readability improvement #

Patch Set 4 : Do not create string in HasAutocompleteAttributeValue #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+64 lines, -4 lines) Patch
M components/autofill/content/renderer/password_form_conversion_utils.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M components/autofill/content/renderer/password_form_conversion_utils.cc View 1 2 3 4 chunks +27 lines, -4 lines 3 comments Download
M components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc View 1 chunk +33 lines, -0 lines 0 comments Download

Messages

Total messages: 26 (9 generated)
dvadym
Hi Vaclav, Could you please review this CL? Regards, Vadym
3 years, 9 months ago (2017-03-23 14:42:41 UTC) #3
Mathieu
Good to see this! Is there a bigger plan to address this at large? autocomplete ...
3 years, 9 months ago (2017-03-23 14:50:50 UTC) #5
dvadym
Definitely, we're going to address this. Unfortunately it's hard to do in the current Password ...
3 years, 9 months ago (2017-03-23 15:01:41 UTC) #6
vabr (Chromium)
Thanks, Vadym. LGTM with a suggestion for code simplification. Cheers, Vaclav https://codereview.chromium.org/2771833002/diff/20001/components/autofill/content/renderer/password_form_conversion_utils.cc File components/autofill/content/renderer/password_form_conversion_utils.cc (right): ...
3 years, 9 months ago (2017-03-23 20:04:23 UTC) #7
Mathieu
lgtm
3 years, 9 months ago (2017-03-23 21:55:14 UTC) #8
dvadym
Thanks for comments Vaclav! PTAL https://codereview.chromium.org/2771833002/diff/20001/components/autofill/content/renderer/password_form_conversion_utils.cc File components/autofill/content/renderer/password_form_conversion_utils.cc (right): https://codereview.chromium.org/2771833002/diff/20001/components/autofill/content/renderer/password_form_conversion_utils.cc#newcode754 components/autofill/content/renderer/password_form_conversion_utils.cc:754: // All credit cards ...
3 years, 9 months ago (2017-03-24 09:34:33 UTC) #9
Roger McFarlane (Chromium)
https://codereview.chromium.org/2771833002/diff/20001/components/autofill/content/renderer/password_form_conversion_utils.cc File components/autofill/content/renderer/password_form_conversion_utils.cc (right): https://codereview.chromium.org/2771833002/diff/20001/components/autofill/content/renderer/password_form_conversion_utils.cc#newcode754 components/autofill/content/renderer/password_form_conversion_utils.cc:754: // All credit cards autocomplete attributes start with "cc-". ...
3 years, 9 months ago (2017-03-24 15:47:16 UTC) #11
vabr (Chromium)
Hi Vadym, Please find my answer below. Cheers, Vaclav https://codereview.chromium.org/2771833002/diff/20001/components/autofill/content/renderer/password_form_conversion_utils.cc File components/autofill/content/renderer/password_form_conversion_utils.cc (right): https://codereview.chromium.org/2771833002/diff/20001/components/autofill/content/renderer/password_form_conversion_utils.cc#newcode754 components/autofill/content/renderer/password_form_conversion_utils.cc:754: ...
3 years, 9 months ago (2017-03-24 19:19:36 UTC) #12
dvadym
https://codereview.chromium.org/2771833002/diff/20001/components/autofill/content/renderer/password_form_conversion_utils.cc File components/autofill/content/renderer/password_form_conversion_utils.cc (right): https://codereview.chromium.org/2771833002/diff/20001/components/autofill/content/renderer/password_form_conversion_utils.cc#newcode754 components/autofill/content/renderer/password_form_conversion_utils.cc:754: // All credit cards autocomplete attributes start with "cc-". ...
3 years, 9 months ago (2017-03-27 10:51:40 UTC) #13
vabr (Chromium)
On 2017/03/27 10:51:40, dvadym wrote: > https://codereview.chromium.org/2771833002/diff/20001/components/autofill/content/renderer/password_form_conversion_utils.cc > File components/autofill/content/renderer/password_form_conversion_utils.cc > (right): > > https://codereview.chromium.org/2771833002/diff/20001/components/autofill/content/renderer/password_form_conversion_utils.cc#newcode754 ...
3 years, 9 months ago (2017-03-27 12:26:36 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2771833002/60001
3 years, 9 months ago (2017-03-27 12:26:57 UTC) #17
commit-bot: I haz the power
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/b0bfdf4c71968db2620169a3e4056a4460beb00d
3 years, 9 months ago (2017-03-27 13:12:12 UTC) #20
battre
Should we go one step further and look for CVV, CVC, etc (https://en.wikipedia.org/wiki/Card_security_code) in the ...
3 years, 9 months ago (2017-03-27 15:17:47 UTC) #22
dvadym
On 2017/03/27 15:17:47, battre wrote: > Should we go one step further and look for ...
3 years, 9 months ago (2017-03-27 15:57:24 UTC) #23
Roger McFarlane (Chromium)
https://codereview.chromium.org/2771833002/diff/60001/components/autofill/content/renderer/password_form_conversion_utils.cc File components/autofill/content/renderer/password_form_conversion_utils.cc (right): https://codereview.chromium.org/2771833002/diff/60001/components/autofill/content/renderer/password_form_conversion_utils.cc#newcode758 components/autofill/content/renderer/password_form_conversion_utils.cc:758: for (const auto& token : base::SplitStringPiece( Another, IMO better, ...
3 years, 9 months ago (2017-03-27 19:06:28 UTC) #24
vabr (Chromium)
https://codereview.chromium.org/2771833002/diff/60001/components/autofill/content/renderer/password_form_conversion_utils.cc File components/autofill/content/renderer/password_form_conversion_utils.cc (right): https://codereview.chromium.org/2771833002/diff/60001/components/autofill/content/renderer/password_form_conversion_utils.cc#newcode758 components/autofill/content/renderer/password_form_conversion_utils.cc:758: for (const auto& token : base::SplitStringPiece( On 2017/03/27 19:06:28, ...
3 years, 9 months ago (2017-03-27 20:20:03 UTC) #25
dvadym
3 years, 9 months ago (2017-03-28 08:33:08 UTC) #26
Message was sent while issue was closed.
https://codereview.chromium.org/2771833002/diff/60001/components/autofill/con...
File components/autofill/content/renderer/password_form_conversion_utils.cc
(right):

https://codereview.chromium.org/2771833002/diff/60001/components/autofill/con...
components/autofill/content/renderer/password_form_conversion_utils.cc:758: for
(const auto& token : base::SplitStringPiece(
On 2017/03/27 20:20:03, vabr (Chromium) wrote:
> On 2017/03/27 19:06:28, Roger McFarlane (Chromium) wrote:
> > Another, IMO better, alternative would be to just do startswith "cc-" or
> > contains " cc-" which would be clearer to read, have zero memory overhead
and
> be
> > O(n) time, where n is the length of the value.
> 
> It is indeed O(n) because the length of " cc-" is a constant. I'm not sure
about
> the zero memory overhead, because I don't know how exactly string::find is
> implemented.
> 
> What you describe is roughly what Vadym had originally, and I would argue that
> that was not clearer to read.
> 
> I'm fine with anything which at least reaches the bar of the current code: no
> explanatory comments needed, and the code is concise.

When using regexp, there are 2 times: creating a regexp object (building state
machine) and matching. Since the creating of the object could take significant
time in general, usually it's better to create the object only once. Then it's
needed to use some machinery to do this for example like here
https://cs.chromium.org/chromium/src/components/autofill/content/renderer/pas...
with lazy loading. My feeling that it would be not easier than just straight
forward splitting and checking with StartsWith. Moreover now both this function
and HasAutocompleteAttributeValue function have the same logic with splitting,
and in HasAutocompleteAttributeValue it doesn't make sense to create a regexp
object since |value_in_lowercase| is different on each call.

Powered by Google App Engine
This is Rietveld 408576698