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

Issue 2468833002: Count visible password fields on a page (Closed)

Created:
4 years, 1 month ago by estark
Modified:
4 years, 1 month ago
CC:
Aaron Boodman, abarth-chromium, blink-reviews, blink-reviews-api_chromium.org, blink-reviews-html_chromium.org, chromium-reviews, darin (slow to review), darin-cc_chromium.org, dglazkov+blink, gcasto+watchlist_chromium.org, jam, qsr+mojo_chromium.org, vabr+watchlistpasswordmanager_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Count visible password fields on a page For HTTP-bad phase 1 (https://crbug.com/647754), a "Not secure" warning in the omnibox should show up when a password field is visible on an HTTP page, and disappear when all password fields are gone. This CL counts password fields in a frame, incrementing the counter when a PasswordInputType creates a layout object and decrementing it on the layout object's willBeDestroyed() method. A Mojo IPC is sent when the counter is decremented to 0. A follow-up CL will keep track of the visibility of password fields per RenderFrameHost and remove the omnibox warning when there are no visible password fields anywhere in the frame tree. BUG=658764 Committed: https://crrev.com/556439aac8b23fd346feb501d33a1488aa4f7f7d Cr-Commit-Position: refs/heads/master@{#429450}

Patch Set 1 #

Patch Set 2 : fix comment wrapping #

Total comments: 4

Patch Set 3 : dcheng comments #

Total comments: 9

Patch Set 4 : dcheng comments round 2 #

Patch Set 5 : use a BindingSet to avoid recreating mock service impl #

Total comments: 4

Patch Set 6 : dcheng comments #

Messages

Total messages: 35 (13 generated)
estark
dcheng, PTAL? (There's a follow-up CL at https://codereview.chromium.org/2467773002/ to give you an idea of where ...
4 years, 1 month ago (2016-11-01 17:53:48 UTC) #4
estark
Oh, by the way, I stuck the counter on LocalFrame, but I'm not sure whether ...
4 years, 1 month ago (2016-11-01 17:54:42 UTC) #5
dcheng
https://codereview.chromium.org/2468833002/diff/20001/third_party/WebKit/Source/core/frame/LocalFrame.h File third_party/WebKit/Source/core/frame/LocalFrame.h (right): https://codereview.chromium.org/2468833002/diff/20001/third_party/WebKit/Source/core/frame/LocalFrame.h#newcode281 third_party/WebKit/Source/core/frame/LocalFrame.h:281: uint64_t m_passwordCount; Yeah, let's put this on Document: this ...
4 years, 1 month ago (2016-11-01 18:12:42 UTC) #6
dcheng
https://codereview.chromium.org/2468833002/diff/20001/third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp File third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp (right): https://codereview.chromium.org/2468833002/diff/20001/third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp#newcode131 third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp:131: document.frame()->incrementPasswordCount(); Also, for symmetry, can we increment / decrement ...
4 years, 1 month ago (2016-11-01 18:13:43 UTC) #7
estark
https://codereview.chromium.org/2468833002/diff/20001/third_party/WebKit/Source/core/frame/LocalFrame.h File third_party/WebKit/Source/core/frame/LocalFrame.h (right): https://codereview.chromium.org/2468833002/diff/20001/third_party/WebKit/Source/core/frame/LocalFrame.h#newcode281 third_party/WebKit/Source/core/frame/LocalFrame.h:281: uint64_t m_passwordCount; On 2016/11/01 18:12:42, dcheng wrote: > Yeah, ...
4 years, 1 month ago (2016-11-01 18:32:26 UTC) #10
dcheng
https://codereview.chromium.org/2468833002/diff/40001/third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp File third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp (right): https://codereview.chromium.org/2468833002/diff/40001/third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp#newcode51 third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp:51: PasswordLayoutObject(HTMLInputElement* element) Nit: explicit https://codereview.chromium.org/2468833002/diff/40001/third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp#newcode63 third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp:63: if (document.passwordCount() > ...
4 years, 1 month ago (2016-11-01 18:51:36 UTC) #11
estark
https://codereview.chromium.org/2468833002/diff/40001/third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp File third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp (right): https://codereview.chromium.org/2468833002/diff/40001/third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp#newcode51 third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp:51: PasswordLayoutObject(HTMLInputElement* element) On 2016/11/01 18:51:36, dcheng wrote: > Nit: ...
4 years, 1 month ago (2016-11-01 18:59:47 UTC) #12
estark
https://codereview.chromium.org/2468833002/diff/40001/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp File third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp (right): https://codereview.chromium.org/2468833002/diff/40001/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp#newcode28 third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp:28: if (!m_mockSensitiveInputVisibilityService || true) { On 2016/11/01 18:59:47, estark ...
4 years, 1 month ago (2016-11-01 19:03:21 UTC) #13
vabr (Chromium)
(components/password_manager/content/browser/content_password_manager_driver.* LGTM so far.)
4 years, 1 month ago (2016-11-02 11:28:59 UTC) #15
dcheng
https://codereview.chromium.org/2468833002/diff/40001/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp File third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp (right): https://codereview.chromium.org/2468833002/diff/40001/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp#newcode28 third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp:28: if (!m_mockSensitiveInputVisibilityService || true) { On 2016/11/01 19:03:21, estark ...
4 years, 1 month ago (2016-11-02 21:13:57 UTC) #16
estark
https://codereview.chromium.org/2468833002/diff/40001/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp File third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp (right): https://codereview.chromium.org/2468833002/diff/40001/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp#newcode28 third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp:28: if (!m_mockSensitiveInputVisibilityService || true) { On 2016/11/02 21:13:57, dcheng ...
4 years, 1 month ago (2016-11-02 21:31:05 UTC) #19
dcheng
lgtm https://codereview.chromium.org/2468833002/diff/80001/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp File third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp (right): https://codereview.chromium.org/2468833002/diff/80001/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp#newcode46 third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp:46: uint32_t numPasswordFieldsInvisibleCalls() const { Nit: #include <stdint.h> for ...
4 years, 1 month ago (2016-11-02 21:48:18 UTC) #20
estark
Thanks dcheng and vabr! https://codereview.chromium.org/2468833002/diff/80001/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp File third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp (right): https://codereview.chromium.org/2468833002/diff/80001/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp#newcode46 third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp:46: uint32_t numPasswordFieldsInvisibleCalls() const { On ...
4 years, 1 month ago (2016-11-02 21:54:01 UTC) #21
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/2468833002/100001
4 years, 1 month ago (2016-11-02 21:54:39 UTC) #24
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 1 month ago (2016-11-02 23:26:11 UTC) #25
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/556439aac8b23fd346feb501d33a1488aa4f7f7d Cr-Commit-Position: refs/heads/master@{#429450}
4 years, 1 month ago (2016-11-02 23:29:31 UTC) #27
tkent
+eae Adding new LayoutObject subclass just for counting looks overkill to me. Can't we decrease ...
4 years, 1 month ago (2016-11-07 03:57:38 UTC) #30
eae
On 2016/11/07 03:57:38, tkent wrote: > +eae > > Adding new LayoutObject subclass just for ...
4 years, 1 month ago (2016-11-07 04:43:11 UTC) #31
estark
On 2016/11/07 04:43:11, eae wrote: > On 2016/11/07 03:57:38, tkent wrote: > > +eae > ...
4 years, 1 month ago (2016-11-07 06:35:27 UTC) #32
estark
On 2016/11/07 06:35:27, estark wrote: > On 2016/11/07 04:43:11, eae wrote: > > On 2016/11/07 ...
4 years, 1 month ago (2016-11-08 00:45:19 UTC) #33
tkent
On 2016/11/08 at 00:45:19, estark wrote: > I played around with this suggestion a little ...
4 years, 1 month ago (2016-11-08 01:30:01 UTC) #34
estark
4 years, 1 month ago (2016-11-08 01:36:43 UTC) #35
Message was sent while issue was closed.
On 2016/11/08 01:30:01, tkent wrote:
> On 2016/11/08 at 00:45:19, estark wrote:
> > I played around with this suggestion a little bit today and I'm not sure it
> gives the behavior that I want. If I increment/decrement the counter in
> attachLayoutTree/detachLayoutTree, then the counter gets incremented even if
the
> password field is set to display:none. I'd like the counter to only increment
> when the field is visible.
> 
> Did you try:
>  - HTMLInputElement::attachLayoutTree: Count up if layoutObject exists *after*
> calling HTMLTextFormControlElement::attachLayoutTree()
>  - HTMLInputElement::detachLayoutTree: Count down if layoutObject exists
*before
> calling HTMLTextFormControlElement::detachLayoutTree()

Aha, I think that works, thanks. Will send a CL.

Powered by Google App Engine
This is Rietveld 408576698