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 3 // found in the LICENSE file. 4 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 6 7 #ifndef V8TestInterfaceCheckSecurity_h 8 #define V8TestInterfaceCheckSecurity_h 9 10 #include "bindings/tests/idls/TestInterfaceCheckSecurity.h" 11 #include "bindings/v8/V8Binding.h" 12 #include "bindings/v8/V8DOMWrapper.h" 13 #include "bindings/v8/WrapperTypeInfo.h" 14 #include "platform/heap/Handle.h" 15 16 namespace WebCore { 17 18 class V8TestInterfaceCheckSecurity { 19 public: 20 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*); 21 static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Value>, v8::Isolate*); 22 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); 23 static TestInterfaceCheckSecurity* toNative(v8::Handle<v8::Object> object) 24 { 25 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)); 26 } 27 static TestInterfaceCheckSecurity* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>); 28 static const WrapperTypeInfo wrapperTypeInfo; 29 static void derefObject(void*); 30 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; 31 static inline void* toInternalPointer(TestInterfaceCheckSecurity* impl) 32 { 33 return impl; 34 } 35 36 static inline TestInterfaceCheckSecurity* fromInternalPointer(void* object) 37 { 38 return static_cast<TestInterfaceCheckSecurity*>(object); 39 } 40 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestInterfaceCheckSecurity*, v8::Isolate*) { } 41 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { } 42 43 private: 44 friend v8::Handle<v8::Object> wrap(TestInterfaceCheckSecurity*, v8::Handle<v8::Object> creationContext, v8::Isolate*); 45 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterfaceCheckSecurity>, v8::Handle<v8::Object> creationContext, v8::Isolate*); 46 }; 47 48 v8::Handle<v8::Object> wrap(TestInterfaceCheckSecurity* impl, v8::Handle<v8::Object> creationContext, v8::Isolate*); 49 50 inline v8::Handle<v8::Value> toV8(TestInterfaceCheckSecurity* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 51 { 52 if (UNLIKELY(!impl)) 53 return v8::Null(isolate); 54 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceCheckSecurity>(impl, isolate); 55 if (!wrapper.IsEmpty()) 56 return wrapper; 57 return wrap(impl, creationContext, isolate); 58 } 59 60 template<typename CallbackInfo> 61 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceCheckSecurity* impl) 62 { 63 if (UNLIKELY(!impl)) { 64 v8SetReturnValueNull(callbackInfo); 65 return; 66 } 67 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceCheckSecurity>(callbackInfo.GetReturnValue(), impl)) 68 return; 69 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()); 70 v8SetReturnValue(callbackInfo, wrapper); 71 } 72 73 template<typename CallbackInfo> 74 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterfaceCheckSecurity* impl) 75 { 76 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld()); 77 if (UNLIKELY(!impl)) { 78 v8SetReturnValueNull(callbackInfo); 79 return; 80 } 81 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceCheckSecurity>(callbackInfo.GetReturnValue(), impl)) 82 return; 83 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()); 84 v8SetReturnValue(callbackInfo, wrapper); 85 } 86 87 template<class CallbackInfo, class Wrappable> 88 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterfaceCheckSecurity* impl, Wrappable* wrappable) 89 { 90 if (UNLIKELY(!impl)) { 91 v8SetReturnValueNull(callbackInfo); 92 return; 93 } 94 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceCheckSecurity>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) 95 return; 96 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()); 97 v8SetReturnValue(callbackInfo, wrapper); 98 } 99 100 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfaceCheckSecurity> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 101 { 102 return toV8(impl.get(), creationContext, isolate); 103 } 104 105 template<class CallbackInfo> 106 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceCheckSecurity> impl) 107 { 108 v8SetReturnValue(callbackInfo, impl.get()); 109 } 110 111 template<class CallbackInfo> 112 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceCheckSecurity> impl) 113 { 114 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); 115 } 116 117 template<class CallbackInfo, class Wrappable> 118 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceCheckSecurity> impl, Wrappable* wrappable) 119 { 120 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); 121 } 122 123 } 124 #endif // V8TestInterfaceCheckSecurity_h 125