Chromium Code Reviews| Index: Source/bindings/templates/interface.cpp |
| diff --git a/Source/bindings/templates/interface.cpp b/Source/bindings/templates/interface.cpp |
| index d26cbd2ef349ac23c4c48880e921b4a3e1d3dfd5..bd2957f50e203c45af3c8b4628959c051b365ca1 100644 |
| --- a/Source/bindings/templates/interface.cpp |
| +++ b/Source/bindings/templates/interface.cpp |
| @@ -2,25 +2,6 @@ |
| {##############################################################################} |
| -{% block security_check_functions %} |
| -{% if has_access_check_callbacks %} |
| -bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value>) |
| -{ |
| - {{cpp_class}}* impl = {{v8_class}}::toImpl(host); |
| - return BindingSecurity::shouldAllowAccessToFrame(v8::Isolate::GetCurrent(), impl->frame(), DoNotReportSecurityError); |
| -} |
| - |
| -bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value>) |
| -{ |
| - {{cpp_class}}* impl = {{v8_class}}::toImpl(host); |
| - return BindingSecurity::shouldAllowAccessToFrame(v8::Isolate::GetCurrent(), impl->frame(), DoNotReportSecurityError); |
| -} |
| - |
| -{% endif %} |
| -{% endblock %} |
| - |
| - |
| -{##############################################################################} |
| {% block indexed_property_getter %} |
| {% if indexed_property_getter and not indexed_property_getter.is_custom %} |
| {% set getter = indexed_property_getter %} |
| @@ -748,7 +729,8 @@ V8DOMConfiguration::installAttribute({{method.function_template}}, v8::Handle<v8 |
| {% block get_dom_template %} |
| v8::Handle<v8::FunctionTemplate> {{v8_class}}::domTemplate(v8::Isolate* isolate) |
| { |
| - return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), install{{v8_class}}Template); |
| +{% set installTemplateFunction = 'install%sTemplate' % v8_class if not has_partial_interface else '%s::install%sTemplateFunction' % (v8_class, v8_class) %} |
|
haraken
2014/10/09 04:24:01
Instead of using 'if not ... else ...', use 'if ..
tasak
2014/10/10 07:52:23
Done.
|
| + return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), {{installTemplateFunction}}); |
| } |
| {% endblock %} |
| @@ -967,3 +949,26 @@ v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c |
| } |
| {% endblock %} |
| + |
| +{##############################################################################} |
| +{% block partial_interface %} |
| +{% if has_partial_interface %} |
| +InstallTemplateFunction {{v8_class}}::install{{v8_class}}TemplateFunction = (InstallTemplateFunction)&{{v8_class}}::install{{v8_class}}Template; |
| + |
| +void {{v8_class}}::updateWrapperTypeInfo(InstallTemplateFunction installTemplateFunction, InstallConditionallyEnabledMethodsFunction installConditionallyEnabledMethodsFunction) |
| +{ |
| + {{v8_class}}::install{{v8_class}}TemplateFunction = installTemplateFunction; |
| + if (installConditionallyEnabledMethodsFunction) |
| + {{v8_class}}::wrapperTypeInfo.installConditionallyEnabledMethodsFunction = installConditionallyEnabledMethodsFunction; |
| +} |
| + |
| +{% for method in methods %} |
| +{% if method.overloads and method.overloads.partial_overloads %} |
| +void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInterface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) |
| +{ |
| + {{cpp_class}}{{empty_or_partial}}V8Internal::{{method.name}}MethodForPartialInterface = method; |
| +} |
| +{% endif %} |
| +{% endfor %} |
| +{% endif %} |
| +{% endblock %} |