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

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

Issue 109943003: IDL compiler: [ConstructorCallWith] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add FIXME Created 7 years 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 | Annotate | Revision Log
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 (interface_name, attribute.name) 8 (interface_name, attribute.name)
9 if not attribute.constructor_type else 9 if not attribute.constructor_type else
10 '{0}V8Internal::{0}ConstructorGetter'.format(interface_name) %} 10 '{0}V8Internal::{0}ConstructorGetter'.format(interface_name) %}
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 {##############################################################################} 131 {##############################################################################}
132 {% block constructor %} 132 {% block constructor %}
133 {% if has_constructor %} 133 {% if has_constructor %}
134 {# FIXME: support overloading #} 134 {# FIXME: support overloading #}
135 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 135 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
136 { 136 {
137 {% if is_constructor_raises_exception %} 137 {% if is_constructor_raises_exception %}
138 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); 138 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
139 {% endif %} 139 {% endif %}
140 {% if is_constructor_call_with_execution_context %}
141 ExecutionContext* context = getExecutionContext();
142 {% endif %}
143 {% if is_constructor_call_with_document %}
144 Document& document = *toDocument(getExecutionContext());
145 {% endif %}
140 RefPtr<{{cpp_class}}> impl = {{cpp_class}}::create({{constructor_arguments | join(', ')}}); 146 RefPtr<{{cpp_class}}> impl = {{cpp_class}}::create({{constructor_arguments | join(', ')}});
141 v8::Handle<v8::Object> wrapper = info.Holder(); 147 v8::Handle<v8::Object> wrapper = info.Holder();
142 {% if is_constructor_raises_exception %} 148 {% if is_constructor_raises_exception %}
143 if (exceptionState.throwIfNeeded()) 149 if (exceptionState.throwIfNeeded())
144 return; 150 return;
145 {% endif %} 151 {% endif %}
146 152
147 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{v8 _class}}::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dep endent); 153 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{v8 _class}}::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dep endent);
148 v8SetReturnValue(info, wrapper); 154 v8SetReturnValue(info, wrapper);
149 } 155 }
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 fromInternalPointer(object)->deref(); 626 fromInternalPointer(object)->deref();
621 } 627 }
622 628
623 template<> 629 template<>
624 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 630 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate)
625 { 631 {
626 return toV8(impl, creationContext, isolate); 632 return toV8(impl, creationContext, isolate);
627 } 633 }
628 634
629 {% endblock %} 635 {% endblock %}
OLDNEW
« no previous file with comments | « Source/bindings/scripts/unstable/v8_interface.py ('k') | Source/bindings/tests/idls/TestInterfaceConstructor.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698