| 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 V8TestInterfaceEventConstructor_h | 33 #ifndef V8TestInterfaceNamedConstructor_h |
| 34 #define V8TestInterfaceEventConstructor_h | 34 #define V8TestInterfaceNamedConstructor_h |
| 35 | 35 |
| 36 #include "V8Event.h" | 36 #include "bindings/tests/idls/TestInterfaceNamedConstructor.h" |
| 37 #include "bindings/tests/idls/TestInterfaceEventConstructor.h" | |
| 38 #include "bindings/v8/V8Binding.h" | 37 #include "bindings/v8/V8Binding.h" |
| 39 #include "bindings/v8/V8DOMWrapper.h" | 38 #include "bindings/v8/V8DOMWrapper.h" |
| 40 #include "bindings/v8/WrapperTypeInfo.h" | 39 #include "bindings/v8/WrapperTypeInfo.h" |
| 41 | 40 |
| 42 namespace WebCore { | 41 namespace WebCore { |
| 43 | 42 |
| 44 class Dictionary; | 43 class V8TestInterfaceNamedConstructorConstructor { |
| 45 class V8TestInterfaceEventConstructor { | 44 public: |
| 45 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWor
ldType); |
| 46 static const WrapperTypeInfo wrapperTypeInfo; |
| 47 }; |
| 48 |
| 49 class V8TestInterfaceNamedConstructor { |
| 46 public: | 50 public: |
| 47 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
e); | 51 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
e); |
| 48 static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); | 52 static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); |
| 49 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWor
ldType); | 53 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWor
ldType); |
| 50 static TestInterfaceEventConstructor* toNative(v8::Handle<v8::Object> object
) | 54 static TestInterfaceNamedConstructor* toNative(v8::Handle<v8::Object> object
) |
| 51 { | 55 { |
| 52 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); | 56 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); |
| 53 } | 57 } |
| 54 static void derefObject(void*); | 58 static void derefObject(void*); |
| 55 static const WrapperTypeInfo wrapperTypeInfo; | 59 static const WrapperTypeInfo wrapperTypeInfo; |
| 56 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 57 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | 60 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; |
| 58 static inline void* toInternalPointer(TestInterfaceEventConstructor* impl) | 61 static inline void* toInternalPointer(TestInterfaceNamedConstructor* impl) |
| 59 { | 62 { |
| 60 return V8Event::toInternalPointer(impl); | 63 return impl; |
| 61 } | 64 } |
| 62 | 65 |
| 63 static inline TestInterfaceEventConstructor* fromInternalPointer(void* objec
t) | 66 static inline TestInterfaceNamedConstructor* fromInternalPointer(void* objec
t) |
| 64 { | 67 { |
| 65 return static_cast<TestInterfaceEventConstructor*>(V8Event::fromInternal
Pointer(object)); | 68 return static_cast<TestInterfaceNamedConstructor*>(object); |
| 66 } | 69 } |
| 67 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestI
nterfaceEventConstructor*, v8::Isolate*) { } | 70 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestI
nterfaceNamedConstructor*, v8::Isolate*) { } |
| 68 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } | 71 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } |
| 69 | 72 |
| 70 private: | 73 private: |
| 71 friend v8::Handle<v8::Object> wrap(TestInterfaceEventConstructor*, v8::Handl
e<v8::Object> creationContext, v8::Isolate*); | 74 friend v8::Handle<v8::Object> wrap(TestInterfaceNamedConstructor*, v8::Handl
e<v8::Object> creationContext, v8::Isolate*); |
| 72 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterfaceEventCon
structor>, v8::Handle<v8::Object> creationContext, v8::Isolate*); | 75 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterfaceNamedCon
structor>, v8::Handle<v8::Object> creationContext, v8::Isolate*); |
| 73 }; | 76 }; |
| 74 | 77 |
| 75 template<> | 78 template<> |
| 76 class WrapperTypeTraits<TestInterfaceEventConstructor > { | 79 class WrapperTypeTraits<TestInterfaceNamedConstructor > { |
| 77 public: | 80 public: |
| 78 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfaceEve
ntConstructor::wrapperTypeInfo; } | 81 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfaceNam
edConstructor::wrapperTypeInfo; } |
| 79 }; | 82 }; |
| 80 | 83 |
| 81 inline v8::Handle<v8::Object> wrap(TestInterfaceEventConstructor* impl, v8::Hand
le<v8::Object> creationContext, v8::Isolate* isolate) | 84 inline v8::Handle<v8::Object> wrap(TestInterfaceNamedConstructor* impl, v8::Hand
le<v8::Object> creationContext, v8::Isolate* isolate) |
| 82 { | 85 { |
| 83 ASSERT(impl); | 86 ASSERT(impl); |
| 84 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceEventConstructor>(impl,
isolate)); | 87 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceNamedConstructor>(impl,
isolate)); |
| 85 return V8TestInterfaceEventConstructor::createWrapper(impl, creationContext,
isolate); | 88 return V8TestInterfaceNamedConstructor::createWrapper(impl, creationContext,
isolate); |
| 86 } | 89 } |
| 87 | 90 |
| 88 inline v8::Handle<v8::Value> toV8(TestInterfaceEventConstructor* impl, v8::Handl
e<v8::Object> creationContext, v8::Isolate* isolate) | 91 inline v8::Handle<v8::Value> toV8(TestInterfaceNamedConstructor* impl, v8::Handl
e<v8::Object> creationContext, v8::Isolate* isolate) |
| 89 { | 92 { |
| 90 if (UNLIKELY(!impl)) | 93 if (UNLIKELY(!impl)) |
| 91 return v8::Null(isolate); | 94 return v8::Null(isolate); |
| 92 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceEven
tConstructor>(impl, isolate); | 95 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceName
dConstructor>(impl, isolate); |
| 93 if (!wrapper.IsEmpty()) | 96 if (!wrapper.IsEmpty()) |
| 94 return wrapper; | 97 return wrapper; |
| 95 return wrap(impl, creationContext, isolate); | 98 return wrap(impl, creationContext, isolate); |
| 96 } | 99 } |
| 97 | 100 |
| 98 template<typename CallbackInfo> | 101 template<typename CallbackInfo> |
| 99 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceEven
tConstructor* impl) | 102 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceName
dConstructor* impl) |
| 100 { | 103 { |
| 101 if (UNLIKELY(!impl)) { | 104 if (UNLIKELY(!impl)) { |
| 102 v8SetReturnValueNull(callbackInfo); | 105 v8SetReturnValueNull(callbackInfo); |
| 103 return; | 106 return; |
| 104 } | 107 } |
| 105 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceEventConstructor>
(callbackInfo.GetReturnValue(), impl)) | 108 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceNamedConstructor>
(callbackInfo.GetReturnValue(), impl)) |
| 106 return; | 109 return; |
| 107 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 110 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); |
| 108 v8SetReturnValue(callbackInfo, wrapper); | 111 v8SetReturnValue(callbackInfo, wrapper); |
| 109 } | 112 } |
| 110 | 113 |
| 111 template<typename CallbackInfo> | 114 template<typename CallbackInfo> |
| 112 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestI
nterfaceEventConstructor* impl) | 115 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestI
nterfaceNamedConstructor* impl) |
| 113 { | 116 { |
| 114 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); | 117 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); |
| 115 if (UNLIKELY(!impl)) { | 118 if (UNLIKELY(!impl)) { |
| 116 v8SetReturnValueNull(callbackInfo); | 119 v8SetReturnValueNull(callbackInfo); |
| 117 return; | 120 return; |
| 118 } | 121 } |
| 119 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceEvent
Constructor>(callbackInfo.GetReturnValue(), impl)) | 122 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceNamed
Constructor>(callbackInfo.GetReturnValue(), impl)) |
| 120 return; | 123 return; |
| 121 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); | 124 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); |
| 122 v8SetReturnValue(callbackInfo, wrapper); | 125 v8SetReturnValue(callbackInfo, wrapper); |
| 123 } | 126 } |
| 124 | 127 |
| 125 template<class CallbackInfo, class Wrappable> | 128 template<class CallbackInfo, class Wrappable> |
| 126 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface
EventConstructor* impl, Wrappable* wrappable) | 129 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface
NamedConstructor* impl, Wrappable* wrappable) |
| 127 { | 130 { |
| 128 if (UNLIKELY(!impl)) { | 131 if (UNLIKELY(!impl)) { |
| 129 v8SetReturnValueNull(callbackInfo); | 132 v8SetReturnValueNull(callbackInfo); |
| 130 return; | 133 return; |
| 131 } | 134 } |
| 132 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceEventConstruc
tor>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) | 135 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceNamedConstruc
tor>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) |
| 133 return; | 136 return; |
| 134 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 137 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); |
| 135 v8SetReturnValue(callbackInfo, wrapper); | 138 v8SetReturnValue(callbackInfo, wrapper); |
| 136 } | 139 } |
| 137 | 140 |
| 138 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfaceEventConstructor > imp
l, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 141 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfaceNamedConstructor > imp
l, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 139 { | 142 { |
| 140 return toV8(impl.get(), creationContext, isolate); | 143 return toV8(impl.get(), creationContext, isolate); |
| 141 } | 144 } |
| 142 | 145 |
| 143 template<class CallbackInfo> | 146 template<class CallbackInfo> |
| 144 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestIn
terfaceEventConstructor > impl) | 147 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestIn
terfaceNamedConstructor > impl) |
| 145 { | 148 { |
| 146 v8SetReturnValue(callbackInfo, impl.get()); | 149 v8SetReturnValue(callbackInfo, impl.get()); |
| 147 } | 150 } |
| 148 | 151 |
| 149 template<class CallbackInfo> | 152 template<class CallbackInfo> |
| 150 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestInterfaceEventConstructor > impl) | 153 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestInterfaceNamedConstructor > impl) |
| 151 { | 154 { |
| 152 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); | 155 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); |
| 153 } | 156 } |
| 154 | 157 |
| 155 template<class CallbackInfo, class Wrappable> | 158 template<class CallbackInfo, class Wrappable> |
| 156 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stInterfaceEventConstructor > impl, Wrappable* wrappable) | 159 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stInterfaceNamedConstructor > impl, Wrappable* wrappable) |
| 157 { | 160 { |
| 158 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 161 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
| 159 } | 162 } |
| 160 | 163 |
| 161 bool initializeTestInterfaceEventConstructor(TestInterfaceEventConstructorInit&,
const Dictionary&, ExceptionState&, const String& = ""); | |
| 162 | |
| 163 } | 164 } |
| 164 #endif // V8TestInterfaceEventConstructor_h | 165 #endif // V8TestInterfaceNamedConstructor_h |
| OLD | NEW |