| 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 not is_script_wrappable %} | |
| 206 inline v8::Handle<v8::Value> toV8({{cpp_class}}* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) | |
| 207 { | |
| 208 ScriptWrappableBase* scriptWrappableBase = impl ? impl->toScriptWrappableBas
e() : 0; | |
| 209 return toV8(scriptWrappableBase, creationContext, isolate, &{{v8_class}}::wr
apperTypeInfo); | |
| 210 } | |
| 211 | |
| 212 template<typename CallbackInfo> | |
| 213 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}* im
pl) | |
| 214 { | |
| 215 ScriptWrappableBase* scriptWrappableBase = impl ? impl->toScriptWrappableBas
e() : 0; | |
| 216 return v8SetReturnValue(callbackInfo, scriptWrappableBase, &{{v8_class}}::wr
apperTypeInfo); | |
| 217 } | |
| 218 | |
| 219 template<typename CallbackInfo> | |
| 220 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, {{cpp
_class}}* impl) | |
| 221 { | |
| 222 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld()); | |
| 223 // Since |impl| is not ScriptWrappable, it doesn't matter much if it's the | |
| 224 // main world or not. | |
| 225 return v8SetReturnValue(callbackInfo, impl); | |
| 226 } | |
| 227 | |
| 228 template<typename CallbackInfo, typename Wrappable> | |
| 229 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, {{cpp_class}}
* impl, Wrappable*) | |
| 230 { | |
| 231 // Since |impl| is not ScriptWrappable, it doesn't matter much if it's the | |
| 232 // main world or not. | |
| 233 return v8SetReturnValue(callbackInfo, impl); | |
| 234 } | |
| 235 | |
| 236 {% endif %}{# has_custom_to_v8 #} | 205 {% endif %}{# has_custom_to_v8 #} |
| 237 {% if has_event_constructor %} | 206 {% if has_event_constructor %} |
| 238 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta
te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); | 207 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta
te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); |
| 239 | 208 |
| 240 {% endif %} | 209 {% endif %} |
| 241 } // namespace blink | 210 } // namespace blink |
| 242 {% endfilter %} | 211 {% endfilter %} |
| 243 | 212 |
| 244 #endif // {{v8_class}}_h | 213 #endif // {{v8_class}}_h |
| OLD | NEW |