Chromium Code Reviews| Index: Source/bindings/templates/interface.h |
| diff --git a/Source/bindings/templates/interface.h b/Source/bindings/templates/interface.h |
| index b8f1de098386c98d26244c09aecfcd8cb9602fda..5c248f1702edb2a616f1a3276d00be27c4423ef9 100644 |
| --- a/Source/bindings/templates/interface.h |
| +++ b/Source/bindings/templates/interface.h |
| @@ -190,6 +190,12 @@ private: |
| {% if has_custom_to_v8 %} |
| v8::Handle<v8::Value> toV8({{cpp_class}}*, v8::Handle<v8::Object> creationContext, v8::Isolate*); |
|
haraken
2014/11/01 22:45:50
Can we rename this to toV8Custom (for consistency
Yuki
2014/11/04 05:48:17
Unlike wrap/wrapCustom, toV8 is used as a public A
|
| +{% if interface_name != 'EventTarget' %} |
| +{# EventTarget has custom toV8 just because Window has custom toV8. So it is not |
| + really necessary for EventTarget and its subclasses except for Window to call |
| + custom toV8 function in v8SetReturnValue. Especially Node and its subclasses |
| + are performance sensitive, so they should call optimized versions of |
| + v8SetReturnValue defined in bindings/core/v8/V8Binding.h. #} |
| template<typename CallbackInfo> |
| inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}* impl) |
| { |
| @@ -208,6 +214,7 @@ inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, {{cpp_class}} |
| v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate())); |
| } |
| +{% endif %}{# interface_name != 'EventTarget' #} |
| {% elif not is_script_wrappable %} |
| v8::Handle<v8::Object> wrap({{cpp_class}}* impl, v8::Handle<v8::Object> creationContext, v8::Isolate*); |