Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 {% extends 'interface_base.cpp' %} | 1 {% extends 'interface_base.cpp' %} |
| 2 | 2 |
| 3 | 3 |
| 4 {##############################################################################} | 4 {##############################################################################} |
| 5 {% block prepare_prototype_object %} | 5 {% block prepare_prototype_object %} |
|
haraken
2015/06/23 09:14:07
Would it be hard to remove the code duplication wi
Yuki
2015/06/23 12:41:38
Done.
| |
| 6 {% from 'interface.cpp' import install_unscopeables with context %} | 6 {% from 'interface.cpp' import install_unscopeables with context %} |
| 7 {% from 'methods.cpp' import install_conditionally_enabled_methods | 7 {% from 'methods.cpp' import install_conditionally_enabled_methods |
| 8 with context %} | 8 with context %} |
| 9 void {{v8_class_or_partial}}::preparePrototypeObject(v8::Isolate* isolate, v8::L ocal<v8::Object> prototypeObject) | 9 void {{v8_class_or_partial}}::preparePrototypeObject(v8::Isolate* isolate, v8::L ocal<v8::Object> prototypeObject, v8::Local<v8::FunctionTemplate> interfaceTempl ate) |
| 10 { | 10 { |
| 11 {{v8_class}}::preparePrototypeObject(isolate, prototypeObject); | 11 {{v8_class}}::preparePrototypeObject(isolate, prototypeObject, interfaceTemp late); |
| 12 {% if unscopeables %} | 12 {% if unscopeables %} |
| 13 {{install_unscopeables() | indent}} | 13 {{install_unscopeables() | indent}} |
| 14 {% endif %} | 14 {% endif %} |
| 15 {% if has_conditional_attributes_on_prototype %} | |
| 16 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont ext()); | |
|
haraken
2015/06/23 09:14:07
What is the ExecutionContext for?
Yuki
2015/06/23 12:41:38
Done.
| |
| 17 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTe mplate); | |
| 18 | |
| 19 {% for attribute in attributes if attribute.exposed_test and attribute.on_pr ototype %} | |
| 20 {% filter exposed(attribute.exposed_test) %} | |
| 21 static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {{attribute_configuration(attribute)}}; | |
| 22 V8DOMConfiguration::installAccessor(isolate, v8::Local<v8::Object>(), protot ypeObject, v8::Local<v8::Function>(), signature, accessorConfiguration); | |
| 23 {% endfilter %} | |
| 24 {% endfor %} | |
| 25 {% endif %} | |
| 15 {% if conditionally_enabled_methods %} | 26 {% if conditionally_enabled_methods %} |
| 16 {{install_conditionally_enabled_methods() | indent}} | 27 {{install_conditionally_enabled_methods() | indent}} |
| 17 {% endif %} | 28 {% endif %} |
| 18 } | 29 } |
| 19 | 30 |
| 20 {% endblock %} | 31 {% endblock %} |
| 21 | 32 |
| 22 | 33 |
| 23 {##############################################################################} | 34 {##############################################################################} |
| 24 {% block partial_interface %} | 35 {% block partial_interface %} |
| 25 void {{v8_class_or_partial}}::initialize() | 36 void {{v8_class_or_partial}}::initialize() |
| 26 { | 37 { |
| 27 // Should be invoked from initModules. | 38 // Should be invoked from initModules. |
| 28 {{v8_class}}::updateWrapperTypeInfo( | 39 {{v8_class}}::updateWrapperTypeInfo( |
| 29 &{{v8_class_or_partial}}::install{{v8_class}}Template, | 40 &{{v8_class_or_partial}}::install{{v8_class}}Template, |
| 30 &{{v8_class_or_partial}}::preparePrototypeObject); | 41 &{{v8_class_or_partial}}::preparePrototypeObject); |
| 31 {% for method in methods %} | 42 {% for method in methods %} |
| 32 {% if method.overloads and method.overloads.has_partial_overloads %} | 43 {% if method.overloads and method.overloads.has_partial_overloads %} |
| 33 {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInte rface(&{{cpp_class_or_partial}}V8Internal::{{method.name}}Method); | 44 {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInte rface(&{{cpp_class_or_partial}}V8Internal::{{method.name}}Method); |
| 34 {% endif %} | 45 {% endif %} |
| 35 {% endfor %} | 46 {% endfor %} |
| 36 } | 47 } |
| 37 | 48 |
| 38 {% endblock %} | 49 {% endblock %} |
| OLD | NEW |