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

Side by Side 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, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by {{code_generator}}. DO NOT MODIFY! 5 // This file has been auto-generated by {{code_generator}}. DO NOT MODIFY!
6 6
7 #ifndef {{v8_class}}_h 7 #ifndef {{v8_class}}_h
8 #define {{v8_class}}_h 8 #define {{v8_class}}_h
9 9
10 {% filter conditional(conditional_string) %} 10 {% filter conditional(conditional_string) %}
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 static v8::Handle<v8::Object> createWrapper({{pass_cpp_type}}, v8::Handle<v8 ::Object> creationContext, v8::Isolate*); 181 static v8::Handle<v8::Object> createWrapper({{pass_cpp_type}}, v8::Handle<v8 ::Object> creationContext, v8::Isolate*);
182 {% endif %} 182 {% endif %}
183 {% if has_partial_interface %} 183 {% if has_partial_interface %}
184 184
185 private: 185 private:
186 static InstallTemplateFunction install{{v8_class}}TemplateFunction; 186 static InstallTemplateFunction install{{v8_class}}TemplateFunction;
187 {% endif %} 187 {% endif %}
188 }; 188 };
189 189
190 {% if has_custom_to_v8 %} 190 {% if has_custom_to_v8 %}
191 v8::Handle<v8::Value> toV8({{cpp_class}}*, v8::Handle<v8::Object> creationContex t, v8::Isolate*); 191 v8::Handle<v8::Value> toV8({{cpp_class}}*, v8::Handle<v8::Object> creationContex t, 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
192 192
193 {% if interface_name != 'EventTarget' %}
194 {# EventTarget has custom toV8 just because Window has custom toV8. So it is not
195 really necessary for EventTarget and its subclasses except for Window to call
196 custom toV8 function in v8SetReturnValue. Especially Node and its subclasses
197 are performance sensitive, so they should call optimized versions of
198 v8SetReturnValue defined in bindings/core/v8/V8Binding.h. #}
193 template<typename CallbackInfo> 199 template<typename CallbackInfo>
194 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}* im pl) 200 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}* im pl)
195 { 201 {
196 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf o.GetIsolate())); 202 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf o.GetIsolate()));
197 } 203 }
198 204
199 template<typename CallbackInfo> 205 template<typename CallbackInfo>
200 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, {{cpp _class}}* impl) 206 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, {{cpp _class}}* impl)
201 { 207 {
202 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackIn fo.GetIsolate())); 208 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackIn fo.GetIsolate()));
203 } 209 }
204 210
205 template<typename CallbackInfo> 211 template<typename CallbackInfo>
206 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, {{cpp_class}} * impl, const ScriptWrappable*) 212 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, {{cpp_class}} * impl, const ScriptWrappable*)
207 { 213 {
208 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackIn fo.GetIsolate())); 214 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackIn fo.GetIsolate()));
209 } 215 }
210 216
217 {% endif %}{# interface_name != 'EventTarget' #}
211 {% elif not is_script_wrappable %} 218 {% elif not is_script_wrappable %}
212 v8::Handle<v8::Object> wrap({{cpp_class}}* impl, v8::Handle<v8::Object> creation Context, v8::Isolate*); 219 v8::Handle<v8::Object> wrap({{cpp_class}}* impl, v8::Handle<v8::Object> creation Context, v8::Isolate*);
213 220
214 inline v8::Handle<v8::Value> toV8({{cpp_class}}* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate) 221 inline v8::Handle<v8::Value> toV8({{cpp_class}}* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate)
215 { 222 {
216 if (UNLIKELY(!impl)) 223 if (UNLIKELY(!impl))
217 return v8::Null(isolate); 224 return v8::Null(isolate);
218 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperNonTemplate(impl, is olate); 225 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperNonTemplate(impl, is olate);
219 if (!wrapper.IsEmpty()) 226 if (!wrapper.IsEmpty())
220 return wrapper; 227 return wrapper;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 271
265 {% endif %}{# has_custom_to_v8 #} 272 {% endif %}{# has_custom_to_v8 #}
266 {% if has_event_constructor %} 273 {% if has_event_constructor %}
267 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); 274 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = "");
268 275
269 {% endif %} 276 {% endif %}
270 } // namespace blink 277 } // namespace blink
271 {% endfilter %} 278 {% endfilter %}
272 279
273 #endif // {{v8_class}}_h 280 #endif // {{v8_class}}_h
OLDNEW
« 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