| 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 V8TestInterfaceEmpty_h | 33 #ifndef V8TestInterfaceNode_h |
| 34 #define V8TestInterfaceEmpty_h | 34 #define V8TestInterfaceNode_h |
| 35 | 35 |
| 36 #include "bindings/tests/idls/TestInterfaceEmpty.h" | 36 #include "V8Node.h" |
| 37 #include "bindings/tests/idls/TestInterfaceNode.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 V8TestInterfaceEmpty { | 44 class V8TestInterfaceNode { |
| 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 TestInterfaceEmpty* toNative(v8::Handle<v8::Object> object) | 49 static TestInterfaceNode* 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; |
| 55 static EventTarget* toEventTarget(v8::Handle<v8::Object>); |
| 54 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | 56 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; |
| 55 static inline void* toInternalPointer(TestInterfaceEmpty* impl) | 57 static inline void* toInternalPointer(TestInterfaceNode* impl) |
| 56 { | 58 { |
| 57 return impl; | 59 return V8Node::toInternalPointer(impl); |
| 58 } | 60 } |
| 59 | 61 |
| 60 static inline TestInterfaceEmpty* fromInternalPointer(void* object) | 62 static inline TestInterfaceNode* fromInternalPointer(void* object) |
| 61 { | 63 { |
| 62 return static_cast<TestInterfaceEmpty*>(object); | 64 return static_cast<TestInterfaceNode*>(V8Node::fromInternalPointer(objec
t)); |
| 63 } | 65 } |
| 64 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestI
nterfaceEmpty*, v8::Isolate*) { } | 66 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestI
nterfaceNode*, v8::Isolate*) { } |
| 65 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } | 67 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } |
| 66 | 68 |
| 67 private: | 69 private: |
| 68 friend v8::Handle<v8::Object> wrap(TestInterfaceEmpty*, v8::Handle<v8::Objec
t> creationContext, v8::Isolate*); | 70 friend v8::Handle<v8::Object> wrap(TestInterfaceNode*, v8::Handle<v8::Object
> creationContext, v8::Isolate*); |
| 69 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterfaceEmpty>,
v8::Handle<v8::Object> creationContext, v8::Isolate*); | 71 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterfaceNode>, v
8::Handle<v8::Object> creationContext, v8::Isolate*); |
| 70 }; | 72 }; |
| 71 | 73 |
| 72 template<> | 74 template<> |
| 73 class WrapperTypeTraits<TestInterfaceEmpty > { | 75 class WrapperTypeTraits<TestInterfaceNode > { |
| 74 public: | 76 public: |
| 75 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfaceEmp
ty::wrapperTypeInfo; } | 77 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfaceNod
e::wrapperTypeInfo; } |
| 76 }; | 78 }; |
| 77 | 79 |
| 78 inline v8::Handle<v8::Object> wrap(TestInterfaceEmpty* impl, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate* isolate) | 80 inline v8::Handle<v8::Object> wrap(TestInterfaceNode* impl, v8::Handle<v8::Objec
t> creationContext, v8::Isolate* isolate) |
| 79 { | 81 { |
| 80 ASSERT(impl); | 82 ASSERT(impl); |
| 81 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceEmpty>(impl, isolate)); | 83 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceNode>(impl, isolate)); |
| 82 return V8TestInterfaceEmpty::createWrapper(impl, creationContext, isolate); | 84 return V8TestInterfaceNode::createWrapper(impl, creationContext, isolate); |
| 83 } | 85 } |
| 84 | 86 |
| 85 inline v8::Handle<v8::Value> toV8(TestInterfaceEmpty* impl, v8::Handle<v8::Objec
t> creationContext, v8::Isolate* isolate) | 87 inline v8::Handle<v8::Value> toV8(TestInterfaceNode* impl, v8::Handle<v8::Object
> creationContext, v8::Isolate* isolate) |
| 86 { | 88 { |
| 87 if (UNLIKELY(!impl)) | 89 if (UNLIKELY(!impl)) |
| 88 return v8::Null(isolate); | 90 return v8::Null(isolate); |
| 89 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceEmpt
y>(impl, isolate); | 91 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceNode
>(impl, isolate); |
| 90 if (!wrapper.IsEmpty()) | 92 if (!wrapper.IsEmpty()) |
| 91 return wrapper; | 93 return wrapper; |
| 92 return wrap(impl, creationContext, isolate); | 94 return wrap(impl, creationContext, isolate); |
| 93 } | 95 } |
| 94 | 96 |
| 95 template<typename CallbackInfo> | 97 template<typename CallbackInfo> |
| 96 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceEmpt
y* impl) | 98 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceNode
* impl) |
| 97 { | 99 { |
| 98 if (UNLIKELY(!impl)) { | 100 if (UNLIKELY(!impl)) { |
| 99 v8SetReturnValueNull(callbackInfo); | 101 v8SetReturnValueNull(callbackInfo); |
| 100 return; | 102 return; |
| 101 } | 103 } |
| 102 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceEmpty>(callbackIn
fo.GetReturnValue(), impl)) | 104 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceNode>(callbackInf
o.GetReturnValue(), impl)) |
| 103 return; | 105 return; |
| 104 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()); |
| 105 v8SetReturnValue(callbackInfo, wrapper); | 107 v8SetReturnValue(callbackInfo, wrapper); |
| 106 } | 108 } |
| 107 | 109 |
| 108 template<typename CallbackInfo> | 110 template<typename CallbackInfo> |
| 109 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestI
nterfaceEmpty* impl) | 111 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestI
nterfaceNode* impl) |
| 110 { | 112 { |
| 111 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); | 113 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); |
| 112 if (UNLIKELY(!impl)) { | 114 if (UNLIKELY(!impl)) { |
| 113 v8SetReturnValueNull(callbackInfo); | 115 v8SetReturnValueNull(callbackInfo); |
| 114 return; | 116 return; |
| 115 } | 117 } |
| 116 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceEmpty
>(callbackInfo.GetReturnValue(), impl)) | 118 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceNode>
(callbackInfo.GetReturnValue(), impl)) |
| 117 return; | 119 return; |
| 118 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()); |
| 119 v8SetReturnValue(callbackInfo, wrapper); | 121 v8SetReturnValue(callbackInfo, wrapper); |
| 120 } | 122 } |
| 121 | 123 |
| 122 template<class CallbackInfo, class Wrappable> | 124 template<class CallbackInfo, class Wrappable> |
| 123 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface
Empty* impl, Wrappable* wrappable) | 125 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface
Node* impl, Wrappable* wrappable) |
| 124 { | 126 { |
| 125 if (UNLIKELY(!impl)) { | 127 if (UNLIKELY(!impl)) { |
| 126 v8SetReturnValueNull(callbackInfo); | 128 v8SetReturnValueNull(callbackInfo); |
| 127 return; | 129 return; |
| 128 } | 130 } |
| 129 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceEmpty>(callba
ckInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) | 131 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceNode>(callbac
kInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) |
| 130 return; | 132 return; |
| 131 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()); |
| 132 v8SetReturnValue(callbackInfo, wrapper); | 134 v8SetReturnValue(callbackInfo, wrapper); |
| 133 } | 135 } |
| 134 | 136 |
| 135 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfaceEmpty > impl, v8::Hand
le<v8::Object> creationContext, v8::Isolate* isolate) | 137 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfaceNode > impl, v8::Handl
e<v8::Object> creationContext, v8::Isolate* isolate) |
| 136 { | 138 { |
| 137 return toV8(impl.get(), creationContext, isolate); | 139 return toV8(impl.get(), creationContext, isolate); |
| 138 } | 140 } |
| 139 | 141 |
| 140 template<class CallbackInfo> | 142 template<class CallbackInfo> |
| 141 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestIn
terfaceEmpty > impl) | 143 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestIn
terfaceNode > impl) |
| 142 { | 144 { |
| 143 v8SetReturnValue(callbackInfo, impl.get()); | 145 v8SetReturnValue(callbackInfo, impl.get()); |
| 144 } | 146 } |
| 145 | 147 |
| 146 template<class CallbackInfo> | 148 template<class CallbackInfo> |
| 147 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestInterfaceEmpty > impl) | 149 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestInterfaceNode > impl) |
| 148 { | 150 { |
| 149 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); | 151 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); |
| 150 } | 152 } |
| 151 | 153 |
| 152 template<class CallbackInfo, class Wrappable> | 154 template<class CallbackInfo, class Wrappable> |
| 153 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stInterfaceEmpty > impl, Wrappable* wrappable) | 155 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stInterfaceNode > impl, Wrappable* wrappable) |
| 154 { | 156 { |
| 155 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 157 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
| 156 } | 158 } |
| 157 | 159 |
| 158 } | 160 } |
| 159 #endif // V8TestInterfaceEmpty_h | 161 #endif // V8TestInterfaceNode_h |
| OLD | NEW |