| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 { | 195 { |
| 196 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate())); | 196 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate())); |
| 197 } | 197 } |
| 198 | 198 |
| 199 template<typename CallbackInfo> | 199 template<typename CallbackInfo> |
| 200 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, {{cpp_class}}
* impl, const ScriptWrappable*) | 200 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, {{cpp_class}}
* impl, const ScriptWrappable*) |
| 201 { | 201 { |
| 202 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate())); | 202 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate())); |
| 203 } | 203 } |
| 204 | 204 |
| 205 {% elif has_custom_wrap %} | |
| 206 v8::Handle<v8::Object> wrapCustom({{cpp_class}}* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate*); | |
| 207 | |
| 208 inline v8::Handle<v8::Value> toV8({{cpp_class}}* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) | |
| 209 { | |
| 210 if (UNLIKELY(!impl)) | |
| 211 return v8::Null(isolate); | |
| 212 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate); | |
| 213 if (!wrapper.IsEmpty()) | |
| 214 return wrapper; | |
| 215 | |
| 216 return wrapCustom(impl, creationContext, isolate); | |
| 217 } | |
| 218 | |
| 219 template<typename CallbackInfo> | |
| 220 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}* im
pl) | |
| 221 { | |
| 222 if (UNLIKELY(!impl)) { | |
| 223 v8SetReturnValueNull(callbackInfo); | |
| 224 return; | |
| 225 } | |
| 226 if (DOMDataStore::setReturnValue(callbackInfo.GetReturnValue(), impl)) | |
| 227 return; | |
| 228 v8::Handle<v8::Object> wrapper = wrapCustom(impl, callbackInfo.Holder(), cal
lbackInfo.GetIsolate()); | |
| 229 v8SetReturnValue(callbackInfo, wrapper); | |
| 230 } | |
| 231 | |
| 232 template<typename CallbackInfo> | |
| 233 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, {{cpp
_class}}* impl) | |
| 234 { | |
| 235 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld()); | |
| 236 return v8SetReturnValue(callbackInfo, impl); | |
| 237 } | |
| 238 | |
| 239 template<typename CallbackInfo, typename Wrappable> | |
| 240 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, {{cpp_class}}
* impl, Wrappable*) | |
| 241 { | |
| 242 return v8SetReturnValue(callbackInfo, impl); | |
| 243 } | |
| 244 | |
| 245 {% elif not is_script_wrappable %} | 205 {% elif not is_script_wrappable %} |
| 246 inline v8::Handle<v8::Value> toV8({{cpp_class}}* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) | 206 inline v8::Handle<v8::Value> toV8({{cpp_class}}* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) |
| 247 { | 207 { |
| 248 ScriptWrappableBase* scriptWrappableBase = impl ? impl->toScriptWrappableBas
e() : 0; | 208 ScriptWrappableBase* scriptWrappableBase = impl ? impl->toScriptWrappableBas
e() : 0; |
| 249 return toV8(scriptWrappableBase, creationContext, isolate, &{{v8_class}}::wr
apperTypeInfo); | 209 return toV8(scriptWrappableBase, creationContext, isolate, &{{v8_class}}::wr
apperTypeInfo); |
| 250 } | 210 } |
| 251 | 211 |
| 252 template<typename CallbackInfo> | 212 template<typename CallbackInfo> |
| 253 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}* im
pl) | 213 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}* im
pl) |
| 254 { | 214 { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 275 | 235 |
| 276 {% endif %}{# has_custom_to_v8 #} | 236 {% endif %}{# has_custom_to_v8 #} |
| 277 {% if has_event_constructor %} | 237 {% if has_event_constructor %} |
| 278 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta
te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); | 238 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta
te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); |
| 279 | 239 |
| 280 {% endif %} | 240 {% endif %} |
| 281 } // namespace blink | 241 } // namespace blink |
| 282 {% endfilter %} | 242 {% endfilter %} |
| 283 | 243 |
| 284 #endif // {{v8_class}}_h | 244 #endif // {{v8_class}}_h |
| OLD | NEW |