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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2468833002: Count visible password fields on a page (Closed)
Patch Set: dcheng comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 149cd32f36b9d1f833d98c706a001b902e5c6781..f3a53130f3b96ca4d075bbc5897b27cd92c7c51e 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -504,7 +504,8 @@ Document::Document(const DocumentInit& initializer,
m_hasViewportUnits(false),
m_parserSyncPolicy(AllowAsynchronousParsing),
m_nodeCount(0),
- m_wouldLoadReason(Created) {
+ m_wouldLoadReason(Created),
+ m_passwordCount(0) {
if (m_frame) {
DCHECK(m_frame->page());
provideContextFeaturesToDocumentFrom(*this, *m_frame->page());
@@ -6349,6 +6350,18 @@ PropertyRegistry* Document::propertyRegistry() {
return m_propertyRegistry;
}
+void Document::incrementPasswordCount() {
+ ++m_passwordCount;
+}
+
+void Document::decrementPasswordCount() {
+ --m_passwordCount;
+}
+
+unsigned Document::passwordCount() const {
+ return m_passwordCount;
+}
+
DEFINE_TRACE(Document) {
visitor->trace(m_importsController);
visitor->trace(m_docType);
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698