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