Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / tests / results / V8TestInterfacePython.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 V8TestInterfacePython_h
34 #define V8TestInterfacePython_h
35
36 #if ENABLE(CONDITION)
37 #include "V8TestInterfaceEmpty.h"
38 #include "bindings/tests/idls/TestInterfacePythonImplementation.h"
39 #include "bindings/v8/V8Binding.h"
40 #include "bindings/v8/V8DOMWrapper.h"
41 #include "bindings/v8/WrapperTypeInfo.h"
42 #include "heap/Handle.h"
43
44 namespace WebCore {
45
46 class V8TestInterfacePython {
47 public:
48     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*);
49     static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
50     static TestInterfacePythonImplementation* toNative(v8::Handle<v8::Object> object)
51     {
52         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
53     }
54     static const WrapperTypeInfo wrapperTypeInfo;
55     static void derefObject(void*);
56     static void visitDOMWrapper(void*, const v8::Persistent<v8::Object>&, v8::Isolate*);
57     static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);
58     static void implementsCustomVoidMethodMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&);
59     static void legacyCallCustom(const v8::FunctionCallbackInfo<v8::Value>&);
60     static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
61     static inline void* toInternalPointer(TestInterfacePythonImplementation* impl)
62     {
63         return V8TestInterfaceEmpty::toInternalPointer(impl);
64     }
65
66     static inline TestInterfacePythonImplementation* fromInternalPointer(void* object)
67     {
68         return static_cast<TestInterfacePythonImplementation*>(V8TestInterfaceEmpty::fromInternalPointer(object));
69     }
70     static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestInterfacePythonImplementation*, v8::Isolate*);
71     static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
72
73 private:
74 };
75
76 template<>
77 class WrapperTypeTraits<TestInterfacePythonImplementation > {
78 public:
79     static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfacePython::wrapperTypeInfo; }
80 };
81
82 class TestInterfacePythonImplementation;
83 v8::Handle<v8::Value> toV8(TestInterfacePythonImplementation*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
84
85 template<class CallbackInfo>
86 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfacePythonImplementation* impl)
87 {
88     v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
89 }
90
91 template<class CallbackInfo>
92 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterfacePythonImplementation* impl)
93 {
94      v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
95 }
96
97 template<class CallbackInfo, class Wrappable>
98 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterfacePythonImplementation* impl, Wrappable*)
99 {
100      v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
101 }
102
103 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfacePythonImplementation> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
104 {
105     return toV8(impl.get(), creationContext, isolate);
106 }
107
108 template<class CallbackInfo>
109 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfacePythonImplementation> impl)
110 {
111     v8SetReturnValue(callbackInfo, impl.get());
112 }
113
114 template<class CallbackInfo>
115 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfacePythonImplementation> impl)
116 {
117     v8SetReturnValueForMainWorld(callbackInfo, impl.get());
118 }
119
120 template<class CallbackInfo, class Wrappable>
121 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfacePythonImplementation> impl, Wrappable* wrappable)
122 {
123     v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
124 }
125
126 }
127 #endif // ENABLE(CONDITION)
128 #endif // V8TestInterfacePython_h