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

Unified Diff: Source/bindings/templates/interface.h

Issue 684763004: bindings: Fixes perf regression by crrev.com/646523004. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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*);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698