| 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 V8TestExtendedEvent_h | |
| 34 #define V8TestExtendedEvent_h | |
| 35 | |
| 36 #if ENABLE(TEST) | |
| 37 #include "V8TestEvent.h" | |
| 38 #include "bindings/tests/idls/Event.h" | |
| 39 #include "bindings/v8/V8Binding.h" | |
| 40 #include "bindings/v8/V8DOMWrapper.h" | |
| 41 #include "bindings/v8/WrapperTypeInfo.h" | |
| 42 | |
| 43 namespace WebCore { | |
| 44 | |
| 45 class Dictionary; | |
| 46 class V8TestExtendedEvent { | |
| 47 public: | |
| 48 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
e); | |
| 49 static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); | |
| 50 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWor
ldType); | |
| 51 static Event* toNative(v8::Handle<v8::Object> object) | |
| 52 { | |
| 53 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); | |
| 54 } | |
| 55 static void derefObject(void*); | |
| 56 static const WrapperTypeInfo wrapperTypeInfo; | |
| 57 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 58 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | |
| 59 static inline void* toInternalPointer(Event* impl) | |
| 60 { | |
| 61 return V8TestEvent::toInternalPointer(impl); | |
| 62 } | |
| 63 | |
| 64 static inline Event* fromInternalPointer(void* object) | |
| 65 { | |
| 66 return static_cast<Event*>(V8TestEvent::fromInternalPointer(object)); | |
| 67 } | |
| 68 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, Event
*, v8::Isolate*) { } | |
| 69 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } | |
| 70 | |
| 71 private: | |
| 72 friend v8::Handle<v8::Object> wrap(Event*, v8::Handle<v8::Object> creationCo
ntext, v8::Isolate*); | |
| 73 static v8::Handle<v8::Object> createWrapper(PassRefPtr<Event>, v8::Handle<v8
::Object> creationContext, v8::Isolate*); | |
| 74 }; | |
| 75 | |
| 76 template<> | |
| 77 class WrapperTypeTraits<Event > { | |
| 78 public: | |
| 79 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestExtendedEven
t::wrapperTypeInfo; } | |
| 80 }; | |
| 81 | |
| 82 inline v8::Handle<v8::Object> wrap(Event* impl, v8::Handle<v8::Object> creationC
ontext, v8::Isolate* isolate) | |
| 83 { | |
| 84 ASSERT(impl); | |
| 85 ASSERT(!DOMDataStore::containsWrapper<V8TestExtendedEvent>(impl, isolate)); | |
| 86 return V8TestExtendedEvent::createWrapper(impl, creationContext, isolate); | |
| 87 } | |
| 88 | |
| 89 inline v8::Handle<v8::Value> toV8(Event* impl, v8::Handle<v8::Object> creationCo
ntext, v8::Isolate* isolate) | |
| 90 { | |
| 91 if (UNLIKELY(!impl)) | |
| 92 return v8::Null(isolate); | |
| 93 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestExtendedEvent
>(impl, isolate); | |
| 94 if (!wrapper.IsEmpty()) | |
| 95 return wrapper; | |
| 96 return wrap(impl, creationContext, isolate); | |
| 97 } | |
| 98 | |
| 99 template<typename CallbackInfo> | |
| 100 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, Event* impl) | |
| 101 { | |
| 102 if (UNLIKELY(!impl)) { | |
| 103 v8SetReturnValueNull(callbackInfo); | |
| 104 return; | |
| 105 } | |
| 106 if (DOMDataStore::setReturnValueFromWrapper<V8TestExtendedEvent>(callbackInf
o.GetReturnValue(), impl)) | |
| 107 return; | |
| 108 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | |
| 109 v8SetReturnValue(callbackInfo, wrapper); | |
| 110 } | |
| 111 | |
| 112 template<typename CallbackInfo> | |
| 113 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, Event
* impl) | |
| 114 { | |
| 115 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); | |
| 116 if (UNLIKELY(!impl)) { | |
| 117 v8SetReturnValueNull(callbackInfo); | |
| 118 return; | |
| 119 } | |
| 120 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestExtendedEvent>
(callbackInfo.GetReturnValue(), impl)) | |
| 121 return; | |
| 122 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); | |
| 123 v8SetReturnValue(callbackInfo, wrapper); | |
| 124 } | |
| 125 | |
| 126 template<class CallbackInfo, class Wrappable> | |
| 127 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, Event* impl,
Wrappable* wrappable) | |
| 128 { | |
| 129 if (UNLIKELY(!impl)) { | |
| 130 v8SetReturnValueNull(callbackInfo); | |
| 131 return; | |
| 132 } | |
| 133 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestExtendedEvent>(callbac
kInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) | |
| 134 return; | |
| 135 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | |
| 136 v8SetReturnValue(callbackInfo, wrapper); | |
| 137 } | |
| 138 | |
| 139 inline v8::Handle<v8::Value> toV8(PassRefPtr<Event > impl, v8::Handle<v8::Object
> creationContext, v8::Isolate* isolate) | |
| 140 { | |
| 141 return toV8(impl.get(), creationContext, isolate); | |
| 142 } | |
| 143 | |
| 144 template<class CallbackInfo> | |
| 145 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<Event
> impl) | |
| 146 { | |
| 147 v8SetReturnValue(callbackInfo, impl.get()); | |
| 148 } | |
| 149 | |
| 150 template<class CallbackInfo> | |
| 151 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<Event > impl) | |
| 152 { | |
| 153 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); | |
| 154 } | |
| 155 | |
| 156 template<class CallbackInfo, class Wrappable> | |
| 157 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Ev
ent > impl, Wrappable* wrappable) | |
| 158 { | |
| 159 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | |
| 160 } | |
| 161 | |
| 162 bool initializeEvent(EventInit&, const Dictionary&, ExceptionState&, const Strin
g& = ""); | |
| 163 | |
| 164 } | |
| 165 #endif // ENABLE(TEST) | |
| 166 #endif // V8TestExtendedEvent_h | |
| OLD | NEW |