| OLD | NEW |
| 1 /* | 1 /* |
| 2 This file is part of the Blink open source project. | 2 This file is part of the Blink open source project. |
| 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! | 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! |
| 4 | 4 |
| 5 This library is free software; you can redistribute it and/or | 5 This library is free software; you can redistribute it and/or |
| 6 modify it under the terms of the GNU Library General Public | 6 modify it under the terms of the GNU Library General Public |
| 7 License as published by the Free Software Foundation; either | 7 License as published by the Free Software Foundation; either |
| 8 version 2 of the License, or (at your option) any later version. | 8 version 2 of the License, or (at your option) any later version. |
| 9 | 9 |
| 10 This library is distributed in the hope that it will be useful, | 10 This library is distributed in the hope that it will be useful, |
| 11 but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 Library General Public License for more details. | 13 Library General Public License for more details. |
| 14 | 14 |
| 15 You should have received a copy of the GNU Library General Public License | 15 You should have received a copy of the GNU Library General Public License |
| 16 along with this library; see the file COPYING.LIB. If not, write to | 16 along with this library; see the file COPYING.LIB. If not, write to |
| 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 18 Boston, MA 02111-1307, USA. | 18 Boston, MA 02111-1307, USA. |
| 19 */ | 19 */ |
| 20 | 20 |
| 21 #ifndef V8TestException_h | 21 #ifndef V8TestConstants_h |
| 22 #define V8TestException_h | 22 #define V8TestConstants_h |
| 23 | 23 |
| 24 #include "bindings/tests/idls/TestException.h" | 24 #include "bindings/tests/idls/TestConstants.h" |
| 25 #include "bindings/v8/V8Binding.h" | 25 #include "bindings/v8/V8Binding.h" |
| 26 #include "bindings/v8/V8DOMWrapper.h" | 26 #include "bindings/v8/V8DOMWrapper.h" |
| 27 #include "bindings/v8/WrapperTypeInfo.h" | 27 #include "bindings/v8/WrapperTypeInfo.h" |
| 28 | 28 |
| 29 namespace WebCore { | 29 namespace WebCore { |
| 30 | 30 |
| 31 class V8TestException { | 31 class V8TestConstants { |
| 32 public: | 32 public: |
| 33 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
e); | 33 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
e); |
| 34 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); | 34 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); |
| 35 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor
ldType); | 35 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor
ldType); |
| 36 static TestException* toNative(v8::Handle<v8::Object> object) | 36 static TestConstants* toNative(v8::Handle<v8::Object> object) |
| 37 { | 37 { |
| 38 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); | 38 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); |
| 39 } | 39 } |
| 40 static void derefObject(void*); | 40 static void derefObject(void*); |
| 41 static WrapperTypeInfo info; | 41 static WrapperTypeInfo info; |
| 42 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | 42 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; |
| 43 static inline void* toInternalPointer(TestException* impl) | 43 static inline void* toInternalPointer(TestConstants* impl) |
| 44 { | 44 { |
| 45 return impl; | 45 return impl; |
| 46 } | 46 } |
| 47 | 47 |
| 48 static inline TestException* fromInternalPointer(void* object) | 48 static inline TestConstants* fromInternalPointer(void* object) |
| 49 { | 49 { |
| 50 return static_cast<TestException*>(object); | 50 return static_cast<TestConstants*>(object); |
| 51 } | 51 } |
| 52 static void installPerContextProperties(v8::Handle<v8::Object>, TestExceptio
n*, v8::Isolate*) { } | 52 static void installPerContextProperties(v8::Handle<v8::Object>, TestConstant
s*, v8::Isolate*) { } |
| 53 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8:
:Isolate*) { } | 53 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8:
:Isolate*) { } |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 friend v8::Handle<v8::Object> wrap(TestException*, v8::Handle<v8::Object> cr
eationContext, v8::Isolate*); | 56 friend v8::Handle<v8::Object> wrap(TestConstants*, v8::Handle<v8::Object> cr
eationContext, v8::Isolate*); |
| 57 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestException>, v8::H
andle<v8::Object> creationContext, v8::Isolate*); | 57 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestConstants>, v8::H
andle<v8::Object> creationContext, v8::Isolate*); |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 template<> | 60 template<> |
| 61 class WrapperTypeTraits<TestException > { | 61 class WrapperTypeTraits<TestConstants > { |
| 62 public: | 62 public: |
| 63 static WrapperTypeInfo* info() { return &V8TestException::info; } | 63 static WrapperTypeInfo* info() { return &V8TestConstants::info; } |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 inline v8::Handle<v8::Object> wrap(TestException* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) | 66 inline v8::Handle<v8::Object> wrap(TestConstants* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) |
| 67 { | 67 { |
| 68 ASSERT(impl); | 68 ASSERT(impl); |
| 69 ASSERT(!DOMDataStore::containsWrapper<V8TestException>(impl, isolate)); | 69 ASSERT(!DOMDataStore::containsWrapper<V8TestConstants>(impl, isolate)); |
| 70 return V8TestException::createWrapper(impl, creationContext, isolate); | 70 return V8TestConstants::createWrapper(impl, creationContext, isolate); |
| 71 } | 71 } |
| 72 | 72 |
| 73 inline v8::Handle<v8::Value> toV8(TestException* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) | 73 inline v8::Handle<v8::Value> toV8(TestConstants* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) |
| 74 { | 74 { |
| 75 if (UNLIKELY(!impl)) | 75 if (UNLIKELY(!impl)) |
| 76 return v8NullWithCheck(isolate); | 76 return v8NullWithCheck(isolate); |
| 77 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestException>(im
pl, isolate); | 77 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestConstants>(im
pl, isolate); |
| 78 if (!wrapper.IsEmpty()) | 78 if (!wrapper.IsEmpty()) |
| 79 return wrapper; | 79 return wrapper; |
| 80 return wrap(impl, creationContext, isolate); | 80 return wrap(impl, creationContext, isolate); |
| 81 } | 81 } |
| 82 | 82 |
| 83 template<typename CallbackInfo> | 83 template<typename CallbackInfo> |
| 84 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestException* im
pl, v8::Handle<v8::Object> creationContext) | 84 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestConstants* im
pl, v8::Handle<v8::Object> creationContext) |
| 85 { | 85 { |
| 86 if (UNLIKELY(!impl)) { | 86 if (UNLIKELY(!impl)) { |
| 87 v8SetReturnValueNull(callbackInfo); | 87 v8SetReturnValueNull(callbackInfo); |
| 88 return; | 88 return; |
| 89 } | 89 } |
| 90 if (DOMDataStore::setReturnValueFromWrapper<V8TestException>(callbackInfo.Ge
tReturnValue(), impl)) | 90 if (DOMDataStore::setReturnValueFromWrapper<V8TestConstants>(callbackInfo.Ge
tReturnValue(), impl)) |
| 91 return; | 91 return; |
| 92 v8::Handle<v8::Object> wrapper = wrap(impl, creationContext, callbackInfo.Ge
tIsolate()); | 92 v8::Handle<v8::Object> wrapper = wrap(impl, creationContext, callbackInfo.Ge
tIsolate()); |
| 93 v8SetReturnValue(callbackInfo, wrapper); | 93 v8SetReturnValue(callbackInfo, wrapper); |
| 94 } | 94 } |
| 95 | 95 |
| 96 template<typename CallbackInfo> | 96 template<typename CallbackInfo> |
| 97 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestE
xception* impl, v8::Handle<v8::Object> creationContext) | 97 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestC
onstants* impl, v8::Handle<v8::Object> creationContext) |
| 98 { | 98 { |
| 99 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); | 99 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); |
| 100 if (UNLIKELY(!impl)) { | 100 if (UNLIKELY(!impl)) { |
| 101 v8SetReturnValueNull(callbackInfo); | 101 v8SetReturnValueNull(callbackInfo); |
| 102 return; | 102 return; |
| 103 } | 103 } |
| 104 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestException>(cal
lbackInfo.GetReturnValue(), impl)) | 104 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestConstants>(cal
lbackInfo.GetReturnValue(), impl)) |
| 105 return; | 105 return; |
| 106 v8::Handle<v8::Value> wrapper = wrap(impl, creationContext, callbackInfo.Get
Isolate()); | 106 v8::Handle<v8::Value> wrapper = wrap(impl, creationContext, callbackInfo.Get
Isolate()); |
| 107 v8SetReturnValue(callbackInfo, wrapper); | 107 v8SetReturnValue(callbackInfo, wrapper); |
| 108 } | 108 } |
| 109 | 109 |
| 110 template<class CallbackInfo, class Wrappable> | 110 template<class CallbackInfo, class Wrappable> |
| 111 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestException
* impl, Wrappable* wrappable) | 111 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestConstants
* impl, Wrappable* wrappable) |
| 112 { | 112 { |
| 113 if (UNLIKELY(!impl)) { | 113 if (UNLIKELY(!impl)) { |
| 114 v8SetReturnValueNull(callbackInfo); | 114 v8SetReturnValueNull(callbackInfo); |
| 115 return; | 115 return; |
| 116 } | 116 } |
| 117 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestException>(callbackInf
o.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) | 117 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestConstants>(callbackInf
o.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) |
| 118 return; | 118 return; |
| 119 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 119 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); |
| 120 v8SetReturnValue(callbackInfo, wrapper); | 120 v8SetReturnValue(callbackInfo, wrapper); |
| 121 } | 121 } |
| 122 | 122 |
| 123 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestException > impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) | 123 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestConstants > impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) |
| 124 { | 124 { |
| 125 return toV8(impl.get(), creationContext, isolate); | 125 return toV8(impl.get(), creationContext, isolate); |
| 126 } | 126 } |
| 127 | 127 |
| 128 template<class CallbackInfo> | 128 template<class CallbackInfo> |
| 129 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestEx
ception > impl, v8::Handle<v8::Object> creationContext) | 129 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestCo
nstants > impl, v8::Handle<v8::Object> creationContext) |
| 130 { | 130 { |
| 131 v8SetReturnValue(callbackInfo, impl.get(), creationContext); | 131 v8SetReturnValue(callbackInfo, impl.get(), creationContext); |
| 132 } | 132 } |
| 133 | 133 |
| 134 template<class CallbackInfo> | 134 template<class CallbackInfo> |
| 135 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestException > impl, v8::Handle<v8::Object> creationContext) | 135 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestConstants > impl, v8::Handle<v8::Object> creationContext) |
| 136 { | 136 { |
| 137 v8SetReturnValueForMainWorld(callbackInfo, impl.get(), creationContext); | 137 v8SetReturnValueForMainWorld(callbackInfo, impl.get(), creationContext); |
| 138 } | 138 } |
| 139 | 139 |
| 140 template<class CallbackInfo, class Wrappable> | 140 template<class CallbackInfo, class Wrappable> |
| 141 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stException > impl, Wrappable* wrappable) | 141 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stConstants > impl, Wrappable* wrappable) |
| 142 { | 142 { |
| 143 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 143 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
| 144 } | 144 } |
| 145 | 145 |
| 146 } | 146 } |
| 147 | 147 |
| 148 #endif // V8TestException_h | 148 #endif // V8TestConstants_h |
| OLD | NEW |