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.
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
7 #ifndef V8TestSpecialOperationsCustom_h
8 #define V8TestSpecialOperationsCustom_h
10 #include "bindings/tests/idls/TestSpecialOperationsCustom.h"
11 #include "bindings/v8/V8Binding.h"
12 #include "bindings/v8/V8DOMWrapper.h"
13 #include "bindings/v8/WrapperTypeInfo.h"
14 #include "heap/Handle.h"
18 class V8TestSpecialOperationsCustom {
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 TestSpecialOperationsCustom* toNative(v8::Handle<v8::Object> object)
25 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
27 static TestSpecialOperationsCustom* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>);
28 static const WrapperTypeInfo wrapperTypeInfo;
29 static void derefObject(void*);
30 static void indexedPropertyGetterCustom(uint32_t, const v8::PropertyCallbackInfo<v8::Value>&);
31 static void indexedPropertySetterCustom(uint32_t, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&);
32 static void indexedPropertyDeleterCustom(uint32_t, const v8::PropertyCallbackInfo<v8::Boolean>&);
33 static void namedPropertyGetterCustom(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>&);
34 static void namedPropertySetterCustom(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&);
35 static void namedPropertyQueryCustom(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Integer>&);
36 static void namedPropertyDeleterCustom(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Boolean>&);
37 static void namedPropertyEnumeratorCustom(const v8::PropertyCallbackInfo<v8::Array>&);
38 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
39 static inline void* toInternalPointer(TestSpecialOperationsCustom* impl)
44 static inline TestSpecialOperationsCustom* fromInternalPointer(void* object)
46 return static_cast<TestSpecialOperationsCustom*>(object);
48 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestSpecialOperationsCustom*, v8::Isolate*) { }
49 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
52 friend v8::Handle<v8::Object> wrap(TestSpecialOperationsCustom*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
53 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestSpecialOperationsCustom>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
56 inline v8::Handle<v8::Object> wrap(TestSpecialOperationsCustom* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
59 ASSERT(!DOMDataStore::containsWrapper<V8TestSpecialOperationsCustom>(impl, isolate));
60 return V8TestSpecialOperationsCustom::createWrapper(impl, creationContext, isolate);
63 inline v8::Handle<v8::Value> toV8(TestSpecialOperationsCustom* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
66 return v8::Null(isolate);
67 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestSpecialOperationsCustom>(impl, isolate);
68 if (!wrapper.IsEmpty())
70 return wrap(impl, creationContext, isolate);
73 template<typename CallbackInfo>
74 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestSpecialOperationsCustom* impl)
76 if (UNLIKELY(!impl)) {
77 v8SetReturnValueNull(callbackInfo);
80 if (DOMDataStore::setReturnValueFromWrapper<V8TestSpecialOperationsCustom>(callbackInfo.GetReturnValue(), impl))
82 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
83 v8SetReturnValue(callbackInfo, wrapper);
86 template<typename CallbackInfo>
87 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestSpecialOperationsCustom* impl)
89 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate())->isMainWorld());
90 if (UNLIKELY(!impl)) {
91 v8SetReturnValueNull(callbackInfo);
94 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestSpecialOperationsCustom>(callbackInfo.GetReturnValue(), impl))
96 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
97 v8SetReturnValue(callbackInfo, wrapper);
100 template<class CallbackInfo, class Wrappable>
101 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestSpecialOperationsCustom* impl, Wrappable* wrappable)
103 if (UNLIKELY(!impl)) {
104 v8SetReturnValueNull(callbackInfo);
107 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestSpecialOperationsCustom>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
109 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
110 v8SetReturnValue(callbackInfo, wrapper);
113 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestSpecialOperationsCustom> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
115 return toV8(impl.get(), creationContext, isolate);
118 template<class CallbackInfo>
119 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestSpecialOperationsCustom> impl)
121 v8SetReturnValue(callbackInfo, impl.get());
124 template<class CallbackInfo>
125 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestSpecialOperationsCustom> impl)
127 v8SetReturnValueForMainWorld(callbackInfo, impl.get());
130 template<class CallbackInfo, class Wrappable>
131 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestSpecialOperationsCustom> impl, Wrappable* wrappable)
133 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
137 #endif // V8TestSpecialOperationsCustom_h