| 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 V8TestInterfaceDocument_h | 33 #ifndef V8TestSpecialOperations_h |
| 34 #define V8TestInterfaceDocument_h | 34 #define V8TestSpecialOperations_h |
| 35 | 35 |
| 36 #include "V8Document.h" | 36 #include "bindings/tests/idls/TestSpecialOperations.h" |
| 37 #include "bindings/tests/idls/TestInterfaceDocument.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 V8TestInterfaceDocument { | 43 class V8TestSpecialOperations { |
| 45 public: | 44 public: |
| 46 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*); | 45 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*); |
| 47 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWor
ldType); | 46 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWor
ldType); |
| 48 static TestInterfaceDocument* toNative(v8::Handle<v8::Object> object) | 47 static TestSpecialOperations* toNative(v8::Handle<v8::Object> object) |
| 49 { | 48 { |
| 50 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); | 49 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); |
| 51 } | 50 } |
| 52 static void derefObject(void*); | 51 static void derefObject(void*); |
| 53 static const WrapperTypeInfo wrapperTypeInfo; | 52 static const WrapperTypeInfo wrapperTypeInfo; |
| 54 static EventTarget* toEventTarget(v8::Handle<v8::Object>); | |
| 55 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | 53 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; |
| 56 static inline void* toInternalPointer(TestInterfaceDocument* impl) | 54 static inline void* toInternalPointer(TestSpecialOperations* impl) |
| 57 { | 55 { |
| 58 return V8Document::toInternalPointer(impl); | 56 return impl; |
| 59 } | 57 } |
| 60 | 58 |
| 61 static inline TestInterfaceDocument* fromInternalPointer(void* object) | 59 static inline TestSpecialOperations* fromInternalPointer(void* object) |
| 62 { | 60 { |
| 63 return static_cast<TestInterfaceDocument*>(V8Document::fromInternalPoint
er(object)); | 61 return static_cast<TestSpecialOperations*>(object); |
| 64 } | 62 } |
| 65 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestI
nterfaceDocument*, v8::Isolate*) { } | 63 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestS
pecialOperations*, v8::Isolate*) { } |
| 66 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } | 64 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } |
| 67 | 65 |
| 68 private: | 66 private: |
| 69 friend v8::Handle<v8::Object> wrap(TestInterfaceDocument*, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate*); | 67 friend v8::Handle<v8::Object> wrap(TestSpecialOperations*, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate*); |
| 70 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterfaceDocument
>, v8::Handle<v8::Object> creationContext, v8::Isolate*); | 68 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestSpecialOperations
>, v8::Handle<v8::Object> creationContext, v8::Isolate*); |
| 71 }; | 69 }; |
| 72 | 70 |
| 73 template<> | 71 template<> |
| 74 class WrapperTypeTraits<TestInterfaceDocument > { | 72 class WrapperTypeTraits<TestSpecialOperations > { |
| 75 public: | 73 public: |
| 76 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfaceDoc
ument::wrapperTypeInfo; } | 74 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestSpecialOpera
tions::wrapperTypeInfo; } |
| 77 }; | 75 }; |
| 78 | 76 |
| 79 v8::Handle<v8::Object> wrap(TestInterfaceDocument* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate*); | 77 inline v8::Handle<v8::Object> wrap(TestSpecialOperations* impl, v8::Handle<v8::O
bject> creationContext, v8::Isolate* isolate) |
| 78 { |
| 79 ASSERT(impl); |
| 80 ASSERT(!DOMDataStore::containsWrapper<V8TestSpecialOperations>(impl, isolate
)); |
| 81 return V8TestSpecialOperations::createWrapper(impl, creationContext, isolate
); |
| 82 } |
| 80 | 83 |
| 81 inline v8::Handle<v8::Value> toV8(TestInterfaceDocument* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) | 84 inline v8::Handle<v8::Value> toV8(TestSpecialOperations* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) |
| 82 { | 85 { |
| 83 if (UNLIKELY(!impl)) | 86 if (UNLIKELY(!impl)) |
| 84 return v8::Null(isolate); | 87 return v8::Null(isolate); |
| 85 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceDocu
ment>(impl, isolate); | 88 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestSpecialOperat
ions>(impl, isolate); |
| 86 if (!wrapper.IsEmpty()) | 89 if (!wrapper.IsEmpty()) |
| 87 return wrapper; | 90 return wrapper; |
| 88 return wrap(impl, creationContext, isolate); | 91 return wrap(impl, creationContext, isolate); |
| 89 } | 92 } |
| 90 | 93 |
| 91 template<typename CallbackInfo> | 94 template<typename CallbackInfo> |
| 92 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceDocu
ment* impl) | 95 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestSpecialOperat
ions* impl) |
| 93 { | 96 { |
| 94 if (UNLIKELY(!impl)) { | 97 if (UNLIKELY(!impl)) { |
| 95 v8SetReturnValueNull(callbackInfo); | 98 v8SetReturnValueNull(callbackInfo); |
| 96 return; | 99 return; |
| 97 } | 100 } |
| 98 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceDocument>(callbac
kInfo.GetReturnValue(), impl)) | 101 if (DOMDataStore::setReturnValueFromWrapper<V8TestSpecialOperations>(callbac
kInfo.GetReturnValue(), impl)) |
| 99 return; | 102 return; |
| 100 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 103 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); |
| 101 v8SetReturnValue(callbackInfo, wrapper); | 104 v8SetReturnValue(callbackInfo, wrapper); |
| 102 } | 105 } |
| 103 | 106 |
| 104 template<typename CallbackInfo> | 107 template<typename CallbackInfo> |
| 105 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestI
nterfaceDocument* impl) | 108 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestS
pecialOperations* impl) |
| 106 { | 109 { |
| 107 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); | 110 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); |
| 108 if (UNLIKELY(!impl)) { | 111 if (UNLIKELY(!impl)) { |
| 109 v8SetReturnValueNull(callbackInfo); | 112 v8SetReturnValueNull(callbackInfo); |
| 110 return; | 113 return; |
| 111 } | 114 } |
| 112 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceDocum
ent>(callbackInfo.GetReturnValue(), impl)) | 115 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestSpecialOperati
ons>(callbackInfo.GetReturnValue(), impl)) |
| 113 return; | 116 return; |
| 114 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); | 117 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); |
| 115 v8SetReturnValue(callbackInfo, wrapper); | 118 v8SetReturnValue(callbackInfo, wrapper); |
| 116 } | 119 } |
| 117 | 120 |
| 118 template<class CallbackInfo, class Wrappable> | 121 template<class CallbackInfo, class Wrappable> |
| 119 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface
Document* impl, Wrappable* wrappable) | 122 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestSpecialOp
erations* impl, Wrappable* wrappable) |
| 120 { | 123 { |
| 121 if (UNLIKELY(!impl)) { | 124 if (UNLIKELY(!impl)) { |
| 122 v8SetReturnValueNull(callbackInfo); | 125 v8SetReturnValueNull(callbackInfo); |
| 123 return; | 126 return; |
| 124 } | 127 } |
| 125 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceDocument>(cal
lbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) | 128 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestSpecialOperations>(cal
lbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) |
| 126 return; | 129 return; |
| 127 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 130 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); |
| 128 v8SetReturnValue(callbackInfo, wrapper); | 131 v8SetReturnValue(callbackInfo, wrapper); |
| 129 } | 132 } |
| 130 | 133 |
| 131 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfaceDocument > impl, v8::H
andle<v8::Object> creationContext, v8::Isolate* isolate) | 134 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestSpecialOperations > impl, v8::H
andle<v8::Object> creationContext, v8::Isolate* isolate) |
| 132 { | 135 { |
| 133 return toV8(impl.get(), creationContext, isolate); | 136 return toV8(impl.get(), creationContext, isolate); |
| 134 } | 137 } |
| 135 | 138 |
| 136 template<class CallbackInfo> | 139 template<class CallbackInfo> |
| 137 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestIn
terfaceDocument > impl) | 140 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestSp
ecialOperations > impl) |
| 138 { | 141 { |
| 139 v8SetReturnValue(callbackInfo, impl.get()); | 142 v8SetReturnValue(callbackInfo, impl.get()); |
| 140 } | 143 } |
| 141 | 144 |
| 142 template<class CallbackInfo> | 145 template<class CallbackInfo> |
| 143 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestInterfaceDocument > impl) | 146 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestSpecialOperations > impl) |
| 144 { | 147 { |
| 145 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); | 148 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); |
| 146 } | 149 } |
| 147 | 150 |
| 148 template<class CallbackInfo, class Wrappable> | 151 template<class CallbackInfo, class Wrappable> |
| 149 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stInterfaceDocument > impl, Wrappable* wrappable) | 152 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stSpecialOperations > impl, Wrappable* wrappable) |
| 150 { | 153 { |
| 151 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 154 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
| 152 } | 155 } |
| 153 | 156 |
| 154 } | 157 } |
| 155 #endif // V8TestInterfaceDocument_h | 158 #endif // V8TestSpecialOperations_h |
| OLD | NEW |