| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |