| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 {% else %}{# has_custom_to_v8 #} | 213 {% else %}{# has_custom_to_v8 #} |
| 214 v8::Handle<v8::Object> wrap({{cpp_class}}* impl, v8::Handle<v8::Object> creation
Context, v8::Isolate*); | 214 v8::Handle<v8::Object> wrap({{cpp_class}}* impl, v8::Handle<v8::Object> creation
Context, v8::Isolate*); |
| 215 | 215 |
| 216 inline v8::Handle<v8::Value> toV8({{cpp_class}}* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) | 216 inline v8::Handle<v8::Value> toV8({{cpp_class}}* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) |
| 217 { | 217 { |
| 218 if (UNLIKELY(!impl)) | 218 if (UNLIKELY(!impl)) |
| 219 return v8::Null(isolate); | 219 return v8::Null(isolate); |
| 220 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<{{v8_class}}>(impl,
isolate); | 220 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<{{v8_class}}>(impl,
isolate); |
| 221 if (!wrapper.IsEmpty()) | 221 if (!wrapper.IsEmpty()) |
| 222 return wrapper; | 222 return wrapper; |
| 223 |
| 224 {% if is_script_wrappable %} |
| 225 return impl->wrap(creationContext, isolate); |
| 226 {% else %} |
| 223 return wrap(impl, creationContext, isolate); | 227 return wrap(impl, creationContext, isolate); |
| 228 {% endif %} |
| 224 } | 229 } |
| 225 | 230 |
| 226 template<typename CallbackInfo> | 231 template<typename CallbackInfo> |
| 227 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}* im
pl) | 232 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}* im
pl) |
| 228 { | 233 { |
| 229 if (UNLIKELY(!impl)) { | 234 if (UNLIKELY(!impl)) { |
| 230 v8SetReturnValueNull(callbackInfo); | 235 v8SetReturnValueNull(callbackInfo); |
| 231 return; | 236 return; |
| 232 } | 237 } |
| 233 if (DOMDataStore::setReturnValueFromWrapper<{{v8_class}}>(callbackInfo.GetRe
turnValue(), impl)) | 238 if (DOMDataStore::setReturnValueFromWrapper<{{v8_class}}>(callbackInfo.GetRe
turnValue(), impl)) |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 292 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
| 288 } | 293 } |
| 289 | 294 |
| 290 {% if has_event_constructor %} | 295 {% if has_event_constructor %} |
| 291 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta
te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); | 296 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta
te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); |
| 292 | 297 |
| 293 {% endif %} | 298 {% endif %} |
| 294 } // namespace blink | 299 } // namespace blink |
| 295 {% endfilter %} | 300 {% endfilter %} |
| 296 #endif // {{v8_class}}_h | 301 #endif // {{v8_class}}_h |
| OLD | NEW |