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

Side by Side Diff: Source/bindings/templates/interface.cpp

Issue 186673002: Support deprecation + use counters for constructor attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 {% extends 'interface_base.cpp' %} 1 {% extends 'interface_base.cpp' %}
2 2
3 3
4 {##############################################################################} 4 {##############################################################################}
5 {% macro attribute_configuration(attribute) %} 5 {% macro attribute_configuration(attribute) %}
6 {% set getter_callback = 6 {% set getter_callback =
7 '%sV8Internal::%sAttributeGetterCallback' % 7 '%sV8Internal::%sAttributeGetterCallback' %
8 (cpp_class, attribute.name) 8 (cpp_class, attribute.name)
9 if not attribute.constructor_type else 9 if not attribute.constructor_type else
10 '{0}V8Internal::{0}ConstructorGetter'.format(cpp_class) %} 10 ('%sV8Internal::%sConstructorGetterCallback' %
11 (cpp_class, attribute.name)
12 if attribute.needs_constructor_callback else
13 '{0}V8Internal::{0}ConstructorGetter'.format(cpp_class)) %}
11 {% set getter_callback_for_main_world = 14 {% set getter_callback_for_main_world =
12 '%sV8Internal::%sAttributeGetterCallbackForMainWorld' % 15 '%sV8Internal::%sAttributeGetterCallbackForMainWorld' %
13 (cpp_class, attribute.name) 16 (cpp_class, attribute.name)
14 if attribute.is_per_world_bindings else '0' %} 17 if attribute.is_per_world_bindings else '0' %}
15 {% set setter_callback = attribute.setter_callback %} 18 {% set setter_callback = attribute.setter_callback %}
16 {% set setter_callback_for_main_world = 19 {% set setter_callback_for_main_world =
17 '%sV8Internal::%sAttributeSetterCallbackForMainWorld' % 20 '%sV8Internal::%sAttributeSetterCallbackForMainWorld' %
18 (cpp_class, attribute.name) 21 (cpp_class, attribute.name)
19 if attribute.is_per_world_bindings and 22 if attribute.is_per_world_bindings and
20 (not attribute.is_read_only or attribute.put_forwards) else '0' %} 23 (not attribute.is_read_only or attribute.put_forwards) else '0' %}
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 ASSERT(data->IsExternal()); 70 ASSERT(data->IsExternal());
68 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre ationContext()); 71 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre ationContext());
69 if (!perContextData) 72 if (!perContextData)
70 return; 73 return;
71 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u nwrap(data))); 74 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u nwrap(data)));
72 } 75 }
73 76
74 {% endif %} 77 {% endif %}
75 {% endblock %} 78 {% endblock %}
76 79
77
78 {##############################################################################} 80 {##############################################################################}
79 {% block replaceable_attribute_setter_and_callback %} 81 {% block replaceable_attribute_setter_and_callback %}
80 {% if has_replaceable_attributes or has_constructor_attributes %} 82 {% if has_replaceable_attributes or has_constructor_attributes %}
81 {# FIXME: rename to ForceSetAttributeOnThis, since also used for Constructors #} 83 {# FIXME: rename to ForceSetAttributeOnThis, since also used for Constructors #}
82 static void {{cpp_class}}ReplaceableAttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 84 static void {{cpp_class}}ReplaceableAttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
83 { 85 {
84 {% if is_check_security %} 86 {% if is_check_security %}
85 {{cpp_class}}* imp = {{v8_class}}::toNative(info.Holder()); 87 {{cpp_class}}* imp = {{v8_class}}::toNative(info.Holder());
86 v8::String::Utf8Value attributeName(name); 88 v8::String::Utf8Value attributeName(name);
87 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "{{interface_name}}", info.Holder(), info.GetIsolate()); 89 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "{{interface_name}}", info.Holder(), info.GetIsolate());
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1317 {% endfilter %} 1319 {% endfilter %}
1318 } 1320 }
1319 1321
1320 template<> 1322 template<>
1321 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 1323 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate)
1322 { 1324 {
1323 return toV8(impl, creationContext, isolate); 1325 return toV8(impl, creationContext, isolate);
1324 } 1326 }
1325 1327
1326 {% endblock %} 1328 {% endblock %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698