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

Side by Side Diff: third_party/WebKit/Source/core/dom/custom/V0CustomElement.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 20 matching lines...) Expand all
31 #include "core/dom/custom/V0CustomElement.h" 31 #include "core/dom/custom/V0CustomElement.h"
32 32
33 #include "core/HTMLNames.h" 33 #include "core/HTMLNames.h"
34 #include "core/MathMLNames.h" 34 #include "core/MathMLNames.h"
35 #include "core/SVGNames.h" 35 #include "core/SVGNames.h"
36 #include "core/dom/Document.h" 36 #include "core/dom/Document.h"
37 #include "core/dom/Element.h" 37 #include "core/dom/Element.h"
38 #include "core/dom/custom/V0CustomElementMicrotaskRunQueue.h" 38 #include "core/dom/custom/V0CustomElementMicrotaskRunQueue.h"
39 #include "core/dom/custom/V0CustomElementObserver.h" 39 #include "core/dom/custom/V0CustomElementObserver.h"
40 #include "core/dom/custom/V0CustomElementScheduler.h" 40 #include "core/dom/custom/V0CustomElementScheduler.h"
41 #include "core/frame/UseCounter.h"
41 42
42 namespace blink { 43 namespace blink {
43 44
44 V0CustomElementMicrotaskImportStep* V0CustomElement::didCreateImport( 45 V0CustomElementMicrotaskImportStep* V0CustomElement::didCreateImport(
45 HTMLImportChild* import) { 46 HTMLImportChild* import) {
46 return V0CustomElementScheduler::scheduleImport(import); 47 return V0CustomElementScheduler::scheduleImport(import);
47 } 48 }
48 49
49 void V0CustomElement::didFinishLoadingImport(Document& master) { 50 void V0CustomElement::didFinishLoadingImport(Document& master) {
50 master.customElementMicrotaskRunQueue()->requestDispatchIfNeeded(); 51 master.customElementMicrotaskRunQueue()->requestDispatchIfNeeded();
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 102
102 void V0CustomElement::define(Element* element, 103 void V0CustomElement::define(Element* element,
103 V0CustomElementDefinition* definition) { 104 V0CustomElementDefinition* definition) {
104 switch (element->getV0CustomElementState()) { 105 switch (element->getV0CustomElementState()) {
105 case Element::V0NotCustomElement: 106 case Element::V0NotCustomElement:
106 case Element::V0Upgraded: 107 case Element::V0Upgraded:
107 NOTREACHED(); 108 NOTREACHED();
108 break; 109 break;
109 110
110 case Element::V0WaitingForUpgrade: 111 case Element::V0WaitingForUpgrade:
112 UseCounter::count(
113 element->document(),
114 definition->descriptor().isTypeExtension()
115 ? UseCounter::V0CustomElementsCreateTypeExtensionElement
116 : UseCounter::V0CustomElementsCreateCustomTagElement);
111 element->v0SetCustomElementDefinition(definition); 117 element->v0SetCustomElementDefinition(definition);
112 V0CustomElementScheduler::scheduleCallback( 118 V0CustomElementScheduler::scheduleCallback(
113 definition->callbacks(), element, 119 definition->callbacks(), element,
114 V0CustomElementLifecycleCallbacks::CreatedCallback); 120 V0CustomElementLifecycleCallbacks::CreatedCallback);
115 break; 121 break;
116 } 122 }
117 } 123 }
118 124
119 void V0CustomElement::attributeDidChange(Element* element, 125 void V0CustomElement::attributeDidChange(Element* element,
120 const AtomicString& name, 126 const AtomicString& name,
(...skipping 30 matching lines...) Expand all
151 break; 157 break;
152 158
153 case Element::V0WaitingForUpgrade: 159 case Element::V0WaitingForUpgrade:
154 case Element::V0Upgraded: 160 case Element::V0Upgraded:
155 V0CustomElementObserver::notifyElementWasDestroyed(element); 161 V0CustomElementObserver::notifyElementWasDestroyed(element);
156 break; 162 break;
157 } 163 }
158 } 164 }
159 165
160 } // namespace blink 166 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698