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

Side by Side Diff: Source/bindings/templates/interface.h

Issue 331593006: Decrease the binary size by 50 KB by outlining V8XXX::wrap() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/bindings/templates/interface.cpp » ('j') | 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 { 193 {
194 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackIn fo.GetIsolate())); 194 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackIn fo.GetIsolate()));
195 } 195 }
196 196
197 template<class CallbackInfo, class Wrappable> 197 template<class CallbackInfo, class Wrappable>
198 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, {{cpp_class}} * impl, Wrappable*) 198 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, {{cpp_class}} * impl, Wrappable*)
199 { 199 {
200 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackIn fo.GetIsolate())); 200 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackIn fo.GetIsolate()));
201 } 201 }
202 {% else %}{# has_custom_to_v8 #} 202 {% else %}{# has_custom_to_v8 #}
203 {% if has_custom_wrap or special_wrap_for or is_document %}
204 v8::Handle<v8::Object> wrap({{cpp_class}}* impl, v8::Handle<v8::Object> creation Context, v8::Isolate*); 203 v8::Handle<v8::Object> wrap({{cpp_class}}* impl, v8::Handle<v8::Object> creation Context, v8::Isolate*);
205 {% else %}
206 inline v8::Handle<v8::Object> wrap({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate)
207 {
208 ASSERT(impl);
209 ASSERT(!DOMDataStore::containsWrapper<{{v8_class}}>(impl, isolate));
210 return {{v8_class}}::createWrapper(impl, creationContext, isolate);
211 }
212 {% endif %}
213 204
214 inline v8::Handle<v8::Value> toV8({{cpp_class}}* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate) 205 inline v8::Handle<v8::Value> toV8({{cpp_class}}* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate)
215 { 206 {
216 if (UNLIKELY(!impl)) 207 if (UNLIKELY(!impl))
217 return v8::Null(isolate); 208 return v8::Null(isolate);
218 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<{{v8_class}}>(impl, isolate); 209 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<{{v8_class}}>(impl, isolate);
219 if (!wrapper.IsEmpty()) 210 if (!wrapper.IsEmpty())
220 return wrapper; 211 return wrapper;
221 return wrap(impl, creationContext, isolate); 212 return wrap(impl, creationContext, isolate);
222 } 213 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); 276 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
286 } 277 }
287 278
288 {% if has_event_constructor %} 279 {% if has_event_constructor %}
289 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); 280 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = "");
290 281
291 {% endif %} 282 {% endif %}
292 } 283 }
293 {% endfilter %} 284 {% endfilter %}
294 #endif // {{v8_class}}_h 285 #endif // {{v8_class}}_h
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698