| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 This file is part of the WebKit open source project. | |
| 3 This file has been generated by generate-bindings.pl. DO NOT MODIFY! | |
| 4 | |
| 5 This library is free software; you can redistribute it and/or | |
| 6 modify it under the terms of the GNU Library General Public | |
| 7 License as published by the Free Software Foundation; either | |
| 8 version 2 of the License, or (at your option) any later version. | |
| 9 | |
| 10 This library is distributed in the hope that it will be useful, | |
| 11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 Library General Public License for more details. | |
| 14 | |
| 15 You should have received a copy of the GNU Library General Public License | |
| 16 along with this library; see the file COPYING.LIB. If not, write to | |
| 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
| 18 Boston, MA 02111-1307, USA. | |
| 19 */ | |
| 20 | |
| 21 #ifndef V8Float64Array_h | |
| 22 #define V8Float64Array_h | |
| 23 | |
| 24 #include "V8ArrayBufferView.h" | |
| 25 #include "V8Binding.h" | |
| 26 #include "V8DOMWrapper.h" | |
| 27 #include "WrapperTypeInfo.h" | |
| 28 #include <v8.h> | |
| 29 #include <wtf/Float64Array.h> | |
| 30 #include <wtf/HashMap.h> | |
| 31 #include <wtf/text/StringHash.h> | |
| 32 | |
| 33 namespace WebCore { | |
| 34 | |
| 35 class V8Float64Array { | |
| 36 public: | |
| 37 static const bool hasDependentLifetime = V8ArrayBufferView::hasDependentLife
time; | |
| 38 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
e); | |
| 39 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); | |
| 40 static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, Wrappe
rWorldType); | |
| 41 static Float64Array* toNative(v8::Handle<v8::Object> object) | |
| 42 { | |
| 43 return reinterpret_cast<Float64Array*>(object->GetAlignedPointerFromInte
rnalField(v8DOMWrapperObjectIndex)); | |
| 44 } | |
| 45 static void derefObject(void*); | |
| 46 static WrapperTypeInfo info; | |
| 47 static v8::Handle<v8::Value> constructorCallback(const v8::Arguments&); | |
| 48 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | |
| 49 static void installPerContextProperties(v8::Handle<v8::Object>, Float64Array
*, v8::Isolate*) { } | |
| 50 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8:
:Isolate*) { } | |
| 51 private: | |
| 52 friend v8::Handle<v8::Object> wrap(Float64Array*, v8::Handle<v8::Object> cre
ationContext, v8::Isolate*); | |
| 53 static v8::Handle<v8::Object> createWrapper(PassRefPtr<Float64Array>, v8::Ha
ndle<v8::Object> creationContext, v8::Isolate*); | |
| 54 }; | |
| 55 | |
| 56 template<> | |
| 57 class WrapperTypeTraits<Float64Array > { | |
| 58 public: | |
| 59 static WrapperTypeInfo* info() { return &V8Float64Array::info; } | |
| 60 }; | |
| 61 | |
| 62 | |
| 63 v8::Handle<v8::Object> wrap(Float64Array* impl, v8::Handle<v8::Object> creationC
ontext, v8::Isolate*); | |
| 64 | |
| 65 inline v8::Handle<v8::Value> toV8(Float64Array* impl, v8::Handle<v8::Object> cre
ationContext, v8::Isolate* isolate) | |
| 66 { | |
| 67 if (UNLIKELY(!impl)) | |
| 68 return v8NullWithCheck(isolate); | |
| 69 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate); | |
| 70 if (!wrapper.IsEmpty()) | |
| 71 return wrapper; | |
| 72 return wrap(impl, creationContext, isolate); | |
| 73 } | |
| 74 | |
| 75 inline v8::Handle<v8::Value> toV8ForMainWorld(Float64Array* impl, v8::Handle<v8:
:Object> creationContext, v8::Isolate* isolate) | |
| 76 { | |
| 77 ASSERT(worldType(isolate) == MainWorld); | |
| 78 if (UNLIKELY(!impl)) | |
| 79 return v8NullWithCheck(isolate); | |
| 80 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld(impl); | |
| 81 if (!wrapper.IsEmpty()) | |
| 82 return wrapper; | |
| 83 return wrap(impl, creationContext, isolate); | |
| 84 } | |
| 85 | |
| 86 template<class HolderContainer, class Wrappable> | |
| 87 inline v8::Handle<v8::Value> toV8Fast(Float64Array* impl, const HolderContainer&
container, Wrappable* wrappable) | |
| 88 { | |
| 89 if (UNLIKELY(!impl)) | |
| 90 return v8Null(container.GetIsolate()); | |
| 91 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast(impl, containe
r, wrappable); | |
| 92 if (!wrapper.IsEmpty()) | |
| 93 return wrapper; | |
| 94 return wrap(impl, container.Holder(), container.GetIsolate()); | |
| 95 } | |
| 96 | |
| 97 template<class HolderContainer, class Wrappable> | |
| 98 inline v8::Handle<v8::Value> toV8FastForMainWorld(Float64Array* impl, const Hold
erContainer& container, Wrappable* wrappable) | |
| 99 { | |
| 100 ASSERT(worldType(container.GetIsolate()) == MainWorld); | |
| 101 if (UNLIKELY(!impl)) | |
| 102 return v8Null(container.GetIsolate()); | |
| 103 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld(impl); | |
| 104 if (!wrapper.IsEmpty()) | |
| 105 return wrapper; | |
| 106 return wrap(impl, container.Holder(), container.GetIsolate()); | |
| 107 } | |
| 108 | |
| 109 template<class HolderContainer, class Wrappable> | |
| 110 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< Float64Array > imp
l, const HolderContainer& container, Wrappable* wrappable) | |
| 111 { | |
| 112 return toV8FastForMainWorld(impl.get(), container, wrappable); | |
| 113 } | |
| 114 | |
| 115 | |
| 116 template<class HolderContainer, class Wrappable> | |
| 117 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< Float64Array > impl, const Hol
derContainer& container, Wrappable* wrappable) | |
| 118 { | |
| 119 return toV8Fast(impl.get(), container, wrappable); | |
| 120 } | |
| 121 | |
| 122 inline v8::Handle<v8::Value> toV8(PassRefPtr< Float64Array > impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) | |
| 123 { | |
| 124 return toV8(impl.get(), creationContext, isolate); | |
| 125 } | |
| 126 | |
| 127 } | |
| 128 | |
| 129 #endif // V8Float64Array_h | |
| OLD | NEW |