Upstream version 7.35.144.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / tests / results / V8TestSpecialOperationsCustom.h
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 V8TestSpecialOperationsCustom_h
8 #define V8TestSpecialOperationsCustom_h
9
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"
15
16 namespace WebCore {
17
18 class V8TestSpecialOperationsCustom {
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 TestSpecialOperationsCustom* toNative(v8::Handle<v8::Object> object)
24     {
25         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
26     }
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)
40     {
41         return impl;
42     }
43
44     static inline TestSpecialOperationsCustom* fromInternalPointer(void* object)
45     {
46         return static_cast<TestSpecialOperationsCustom*>(object);
47     }
48     static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestSpecialOperationsCustom*, v8::Isolate*) { }
49     static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
50
51 private:
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*);
54 };
55
56 inline v8::Handle<v8::Object> wrap(TestSpecialOperationsCustom* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
57 {
58     ASSERT(impl);
59     ASSERT(!DOMDataStore::containsWrapper<V8TestSpecialOperationsCustom>(impl, isolate));
60     return V8TestSpecialOperationsCustom::createWrapper(impl, creationContext, isolate);
61 }
62
63 inline v8::Handle<v8::Value> toV8(TestSpecialOperationsCustom* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
64 {
65     if (UNLIKELY(!impl))
66         return v8::Null(isolate);
67     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestSpecialOperationsCustom>(impl, isolate);
68     if (!wrapper.IsEmpty())
69         return wrapper;
70     return wrap(impl, creationContext, isolate);
71 }
72
73 template<typename CallbackInfo>
74 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestSpecialOperationsCustom* impl)
75 {
76     if (UNLIKELY(!impl)) {
77         v8SetReturnValueNull(callbackInfo);
78         return;
79     }
80     if (DOMDataStore::setReturnValueFromWrapper<V8TestSpecialOperationsCustom>(callbackInfo.GetReturnValue(), impl))
81         return;
82     v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
83     v8SetReturnValue(callbackInfo, wrapper);
84 }
85
86 template<typename CallbackInfo>
87 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestSpecialOperationsCustom* impl)
88 {
89     ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate())->isMainWorld());
90     if (UNLIKELY(!impl)) {
91         v8SetReturnValueNull(callbackInfo);
92         return;
93     }
94     if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestSpecialOperationsCustom>(callbackInfo.GetReturnValue(), impl))
95         return;
96     v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
97     v8SetReturnValue(callbackInfo, wrapper);
98 }
99
100 template<class CallbackInfo, class Wrappable>
101 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestSpecialOperationsCustom* impl, Wrappable* wrappable)
102 {
103     if (UNLIKELY(!impl)) {
104         v8SetReturnValueNull(callbackInfo);
105         return;
106     }
107     if (DOMDataStore::setReturnValueFromWrapperFast<V8TestSpecialOperationsCustom>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
108         return;
109     v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
110     v8SetReturnValue(callbackInfo, wrapper);
111 }
112
113 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestSpecialOperationsCustom> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
114 {
115     return toV8(impl.get(), creationContext, isolate);
116 }
117
118 template<class CallbackInfo>
119 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestSpecialOperationsCustom> impl)
120 {
121     v8SetReturnValue(callbackInfo, impl.get());
122 }
123
124 template<class CallbackInfo>
125 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestSpecialOperationsCustom> impl)
126 {
127     v8SetReturnValueForMainWorld(callbackInfo, impl.get());
128 }
129
130 template<class CallbackInfo, class Wrappable>
131 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestSpecialOperationsCustom> impl, Wrappable* wrappable)
132 {
133     v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
134 }
135
136 }
137 #endif // V8TestSpecialOperationsCustom_h