| 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 V8TestCustomNamedGetter_h | |
| 22 #define V8TestCustomNamedGetter_h | |
| 23 | |
| 24 #include "TestCustomNamedGetter.h" | |
| 25 #include "V8Binding.h" | |
| 26 #include "V8DOMWrapper.h" | |
| 27 #include "WrapperTypeInfo.h" | |
| 28 #include <v8.h> | |
| 29 #include <wtf/HashMap.h> | |
| 30 #include <wtf/text/StringHash.h> | |
| 31 | |
| 32 namespace WebCore { | |
| 33 | |
| 34 class V8TestCustomNamedGetter { | |
| 35 public: | |
| 36 static const bool hasDependentLifetime = false; | |
| 37 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
e); | |
| 38 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); | |
| 39 static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, Wrappe
rWorldType); | |
| 40 static TestCustomNamedGetter* toNative(v8::Handle<v8::Object> object) | |
| 41 { | |
| 42 return reinterpret_cast<TestCustomNamedGetter*>(object->GetAlignedPointe
rFromInternalField(v8DOMWrapperObjectIndex)); | |
| 43 } | |
| 44 static void derefObject(void*); | |
| 45 static WrapperTypeInfo info; | |
| 46 static v8::Handle<v8::Value> namedPropertyGetter(v8::Local<v8::String>, cons
t v8::AccessorInfo&); | |
| 47 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | |
| 48 static void installPerContextProperties(v8::Handle<v8::Object>, TestCustomNa
medGetter*, v8::Isolate*) { } | |
| 49 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8:
:Isolate*) { } | |
| 50 private: | |
| 51 friend v8::Handle<v8::Object> wrap(TestCustomNamedGetter*, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate*); | |
| 52 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestCustomNamedGetter
>, v8::Handle<v8::Object> creationContext, v8::Isolate*); | |
| 53 }; | |
| 54 | |
| 55 template<> | |
| 56 class WrapperTypeTraits<TestCustomNamedGetter > { | |
| 57 public: | |
| 58 static WrapperTypeInfo* info() { return &V8TestCustomNamedGetter::info; } | |
| 59 }; | |
| 60 | |
| 61 | |
| 62 inline v8::Handle<v8::Object> wrap(TestCustomNamedGetter* impl, v8::Handle<v8::O
bject> creationContext, v8::Isolate* isolate) | |
| 63 { | |
| 64 ASSERT(impl); | |
| 65 ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty()); | |
| 66 return V8TestCustomNamedGetter::createWrapper(impl, creationContext, isolate
); | |
| 67 } | |
| 68 | |
| 69 inline v8::Handle<v8::Value> toV8(TestCustomNamedGetter* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) | |
| 70 { | |
| 71 if (UNLIKELY(!impl)) | |
| 72 return v8NullWithCheck(isolate); | |
| 73 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate); | |
| 74 if (!wrapper.IsEmpty()) | |
| 75 return wrapper; | |
| 76 return wrap(impl, creationContext, isolate); | |
| 77 } | |
| 78 | |
| 79 inline v8::Handle<v8::Value> toV8ForMainWorld(TestCustomNamedGetter* impl, v8::H
andle<v8::Object> creationContext, v8::Isolate* isolate) | |
| 80 { | |
| 81 ASSERT(worldType(isolate) == MainWorld); | |
| 82 if (UNLIKELY(!impl)) | |
| 83 return v8NullWithCheck(isolate); | |
| 84 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld(impl); | |
| 85 if (!wrapper.IsEmpty()) | |
| 86 return wrapper; | |
| 87 return wrap(impl, creationContext, isolate); | |
| 88 } | |
| 89 | |
| 90 template<class HolderContainer, class Wrappable> | |
| 91 inline v8::Handle<v8::Value> toV8Fast(TestCustomNamedGetter* impl, const HolderC
ontainer& container, Wrappable* wrappable) | |
| 92 { | |
| 93 if (UNLIKELY(!impl)) | |
| 94 return v8Null(container.GetIsolate()); | |
| 95 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast(impl, containe
r, wrappable); | |
| 96 if (!wrapper.IsEmpty()) | |
| 97 return wrapper; | |
| 98 return wrap(impl, container.Holder(), container.GetIsolate()); | |
| 99 } | |
| 100 | |
| 101 template<class HolderContainer, class Wrappable> | |
| 102 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestCustomNamedGetter* impl, c
onst HolderContainer& container, Wrappable* wrappable) | |
| 103 { | |
| 104 ASSERT(worldType(container.GetIsolate()) == MainWorld); | |
| 105 if (UNLIKELY(!impl)) | |
| 106 return v8Null(container.GetIsolate()); | |
| 107 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld(impl); | |
| 108 if (!wrapper.IsEmpty()) | |
| 109 return wrapper; | |
| 110 return wrap(impl, container.Holder(), container.GetIsolate()); | |
| 111 } | |
| 112 | |
| 113 template<class HolderContainer, class Wrappable> | |
| 114 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< TestCustomNamedGet
ter > impl, const HolderContainer& container, Wrappable* wrappable) | |
| 115 { | |
| 116 return toV8FastForMainWorld(impl.get(), container, wrappable); | |
| 117 } | |
| 118 | |
| 119 | |
| 120 template<class HolderContainer, class Wrappable> | |
| 121 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestCustomNamedGetter > impl,
const HolderContainer& container, Wrappable* wrappable) | |
| 122 { | |
| 123 return toV8Fast(impl.get(), container, wrappable); | |
| 124 } | |
| 125 | |
| 126 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestCustomNamedGetter > impl, v8::
Handle<v8::Object> creationContext, v8::Isolate* isolate) | |
| 127 { | |
| 128 return toV8(impl.get(), creationContext, isolate); | |
| 129 } | |
| 130 | |
| 131 } | |
| 132 | |
| 133 #endif // V8TestCustomNamedGetter_h | |
| OLD | NEW |