Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / tests / results / V8TestSpecialOperationsCustom.h
1 /*
2  * Copyright (C) 2013 Google Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  *
8  *     * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *     * Redistributions in binary form must reproduce the above
11  * copyright notice, this list of conditions and the following disclaimer
12  * in the documentation and/or other materials provided with the
13  * distribution.
14  *     * Neither the name of Google Inc. nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30
31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
32
33 #ifndef V8TestSpecialOperationsCustom_h
34 #define V8TestSpecialOperationsCustom_h
35
36 #include "bindings/tests/idls/TestSpecialOperationsCustom.h"
37 #include "bindings/v8/V8Binding.h"
38 #include "bindings/v8/V8DOMWrapper.h"
39 #include "bindings/v8/WrapperTypeInfo.h"
40 #include "heap/Handle.h"
41
42 namespace WebCore {
43
44 class V8TestSpecialOperationsCustom {
45 public:
46     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*);
47     static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
48     static TestSpecialOperationsCustom* toNative(v8::Handle<v8::Object> object)
49     {
50         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
51     }
52     static const WrapperTypeInfo wrapperTypeInfo;
53     static void derefObject(void*);
54     static void indexedPropertyGetterCustom(uint32_t, const v8::PropertyCallbackInfo<v8::Value>&);
55     static void indexedPropertySetterCustom(uint32_t, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&);
56     static void indexedPropertyDeleterCustom(uint32_t, const v8::PropertyCallbackInfo<v8::Boolean>&);
57     static void namedPropertyGetterCustom(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>&);
58     static void namedPropertySetterCustom(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&);
59     static void namedPropertyQueryCustom(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Integer>&);
60     static void namedPropertyDeleterCustom(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Boolean>&);
61     static void namedPropertyEnumeratorCustom(const v8::PropertyCallbackInfo<v8::Array>&);
62     static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
63     static inline void* toInternalPointer(TestSpecialOperationsCustom* impl)
64     {
65         return impl;
66     }
67
68     static inline TestSpecialOperationsCustom* fromInternalPointer(void* object)
69     {
70         return static_cast<TestSpecialOperationsCustom*>(object);
71     }
72     static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestSpecialOperationsCustom*, v8::Isolate*) { }
73     static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
74
75 private:
76     friend v8::Handle<v8::Object> wrap(TestSpecialOperationsCustom*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
77     static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestSpecialOperationsCustom>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
78 };
79
80 template<>
81 class WrapperTypeTraits<TestSpecialOperationsCustom > {
82 public:
83     static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestSpecialOperationsCustom::wrapperTypeInfo; }
84 };
85
86 inline v8::Handle<v8::Object> wrap(TestSpecialOperationsCustom* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
87 {
88     ASSERT(impl);
89     ASSERT(!DOMDataStore::containsWrapper<V8TestSpecialOperationsCustom>(impl, isolate));
90     return V8TestSpecialOperationsCustom::createWrapper(impl, creationContext, isolate);
91 }
92
93 inline v8::Handle<v8::Value> toV8(TestSpecialOperationsCustom* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
94 {
95     if (UNLIKELY(!impl))
96         return v8::Null(isolate);
97     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestSpecialOperationsCustom>(impl, isolate);
98     if (!wrapper.IsEmpty())
99         return wrapper;
100     return wrap(impl, creationContext, isolate);
101 }
102
103 template<typename CallbackInfo>
104 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestSpecialOperationsCustom* impl)
105 {
106     if (UNLIKELY(!impl)) {
107         v8SetReturnValueNull(callbackInfo);
108         return;
109     }
110     if (DOMDataStore::setReturnValueFromWrapper<V8TestSpecialOperationsCustom>(callbackInfo.GetReturnValue(), impl))
111         return;
112     v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
113     v8SetReturnValue(callbackInfo, wrapper);
114 }
115
116 template<typename CallbackInfo>
117 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestSpecialOperationsCustom* impl)
118 {
119     ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
120     if (UNLIKELY(!impl)) {
121         v8SetReturnValueNull(callbackInfo);
122         return;
123     }
124     if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestSpecialOperationsCustom>(callbackInfo.GetReturnValue(), impl))
125         return;
126     v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
127     v8SetReturnValue(callbackInfo, wrapper);
128 }
129
130 template<class CallbackInfo, class Wrappable>
131 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestSpecialOperationsCustom* impl, Wrappable* wrappable)
132 {
133     if (UNLIKELY(!impl)) {
134         v8SetReturnValueNull(callbackInfo);
135         return;
136     }
137     if (DOMDataStore::setReturnValueFromWrapperFast<V8TestSpecialOperationsCustom>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
138         return;
139     v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
140     v8SetReturnValue(callbackInfo, wrapper);
141 }
142
143 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestSpecialOperationsCustom> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
144 {
145     return toV8(impl.get(), creationContext, isolate);
146 }
147
148 template<class CallbackInfo>
149 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestSpecialOperationsCustom> impl)
150 {
151     v8SetReturnValue(callbackInfo, impl.get());
152 }
153
154 template<class CallbackInfo>
155 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestSpecialOperationsCustom> impl)
156 {
157     v8SetReturnValueForMainWorld(callbackInfo, impl.get());
158 }
159
160 template<class CallbackInfo, class Wrappable>
161 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestSpecialOperationsCustom> impl, Wrappable* wrappable)
162 {
163     v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
164 }
165
166 }
167 #endif // V8TestSpecialOperationsCustom_h