| 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 V8TestInterfaceGarbageCollected_h | 33 #ifndef V8TestInterfaceWillBeGarbageCollected_h |
| 34 #define V8TestInterfaceGarbageCollected_h | 34 #define V8TestInterfaceWillBeGarbageCollected_h |
| 35 | 35 |
| 36 #include "bindings/tests/idls/TestInterfaceGarbageCollected.h" | 36 #include "bindings/tests/idls/TestInterfaceWillBeGarbageCollected.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 #include "heap/Handle.h" | 40 #include "heap/Handle.h" |
| 41 | 41 |
| 42 namespace WebCore { | 42 namespace WebCore { |
| 43 | 43 |
| 44 class V8TestInterfaceGarbageCollected { | 44 class V8TestInterfaceWillBeGarbageCollected { |
| 45 public: | 45 public: |
| 46 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*); | 46 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*); |
| 47 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWor
ldType); | 47 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWor
ldType); |
| 48 static TestInterfaceGarbageCollected* toNative(v8::Handle<v8::Object> object
) | 48 static TestInterfaceWillBeGarbageCollected* 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 const WrapperTypeInfo wrapperTypeInfo; | 52 static const WrapperTypeInfo wrapperTypeInfo; |
| 53 static void derefObject(void*); | 53 static void derefObject(void*); |
| 54 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 54 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
| 55 static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount
+ 0; | 55 static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount
+ 0; |
| 56 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 1
; | 56 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 1
; |
| 57 static inline void* toInternalPointer(TestInterfaceGarbageCollected* impl) | 57 static inline void* toInternalPointer(TestInterfaceWillBeGarbageCollected* i
mpl) |
| 58 { | 58 { |
| 59 return impl; | 59 return impl; |
| 60 } | 60 } |
| 61 | 61 |
| 62 static inline TestInterfaceGarbageCollected* fromInternalPointer(void* objec
t) | 62 static inline TestInterfaceWillBeGarbageCollected* fromInternalPointer(void*
object) |
| 63 { | 63 { |
| 64 return static_cast<TestInterfaceGarbageCollected*>(object); | 64 return static_cast<TestInterfaceWillBeGarbageCollected*>(object); |
| 65 } | 65 } |
| 66 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestI
nterfaceGarbageCollected*, v8::Isolate*) { } | 66 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestI
nterfaceWillBeGarbageCollected*, v8::Isolate*) { } |
| 67 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } | 67 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 friend v8::Handle<v8::Object> wrap(TestInterfaceGarbageCollected*, v8::Handl
e<v8::Object> creationContext, v8::Isolate*); | 70 friend v8::Handle<v8::Object> wrap(TestInterfaceWillBeGarbageCollected*, v8:
:Handle<v8::Object> creationContext, v8::Isolate*); |
| 71 static v8::Handle<v8::Object> createWrapper(PassRefPtrWillBeRawPtr<TestInter
faceGarbageCollected>, v8::Handle<v8::Object> creationContext, v8::Isolate*); | 71 static v8::Handle<v8::Object> createWrapper(PassRefPtrWillBeRawPtr<TestInter
faceWillBeGarbageCollected>, v8::Handle<v8::Object> creationContext, v8::Isolate
*); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 template<> | 74 template<> |
| 75 class WrapperTypeTraits<TestInterfaceGarbageCollected > { | 75 class WrapperTypeTraits<TestInterfaceWillBeGarbageCollected > { |
| 76 public: | 76 public: |
| 77 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfaceGar
bageCollected::wrapperTypeInfo; } | 77 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfaceWil
lBeGarbageCollected::wrapperTypeInfo; } |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 inline v8::Handle<v8::Object> wrap(TestInterfaceGarbageCollected* impl, v8::Hand
le<v8::Object> creationContext, v8::Isolate* isolate) | 80 inline v8::Handle<v8::Object> wrap(TestInterfaceWillBeGarbageCollected* impl, v8
::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 81 { | 81 { |
| 82 ASSERT(impl); | 82 ASSERT(impl); |
| 83 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceGarbageCollected>(impl,
isolate)); | 83 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceWillBeGarbageCollected>
(impl, isolate)); |
| 84 return V8TestInterfaceGarbageCollected::createWrapper(impl, creationContext,
isolate); | 84 return V8TestInterfaceWillBeGarbageCollected::createWrapper(impl, creationCo
ntext, isolate); |
| 85 } | 85 } |
| 86 | 86 |
| 87 inline v8::Handle<v8::Value> toV8(TestInterfaceGarbageCollected* impl, v8::Handl
e<v8::Object> creationContext, v8::Isolate* isolate) | 87 inline v8::Handle<v8::Value> toV8(TestInterfaceWillBeGarbageCollected* impl, v8:
:Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 88 { | 88 { |
| 89 if (UNLIKELY(!impl)) | 89 if (UNLIKELY(!impl)) |
| 90 return v8::Null(isolate); | 90 return v8::Null(isolate); |
| 91 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceGarb
ageCollected>(impl, isolate); | 91 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceWill
BeGarbageCollected>(impl, isolate); |
| 92 if (!wrapper.IsEmpty()) | 92 if (!wrapper.IsEmpty()) |
| 93 return wrapper; | 93 return wrapper; |
| 94 return wrap(impl, creationContext, isolate); | 94 return wrap(impl, creationContext, isolate); |
| 95 } | 95 } |
| 96 | 96 |
| 97 template<typename CallbackInfo> | 97 template<typename CallbackInfo> |
| 98 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceGarb
ageCollected* impl) | 98 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceWill
BeGarbageCollected* impl) |
| 99 { | 99 { |
| 100 if (UNLIKELY(!impl)) { | 100 if (UNLIKELY(!impl)) { |
| 101 v8SetReturnValueNull(callbackInfo); | 101 v8SetReturnValueNull(callbackInfo); |
| 102 return; | 102 return; |
| 103 } | 103 } |
| 104 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceGarbageCollected>
(callbackInfo.GetReturnValue(), impl)) | 104 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceWillBeGarbageColl
ected>(callbackInfo.GetReturnValue(), impl)) |
| 105 return; | 105 return; |
| 106 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()); |
| 107 v8SetReturnValue(callbackInfo, wrapper); | 107 v8SetReturnValue(callbackInfo, wrapper); |
| 108 } | 108 } |
| 109 | 109 |
| 110 template<typename CallbackInfo> | 110 template<typename CallbackInfo> |
| 111 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestI
nterfaceGarbageCollected* impl) | 111 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestI
nterfaceWillBeGarbageCollected* impl) |
| 112 { | 112 { |
| 113 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); | 113 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); |
| 114 if (UNLIKELY(!impl)) { | 114 if (UNLIKELY(!impl)) { |
| 115 v8SetReturnValueNull(callbackInfo); | 115 v8SetReturnValueNull(callbackInfo); |
| 116 return; | 116 return; |
| 117 } | 117 } |
| 118 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceGarba
geCollected>(callbackInfo.GetReturnValue(), impl)) | 118 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceWillB
eGarbageCollected>(callbackInfo.GetReturnValue(), impl)) |
| 119 return; | 119 return; |
| 120 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()); |
| 121 v8SetReturnValue(callbackInfo, wrapper); | 121 v8SetReturnValue(callbackInfo, wrapper); |
| 122 } | 122 } |
| 123 | 123 |
| 124 template<class CallbackInfo, class Wrappable> | 124 template<class CallbackInfo, class Wrappable> |
| 125 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface
GarbageCollected* impl, Wrappable* wrappable) | 125 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface
WillBeGarbageCollected* impl, Wrappable* wrappable) |
| 126 { | 126 { |
| 127 if (UNLIKELY(!impl)) { | 127 if (UNLIKELY(!impl)) { |
| 128 v8SetReturnValueNull(callbackInfo); | 128 v8SetReturnValueNull(callbackInfo); |
| 129 return; | 129 return; |
| 130 } | 130 } |
| 131 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceGarbageCollec
ted>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) | 131 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceWillBeGarbage
Collected>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable
)) |
| 132 return; | 132 return; |
| 133 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()); |
| 134 v8SetReturnValue(callbackInfo, wrapper); | 134 v8SetReturnValue(callbackInfo, wrapper); |
| 135 } | 135 } |
| 136 | 136 |
| 137 inline v8::Handle<v8::Value> toV8(PassRefPtrWillBeRawPtr<TestInterfaceGarbageCol
lected> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 137 inline v8::Handle<v8::Value> toV8(PassRefPtrWillBeRawPtr<TestInterfaceWillBeGarb
ageCollected> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate
) |
| 138 { | 138 { |
| 139 return toV8(impl.get(), creationContext, isolate); | 139 return toV8(impl.get(), creationContext, isolate); |
| 140 } | 140 } |
| 141 | 141 |
| 142 template<class CallbackInfo> | 142 template<class CallbackInfo> |
| 143 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtrWillBeR
awPtr<TestInterfaceGarbageCollected> impl) | 143 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtrWillBeR
awPtr<TestInterfaceWillBeGarbageCollected> impl) |
| 144 { | 144 { |
| 145 v8SetReturnValue(callbackInfo, impl.get()); | 145 v8SetReturnValue(callbackInfo, impl.get()); |
| 146 } | 146 } |
| 147 | 147 |
| 148 template<class CallbackInfo> | 148 template<class CallbackInfo> |
| 149 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtrWillBeRawPtr<TestInterfaceGarbageCollected> impl) | 149 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> impl) |
| 150 { | 150 { |
| 151 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); | 151 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); |
| 152 } | 152 } |
| 153 | 153 |
| 154 template<class CallbackInfo, class Wrappable> | 154 template<class CallbackInfo, class Wrappable> |
| 155 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtrWil
lBeRawPtr<TestInterfaceGarbageCollected> impl, Wrappable* wrappable) | 155 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtrWil
lBeRawPtr<TestInterfaceWillBeGarbageCollected> impl, Wrappable* wrappable) |
| 156 { | 156 { |
| 157 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 157 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
| 158 } | 158 } |
| 159 | 159 |
| 160 } | 160 } |
| 161 #endif // V8TestInterfaceGarbageCollected_h | 161 #endif // V8TestInterfaceWillBeGarbageCollected_h |
| OLD | NEW |