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

Unified Diff: third_party/WebKit/Source/core/dom/custom/V0CustomElementRegistry.cpp

Issue 2772723002: Add detailed use counters for document.registerElement use. (Closed)
Patch Set: Bring patch to head. Created 3 years, 9 months 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/custom/V0CustomElementRegistry.cpp
diff --git a/third_party/WebKit/Source/core/dom/custom/V0CustomElementRegistry.cpp b/third_party/WebKit/Source/core/dom/custom/V0CustomElementRegistry.cpp
index a5d3a780ccb7138a25f559d9fe41c96bf752fe45..f215786409159cbbdf4c725be929a569d32b1cec 100644
--- a/third_party/WebKit/Source/core/dom/custom/V0CustomElementRegistry.cpp
+++ b/third_party/WebKit/Source/core/dom/custom/V0CustomElementRegistry.cpp
@@ -38,7 +38,7 @@
#include "core/dom/custom/CustomElementRegistry.h"
#include "core/dom/custom/V0CustomElementException.h"
#include "core/dom/custom/V0CustomElementRegistrationContext.h"
-#include "core/frame/LocalDOMWindow.h"
+#include "core/frame/UseCounter.h"
namespace blink {
@@ -109,6 +109,18 @@ V0CustomElementDefinition* V0CustomElementRegistry::registerElement(
return 0;
}
+ if (validNames & V0CustomElement::EmbedderNames) {
+ UseCounter::count(document,
+ UseCounter::V0CustomElementsRegisterEmbedderElement);
+ } else if (tagName.namespaceURI() == SVGNames::svgNamespaceURI) {
+ UseCounter::count(document, UseCounter::V0CustomElementsRegisterSVGElement);
+ } else {
+ UseCounter::count(
+ document, descriptor.isTypeExtension()
+ ? UseCounter::V0CustomElementsRegisterHTMLTypeExtension
+ : UseCounter::V0CustomElementsRegisterHTMLCustomTag);
+ }
+
return definition;
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/custom/V0CustomElement.cpp ('k') | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698