| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 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. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! | 31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! |
| 32 | 32 |
| 33 #ifndef V8TestInterfaceConstructor3_h | 33 #ifndef V8TestInterfaceInheritsNode_h |
| 34 #define V8TestInterfaceConstructor3_h | 34 #define V8TestInterfaceInheritsNode_h |
| 35 | 35 |
| 36 #include "bindings/tests/idls/TestInterfaceConstructor3.h" | 36 #include "V8Node.h" |
| 37 #include "bindings/tests/idls/TestInterfaceInheritsNode.h" |
| 37 #include "bindings/v8/V8Binding.h" | 38 #include "bindings/v8/V8Binding.h" |
| 38 #include "bindings/v8/V8DOMWrapper.h" | 39 #include "bindings/v8/V8DOMWrapper.h" |
| 39 #include "bindings/v8/WrapperTypeInfo.h" | 40 #include "bindings/v8/WrapperTypeInfo.h" |
| 40 | 41 |
| 41 namespace WebCore { | 42 namespace WebCore { |
| 42 | 43 |
| 43 class V8TestInterfaceConstructor3 { | 44 class V8TestInterfaceInheritsNode { |
| 44 public: | 45 public: |
| 45 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
e); | 46 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
e); |
| 46 static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); | 47 static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); |
| 47 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWor
ldType); | 48 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWor
ldType); |
| 48 static TestInterfaceConstructor3* toNative(v8::Handle<v8::Object> object) | 49 static TestInterfaceInheritsNode* toNative(v8::Handle<v8::Object> object) |
| 49 { | 50 { |
| 50 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); | 51 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); |
| 51 } | 52 } |
| 52 static void derefObject(void*); | 53 static void derefObject(void*); |
| 53 static const WrapperTypeInfo wrapperTypeInfo; | 54 static const WrapperTypeInfo wrapperTypeInfo; |
| 54 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 55 static EventTarget* toEventTarget(v8::Handle<v8::Object>); |
| 55 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | 56 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; |
| 56 static inline void* toInternalPointer(TestInterfaceConstructor3* impl) | 57 static inline void* toInternalPointer(TestInterfaceInheritsNode* impl) |
| 57 { | 58 { |
| 58 return impl; | 59 return V8Node::toInternalPointer(impl); |
| 59 } | 60 } |
| 60 | 61 |
| 61 static inline TestInterfaceConstructor3* fromInternalPointer(void* object) | 62 static inline TestInterfaceInheritsNode* fromInternalPointer(void* object) |
| 62 { | 63 { |
| 63 return static_cast<TestInterfaceConstructor3*>(object); | 64 return static_cast<TestInterfaceInheritsNode*>(V8Node::fromInternalPoint
er(object)); |
| 64 } | 65 } |
| 65 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestI
nterfaceConstructor3*, v8::Isolate*) { } | 66 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestI
nterfaceInheritsNode*, v8::Isolate*) { } |
| 66 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } | 67 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } |
| 67 | 68 |
| 68 private: | 69 private: |
| 69 friend v8::Handle<v8::Object> wrap(TestInterfaceConstructor3*, v8::Handle<v8
::Object> creationContext, v8::Isolate*); | 70 friend v8::Handle<v8::Object> wrap(TestInterfaceInheritsNode*, v8::Handle<v8
::Object> creationContext, v8::Isolate*); |
| 70 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterfaceConstruc
tor3>, v8::Handle<v8::Object> creationContext, v8::Isolate*); | 71 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterfaceInherits
Node>, v8::Handle<v8::Object> creationContext, v8::Isolate*); |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 template<> | 74 template<> |
| 74 class WrapperTypeTraits<TestInterfaceConstructor3 > { | 75 class WrapperTypeTraits<TestInterfaceInheritsNode > { |
| 75 public: | 76 public: |
| 76 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfaceCon
structor3::wrapperTypeInfo; } | 77 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfaceInh
eritsNode::wrapperTypeInfo; } |
| 77 }; | 78 }; |
| 78 | 79 |
| 79 inline v8::Handle<v8::Object> wrap(TestInterfaceConstructor3* impl, v8::Handle<v
8::Object> creationContext, v8::Isolate* isolate) | 80 inline v8::Handle<v8::Object> wrap(TestInterfaceInheritsNode* impl, v8::Handle<v
8::Object> creationContext, v8::Isolate* isolate) |
| 80 { | 81 { |
| 81 ASSERT(impl); | 82 ASSERT(impl); |
| 82 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceConstructor3>(impl, iso
late)); | 83 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceInheritsNode>(impl, iso
late)); |
| 83 return V8TestInterfaceConstructor3::createWrapper(impl, creationContext, iso
late); | 84 return V8TestInterfaceInheritsNode::createWrapper(impl, creationContext, iso
late); |
| 84 } | 85 } |
| 85 | 86 |
| 86 inline v8::Handle<v8::Value> toV8(TestInterfaceConstructor3* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) | 87 inline v8::Handle<v8::Value> toV8(TestInterfaceInheritsNode* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) |
| 87 { | 88 { |
| 88 if (UNLIKELY(!impl)) | 89 if (UNLIKELY(!impl)) |
| 89 return v8::Null(isolate); | 90 return v8::Null(isolate); |
| 90 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceCons
tructor3>(impl, isolate); | 91 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceInhe
ritsNode>(impl, isolate); |
| 91 if (!wrapper.IsEmpty()) | 92 if (!wrapper.IsEmpty()) |
| 92 return wrapper; | 93 return wrapper; |
| 93 return wrap(impl, creationContext, isolate); | 94 return wrap(impl, creationContext, isolate); |
| 94 } | 95 } |
| 95 | 96 |
| 96 template<typename CallbackInfo> | 97 template<typename CallbackInfo> |
| 97 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceCons
tructor3* impl) | 98 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceInhe
ritsNode* impl) |
| 98 { | 99 { |
| 99 if (UNLIKELY(!impl)) { | 100 if (UNLIKELY(!impl)) { |
| 100 v8SetReturnValueNull(callbackInfo); | 101 v8SetReturnValueNull(callbackInfo); |
| 101 return; | 102 return; |
| 102 } | 103 } |
| 103 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceConstructor3>(cal
lbackInfo.GetReturnValue(), impl)) | 104 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceInheritsNode>(cal
lbackInfo.GetReturnValue(), impl)) |
| 104 return; | 105 return; |
| 105 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 106 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); |
| 106 v8SetReturnValue(callbackInfo, wrapper); | 107 v8SetReturnValue(callbackInfo, wrapper); |
| 107 } | 108 } |
| 108 | 109 |
| 109 template<typename CallbackInfo> | 110 template<typename CallbackInfo> |
| 110 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestI
nterfaceConstructor3* impl) | 111 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestI
nterfaceInheritsNode* impl) |
| 111 { | 112 { |
| 112 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); | 113 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); |
| 113 if (UNLIKELY(!impl)) { | 114 if (UNLIKELY(!impl)) { |
| 114 v8SetReturnValueNull(callbackInfo); | 115 v8SetReturnValueNull(callbackInfo); |
| 115 return; | 116 return; |
| 116 } | 117 } |
| 117 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceConst
ructor3>(callbackInfo.GetReturnValue(), impl)) | 118 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceInher
itsNode>(callbackInfo.GetReturnValue(), impl)) |
| 118 return; | 119 return; |
| 119 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); | 120 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); |
| 120 v8SetReturnValue(callbackInfo, wrapper); | 121 v8SetReturnValue(callbackInfo, wrapper); |
| 121 } | 122 } |
| 122 | 123 |
| 123 template<class CallbackInfo, class Wrappable> | 124 template<class CallbackInfo, class Wrappable> |
| 124 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface
Constructor3* impl, Wrappable* wrappable) | 125 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface
InheritsNode* impl, Wrappable* wrappable) |
| 125 { | 126 { |
| 126 if (UNLIKELY(!impl)) { | 127 if (UNLIKELY(!impl)) { |
| 127 v8SetReturnValueNull(callbackInfo); | 128 v8SetReturnValueNull(callbackInfo); |
| 128 return; | 129 return; |
| 129 } | 130 } |
| 130 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceConstructor3>
(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) | 131 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceInheritsNode>
(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) |
| 131 return; | 132 return; |
| 132 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 133 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); |
| 133 v8SetReturnValue(callbackInfo, wrapper); | 134 v8SetReturnValue(callbackInfo, wrapper); |
| 134 } | 135 } |
| 135 | 136 |
| 136 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfaceConstructor3 > impl, v
8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 137 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfaceInheritsNode > impl, v
8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 137 { | 138 { |
| 138 return toV8(impl.get(), creationContext, isolate); | 139 return toV8(impl.get(), creationContext, isolate); |
| 139 } | 140 } |
| 140 | 141 |
| 141 template<class CallbackInfo> | 142 template<class CallbackInfo> |
| 142 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestIn
terfaceConstructor3 > impl) | 143 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestIn
terfaceInheritsNode > impl) |
| 143 { | 144 { |
| 144 v8SetReturnValue(callbackInfo, impl.get()); | 145 v8SetReturnValue(callbackInfo, impl.get()); |
| 145 } | 146 } |
| 146 | 147 |
| 147 template<class CallbackInfo> | 148 template<class CallbackInfo> |
| 148 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestInterfaceConstructor3 > impl) | 149 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestInterfaceInheritsNode > impl) |
| 149 { | 150 { |
| 150 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); | 151 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); |
| 151 } | 152 } |
| 152 | 153 |
| 153 template<class CallbackInfo, class Wrappable> | 154 template<class CallbackInfo, class Wrappable> |
| 154 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stInterfaceConstructor3 > impl, Wrappable* wrappable) | 155 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stInterfaceInheritsNode > impl, Wrappable* wrappable) |
| 155 { | 156 { |
| 156 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 157 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
| 157 } | 158 } |
| 158 | 159 |
| 159 } | 160 } |
| 160 #endif // V8TestInterfaceConstructor3_h | 161 #endif // V8TestInterfaceInheritsNode_h |
| OLD | NEW |