| 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 V8TestActiveDOMObject_h | 33 #ifndef V8TestActiveDOMObjectInterface_h |
| 34 #define V8TestActiveDOMObject_h | 34 #define V8TestActiveDOMObjectInterface_h |
| 35 | 35 |
| 36 #include "bindings/tests/idls/TestActiveDOMObject.h" | 36 #include "bindings/tests/idls/TestActiveDOMObjectInterface.h" |
| 37 #include "bindings/v8/V8Binding.h" | 37 #include "bindings/v8/V8Binding.h" |
| 38 #include "bindings/v8/V8DOMWrapper.h" | 38 #include "bindings/v8/V8DOMWrapper.h" |
| 39 #include "bindings/v8/WrapperTypeInfo.h" | 39 #include "bindings/v8/WrapperTypeInfo.h" |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace WebCore { |
| 42 | 42 |
| 43 class V8TestActiveDOMObject { | 43 class V8TestActiveDOMObjectInterface { |
| 44 public: | 44 public: |
| 45 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
e); | 45 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
e); |
| 46 static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); | 46 static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); |
| 47 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor
ldType); | 47 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor
ldType); |
| 48 static TestActiveDOMObject* toNative(v8::Handle<v8::Object> object) | 48 static TestActiveDOMObjectInterface* toNative(v8::Handle<v8::Object> object) |
| 49 { | 49 { |
| 50 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); | 50 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); |
| 51 } | 51 } |
| 52 static void derefObject(void*); | 52 static void derefObject(void*); |
| 53 static const WrapperTypeInfo wrapperTypeInfo; | 53 static const WrapperTypeInfo wrapperTypeInfo; |
| 54 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); |
| 54 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | 55 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; |
| 55 static inline void* toInternalPointer(TestActiveDOMObject* impl) | 56 static inline void* toInternalPointer(TestActiveDOMObjectInterface* impl) |
| 56 { | 57 { |
| 57 return impl; | 58 return impl; |
| 58 } | 59 } |
| 59 | 60 |
| 60 static inline TestActiveDOMObject* fromInternalPointer(void* object) | 61 static inline TestActiveDOMObjectInterface* fromInternalPointer(void* object
) |
| 61 { | 62 { |
| 62 return static_cast<TestActiveDOMObject*>(object); | 63 return static_cast<TestActiveDOMObjectInterface*>(object); |
| 63 } | 64 } |
| 64 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestA
ctiveDOMObject*, v8::Isolate*) { } | 65 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestA
ctiveDOMObjectInterface*, v8::Isolate*) { } |
| 65 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } | 66 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } |
| 66 | 67 |
| 67 private: | 68 private: |
| 68 friend v8::Handle<v8::Object> wrap(TestActiveDOMObject*, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate*); | 69 friend v8::Handle<v8::Object> wrap(TestActiveDOMObjectInterface*, v8::Handle
<v8::Object> creationContext, v8::Isolate*); |
| 69 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestActiveDOMObject>,
v8::Handle<v8::Object> creationContext, v8::Isolate*); | 70 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestActiveDOMObjectIn
terface>, v8::Handle<v8::Object> creationContext, v8::Isolate*); |
| 70 }; | 71 }; |
| 71 | 72 |
| 72 template<> | 73 template<> |
| 73 class WrapperTypeTraits<TestActiveDOMObject > { | 74 class WrapperTypeTraits<TestActiveDOMObjectInterface > { |
| 74 public: | 75 public: |
| 75 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestActiveDOMObj
ect::wrapperTypeInfo; } | 76 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestActiveDOMObj
ectInterface::wrapperTypeInfo; } |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 inline v8::Handle<v8::Object> wrap(TestActiveDOMObject* impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) | 79 inline v8::Handle<v8::Object> wrap(TestActiveDOMObjectInterface* impl, v8::Handl
e<v8::Object> creationContext, v8::Isolate* isolate) |
| 79 { | 80 { |
| 80 ASSERT(impl); | 81 ASSERT(impl); |
| 81 ASSERT(!DOMDataStore::containsWrapper<V8TestActiveDOMObject>(impl, isolate))
; | 82 ASSERT(!DOMDataStore::containsWrapper<V8TestActiveDOMObjectInterface>(impl,
isolate)); |
| 82 return V8TestActiveDOMObject::createWrapper(impl, creationContext, isolate); | 83 return V8TestActiveDOMObjectInterface::createWrapper(impl, creationContext,
isolate); |
| 83 } | 84 } |
| 84 | 85 |
| 85 inline v8::Handle<v8::Value> toV8(TestActiveDOMObject* impl, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate* isolate) | 86 inline v8::Handle<v8::Value> toV8(TestActiveDOMObjectInterface* impl, v8::Handle
<v8::Object> creationContext, v8::Isolate* isolate) |
| 86 { | 87 { |
| 87 if (UNLIKELY(!impl)) | 88 if (UNLIKELY(!impl)) |
| 88 return v8NullWithCheck(isolate); | 89 return v8NullWithCheck(isolate); |
| 89 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestActiveDOMObje
ct>(impl, isolate); | 90 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestActiveDOMObje
ctInterface>(impl, isolate); |
| 90 if (!wrapper.IsEmpty()) | 91 if (!wrapper.IsEmpty()) |
| 91 return wrapper; | 92 return wrapper; |
| 92 return wrap(impl, creationContext, isolate); | 93 return wrap(impl, creationContext, isolate); |
| 93 } | 94 } |
| 94 | 95 |
| 95 template<typename CallbackInfo> | 96 template<typename CallbackInfo> |
| 96 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestActiveDOMObje
ct* impl) | 97 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestActiveDOMObje
ctInterface* impl) |
| 97 { | 98 { |
| 98 if (UNLIKELY(!impl)) { | 99 if (UNLIKELY(!impl)) { |
| 99 v8SetReturnValueNull(callbackInfo); | 100 v8SetReturnValueNull(callbackInfo); |
| 100 return; | 101 return; |
| 101 } | 102 } |
| 102 if (DOMDataStore::setReturnValueFromWrapper<V8TestActiveDOMObject>(callbackI
nfo.GetReturnValue(), impl)) | 103 if (DOMDataStore::setReturnValueFromWrapper<V8TestActiveDOMObjectInterface>(
callbackInfo.GetReturnValue(), impl)) |
| 103 return; | 104 return; |
| 104 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 105 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); |
| 105 v8SetReturnValue(callbackInfo, wrapper); | 106 v8SetReturnValue(callbackInfo, wrapper); |
| 106 } | 107 } |
| 107 | 108 |
| 108 template<typename CallbackInfo> | 109 template<typename CallbackInfo> |
| 109 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestA
ctiveDOMObject* impl) | 110 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestA
ctiveDOMObjectInterface* impl) |
| 110 { | 111 { |
| 111 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); | 112 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); |
| 112 if (UNLIKELY(!impl)) { | 113 if (UNLIKELY(!impl)) { |
| 113 v8SetReturnValueNull(callbackInfo); | 114 v8SetReturnValueNull(callbackInfo); |
| 114 return; | 115 return; |
| 115 } | 116 } |
| 116 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestActiveDOMObjec
t>(callbackInfo.GetReturnValue(), impl)) | 117 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestActiveDOMObjec
tInterface>(callbackInfo.GetReturnValue(), impl)) |
| 117 return; | 118 return; |
| 118 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); | 119 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); |
| 119 v8SetReturnValue(callbackInfo, wrapper); | 120 v8SetReturnValue(callbackInfo, wrapper); |
| 120 } | 121 } |
| 121 | 122 |
| 122 template<class CallbackInfo, class Wrappable> | 123 template<class CallbackInfo, class Wrappable> |
| 123 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestActiveDOM
Object* impl, Wrappable* wrappable) | 124 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestActiveDOM
ObjectInterface* impl, Wrappable* wrappable) |
| 124 { | 125 { |
| 125 if (UNLIKELY(!impl)) { | 126 if (UNLIKELY(!impl)) { |
| 126 v8SetReturnValueNull(callbackInfo); | 127 v8SetReturnValueNull(callbackInfo); |
| 127 return; | 128 return; |
| 128 } | 129 } |
| 129 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestActiveDOMObject>(callb
ackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) | 130 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestActiveDOMObjectInterfa
ce>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) |
| 130 return; | 131 return; |
| 131 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 132 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); |
| 132 v8SetReturnValue(callbackInfo, wrapper); | 133 v8SetReturnValue(callbackInfo, wrapper); |
| 133 } | 134 } |
| 134 | 135 |
| 135 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestActiveDOMObject > impl, v8::Han
dle<v8::Object> creationContext, v8::Isolate* isolate) | 136 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestActiveDOMObjectInterface > impl
, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 136 { | 137 { |
| 137 return toV8(impl.get(), creationContext, isolate); | 138 return toV8(impl.get(), creationContext, isolate); |
| 138 } | 139 } |
| 139 | 140 |
| 140 template<class CallbackInfo> | 141 template<class CallbackInfo> |
| 141 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestAc
tiveDOMObject > impl) | 142 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestAc
tiveDOMObjectInterface > impl) |
| 142 { | 143 { |
| 143 v8SetReturnValue(callbackInfo, impl.get()); | 144 v8SetReturnValue(callbackInfo, impl.get()); |
| 144 } | 145 } |
| 145 | 146 |
| 146 template<class CallbackInfo> | 147 template<class CallbackInfo> |
| 147 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestActiveDOMObject > impl) | 148 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestActiveDOMObjectInterface > impl) |
| 148 { | 149 { |
| 149 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); | 150 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); |
| 150 } | 151 } |
| 151 | 152 |
| 152 template<class CallbackInfo, class Wrappable> | 153 template<class CallbackInfo, class Wrappable> |
| 153 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stActiveDOMObject > impl, Wrappable* wrappable) | 154 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stActiveDOMObjectInterface > impl, Wrappable* wrappable) |
| 154 { | 155 { |
| 155 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 156 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
| 156 } | 157 } |
| 157 | 158 |
| 158 } | 159 } |
| 159 | 160 |
| 160 #endif // V8TestActiveDOMObject_h | 161 #endif // V8TestActiveDOMObjectInterface_h |
| OLD | NEW |