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

Unified Diff: Source/bindings/templates/attributes.cpp

Issue 186673002: Support deprecation + use counters for constructor attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Always generate constructor getter callbacks Created 6 years, 10 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
« no previous file with comments | « no previous file | Source/bindings/templates/interface.cpp » ('j') | Source/bindings/templates/interface.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/attributes.cpp
diff --git a/Source/bindings/templates/attributes.cpp b/Source/bindings/templates/attributes.cpp
index 0cd34be6b84c5db36644981eb38a9f3fdd019a39..3ff9de9afb9b0f93e8fb9fcd18b1f98f33b834ad 100644
--- a/Source/bindings/templates/attributes.cpp
+++ b/Source/bindings/templates/attributes.cpp
@@ -182,6 +182,24 @@ v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info
{% endfilter %}
{% endmacro %}
+{##############################################################################}
Nils Barth (inactive) 2014/03/05 07:27:52 Could you add an extra blank line before this? (Se
sof 2014/03/05 12:45:48 Done.
+{% macro attribute_constructor_callback(attribute, world_suffix) %}
Nils Barth (inactive) 2014/03/05 07:27:52 This macro looks fine; there's overlap with the ge
+{% filter conditional(attribute.conditional_string) %}
+static void {{attribute.name}}ConstructorGetterCallback{{world_suffix}}(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ {% if attribute.deprecate_as %}
+ UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}});
+ {% endif %}
+ {% if attribute.measure_as %}
+ UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{attribute.measure_as}});
+ {% endif %}
+ {{cpp_class}}V8Internal::{{cpp_class}}ConstructorGetter{{world_suffix}}(property, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
+}
+{% endfilter %}
+{% endmacro %}
+
{##############################################################################}
{% macro attribute_setter(attribute, world_suffix) %}
« no previous file with comments | « no previous file | Source/bindings/templates/interface.cpp » ('j') | Source/bindings/templates/interface.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698