| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | |
| 3 * | |
| 4 * Redistribution and use in source and binary forms, with or without | |
| 5 * modification, are permitted provided that the following conditions are | |
| 6 * met: | |
| 7 * | |
| 8 * * Redistributions of source code must retain the above copyright | |
| 9 * notice, this list of conditions and the following disclaimer. | |
| 10 * * Redistributions in binary form must reproduce the above | |
| 11 * copyright notice, this list of conditions and the following disclaimer | |
| 12 * in the documentation and/or other materials provided with the | |
| 13 * distribution. | |
| 14 * * Neither the name of Google Inc. nor the names of its | |
| 15 * contributors may be used to endorse or promote products derived from | |
| 16 * this software without specific prior written permission. | |
| 17 * | |
| 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| 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. | |
| 29 */ | |
| 30 | |
| 31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! | |
| 32 | |
| 33 #ifndef V8TestSerializedScriptValueInterface_h | |
| 34 #define V8TestSerializedScriptValueInterface_h | |
| 35 | |
| 36 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 37 #include "bindings/tests/idls/TestSerializedScriptValueInterface.h" | |
| 38 #include "bindings/v8/V8Binding.h" | |
| 39 #include "bindings/v8/V8DOMWrapper.h" | |
| 40 #include "bindings/v8/WrapperTypeInfo.h" | |
| 41 | |
| 42 namespace WebCore { | |
| 43 | |
| 44 class V8TestSerializedScriptValueInterface { | |
| 45 public: | |
| 46 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
e); | |
| 47 static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); | |
| 48 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor
ldType); | |
| 49 static TestSerializedScriptValueInterface* toNative(v8::Handle<v8::Object> o
bject) | |
| 50 { | |
| 51 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); | |
| 52 } | |
| 53 static void derefObject(void*); | |
| 54 static const WrapperTypeInfo wrapperTypeInfo; | |
| 55 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | |
| 56 static inline void* toInternalPointer(TestSerializedScriptValueInterface* im
pl) | |
| 57 { | |
| 58 return impl; | |
| 59 } | |
| 60 | |
| 61 static inline TestSerializedScriptValueInterface* fromInternalPointer(void*
object) | |
| 62 { | |
| 63 return static_cast<TestSerializedScriptValueInterface*>(object); | |
| 64 } | |
| 65 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestS
erializedScriptValueInterface*, v8::Isolate*) { } | |
| 66 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } | |
| 67 | |
| 68 private: | |
| 69 friend v8::Handle<v8::Object> wrap(TestSerializedScriptValueInterface*, v8::
Handle<v8::Object> creationContext, v8::Isolate*); | |
| 70 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestSerializedScriptV
alueInterface>, v8::Handle<v8::Object> creationContext, v8::Isolate*); | |
| 71 }; | |
| 72 | |
| 73 template<> | |
| 74 class WrapperTypeTraits<TestSerializedScriptValueInterface > { | |
| 75 public: | |
| 76 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestSerializedSc
riptValueInterface::wrapperTypeInfo; } | |
| 77 }; | |
| 78 | |
| 79 inline v8::Handle<v8::Object> wrap(TestSerializedScriptValueInterface* impl, v8:
:Handle<v8::Object> creationContext, v8::Isolate* isolate) | |
| 80 { | |
| 81 ASSERT(impl); | |
| 82 ASSERT(!DOMDataStore::containsWrapper<V8TestSerializedScriptValueInterface>(
impl, isolate)); | |
| 83 return V8TestSerializedScriptValueInterface::createWrapper(impl, creationCon
text, isolate); | |
| 84 } | |
| 85 | |
| 86 inline v8::Handle<v8::Value> toV8(TestSerializedScriptValueInterface* impl, v8::
Handle<v8::Object> creationContext, v8::Isolate* isolate) | |
| 87 { | |
| 88 if (UNLIKELY(!impl)) | |
| 89 return v8::Null(isolate); | |
| 90 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestSerializedScr
iptValueInterface>(impl, isolate); | |
| 91 if (!wrapper.IsEmpty()) | |
| 92 return wrapper; | |
| 93 return wrap(impl, creationContext, isolate); | |
| 94 } | |
| 95 | |
| 96 template<typename CallbackInfo> | |
| 97 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestSerializedScr
iptValueInterface* impl) | |
| 98 { | |
| 99 if (UNLIKELY(!impl)) { | |
| 100 v8SetReturnValueNull(callbackInfo); | |
| 101 return; | |
| 102 } | |
| 103 if (DOMDataStore::setReturnValueFromWrapper<V8TestSerializedScriptValueInter
face>(callbackInfo.GetReturnValue(), impl)) | |
| 104 return; | |
| 105 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | |
| 106 v8SetReturnValue(callbackInfo, wrapper); | |
| 107 } | |
| 108 | |
| 109 template<typename CallbackInfo> | |
| 110 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestS
erializedScriptValueInterface* impl) | |
| 111 { | |
| 112 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); | |
| 113 if (UNLIKELY(!impl)) { | |
| 114 v8SetReturnValueNull(callbackInfo); | |
| 115 return; | |
| 116 } | |
| 117 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestSerializedScri
ptValueInterface>(callbackInfo.GetReturnValue(), impl)) | |
| 118 return; | |
| 119 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); | |
| 120 v8SetReturnValue(callbackInfo, wrapper); | |
| 121 } | |
| 122 | |
| 123 template<class CallbackInfo, class Wrappable> | |
| 124 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestSerialize
dScriptValueInterface* impl, Wrappable* wrappable) | |
| 125 { | |
| 126 if (UNLIKELY(!impl)) { | |
| 127 v8SetReturnValueNull(callbackInfo); | |
| 128 return; | |
| 129 } | |
| 130 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestSerializedScriptValueI
nterface>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)
) | |
| 131 return; | |
| 132 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | |
| 133 v8SetReturnValue(callbackInfo, wrapper); | |
| 134 } | |
| 135 | |
| 136 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestSerializedScriptValueInterface
> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | |
| 137 { | |
| 138 return toV8(impl.get(), creationContext, isolate); | |
| 139 } | |
| 140 | |
| 141 template<class CallbackInfo> | |
| 142 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestSe
rializedScriptValueInterface > impl) | |
| 143 { | |
| 144 v8SetReturnValue(callbackInfo, impl.get()); | |
| 145 } | |
| 146 | |
| 147 template<class CallbackInfo> | |
| 148 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestSerializedScriptValueInterface > impl) | |
| 149 { | |
| 150 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); | |
| 151 } | |
| 152 | |
| 153 template<class CallbackInfo, class Wrappable> | |
| 154 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stSerializedScriptValueInterface > impl, Wrappable* wrappable) | |
| 155 { | |
| 156 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | |
| 157 } | |
| 158 | |
| 159 } | |
| 160 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
| 161 #endif // V8TestSerializedScriptValueInterface_h | |
| OLD | NEW |