107a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch// Copyright 2014 The Chromium Authors. All rights reserved. 207a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch// Use of this source code is governed by a BSD-style license that can be 307a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch// found in the LICENSE file. 4591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 507a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch// This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 6591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 7d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)#ifndef V8SVGTestInterface_h 8d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)#define V8SVGTestInterface_h 9591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 10e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)#include "bindings/core/v8/ScriptWrappable.h" 11197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch#include "bindings/core/v8/V8Binding.h" 12197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch#include "bindings/core/v8/V8DOMWrapper.h" 13197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch#include "bindings/core/v8/WrapperTypeInfo.h" 147242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci#include "bindings/tests/idls/core/SVGTestInterface.h" 1510f88d5669dbd969c059d61ba09fa37dd72ac559Ben Murdoch#include "platform/heap/Handle.h" 16591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 17c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)namespace blink { 18591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 19d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)class V8SVGTestInterface { 20591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdochpublic: 2109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*); 22d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Value>, v8::Isolate*); 23d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); 247242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci static SVGTestInterface* toImpl(v8::Handle<v8::Object> object) 25591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch { 267242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci return toImpl(blink::toScriptWrappableBase(object)); 27591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch } 287242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci static SVGTestInterface* toImplWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>); 29f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) static const WrapperTypeInfo wrapperTypeInfo; 307242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci static void refObject(ScriptWrappableBase* internalPointer); 31e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles) static void derefObject(ScriptWrappableBase* internalPointer); 327242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci static WrapperPersistentNode* createPersistentHandle(ScriptWrappableBase* internalPointer); 33591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; 347242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci static inline ScriptWrappableBase* toScriptWrappableBase(SVGTestInterface* impl) 35e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch { 367242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci return impl->toScriptWrappableBase(); 37e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch } 38e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch 397242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci static inline SVGTestInterface* toImpl(ScriptWrappableBase* internalPointer) 40e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch { 417242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci return internalPointer->toImpl<SVGTestInterface>(); 42e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch } 43e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles) static void installConditionallyEnabledProperties(v8::Handle<v8::Object>, v8::Isolate*) { } 44e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles) static void installConditionallyEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { } 45c0e19a689c8ac22cdc96b291a8d33a5d3b0b34a4Torne (Richard Coles) 46591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdochprivate: 47591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch}; 48591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 497242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucciinline v8::Handle<v8::Object> wrap(SVGTestInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 507242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci{ 517242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci return impl->wrap(creationContext, isolate); 527242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci} 53591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 54d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)inline v8::Handle<v8::Value> toV8(SVGTestInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 55591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch{ 56591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch if (UNLIKELY(!impl)) 57a854de003a23bf3c7f95ec0f8154ada64092ff5cTorne (Richard Coles) return v8::Null(isolate); 58d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8SVGTestInterface>(impl, isolate); 59591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch if (!wrapper.IsEmpty()) 60591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch return wrapper; 617242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci 627242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci return impl->wrap(creationContext, isolate); 63591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch} 64591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 65e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)template<typename CallbackInfo> 66d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)inline void v8SetReturnValue(const CallbackInfo& callbackInfo, SVGTestInterface* impl) 67591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch{ 68e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) if (UNLIKELY(!impl)) { 69e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) v8SetReturnValueNull(callbackInfo); 70e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) return; 71e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) } 72d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) if (DOMDataStore::setReturnValueFromWrapper<V8SVGTestInterface>(callbackInfo.GetReturnValue(), impl)) 73e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) return; 74f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()); 75e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) v8SetReturnValue(callbackInfo, wrapper); 76e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)} 77e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) 78e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)template<typename CallbackInfo> 79d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, SVGTestInterface* impl) 80e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles){ 81f5f02c98d2d694be40c6182631462fff13b4a479Ben Murdoch ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld()); 82e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) if (UNLIKELY(!impl)) { 83e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) v8SetReturnValueNull(callbackInfo); 84e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) return; 85e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) } 86d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8SVGTestInterface>(callbackInfo.GetReturnValue(), impl)) 87e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) return; 88f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()); 89e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) v8SetReturnValue(callbackInfo, wrapper); 90591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch} 91591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 92e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdochtemplate<class CallbackInfo, class Wrappable> 93d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, SVGTestInterface* impl, Wrappable* wrappable) 94591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch{ 95e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) if (UNLIKELY(!impl)) { 96e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) v8SetReturnValueNull(callbackInfo); 97e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) return; 98e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) } 99d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) if (DOMDataStore::setReturnValueFromWrapperFast<V8SVGTestInterface>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) 100e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) return; 101e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()); 102e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) v8SetReturnValue(callbackInfo, wrapper); 103591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch} 104591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 105d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)inline v8::Handle<v8::Value> toV8(PassRefPtr<SVGTestInterface> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 106591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch{ 107e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) return toV8(impl.get(), creationContext, isolate); 108591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch} 109591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 110e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)template<class CallbackInfo> 111d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<SVGTestInterface> impl) 112e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles){ 113f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) v8SetReturnValue(callbackInfo, impl.get()); 114e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)} 115591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 116e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)template<class CallbackInfo> 117d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<SVGTestInterface> impl) 118591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch{ 119f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) v8SetReturnValueForMainWorld(callbackInfo, impl.get()); 120591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch} 121591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 122e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)template<class CallbackInfo, class Wrappable> 123d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<SVGTestInterface> impl, Wrappable* wrappable) 124591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch{ 125e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); 126591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch} 127591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 1287242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci} // namespace blink 129d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)#endif // V8SVGTestInterface_h 130