| 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 V8TestActiveDOMObject_h | |
| 22 #define V8TestActiveDOMObject_h | |
| 23 | |
| 24 #include "TestActiveDOMObject.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 V8TestActiveDOMObject { | |
| 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 TestActiveDOMObject* toNative(v8::Handle<v8::Object> object) | |
| 41 { | |
| 42 return reinterpret_cast<TestActiveDOMObject*>(object->GetAlignedPointerF
romInternalField(v8DOMWrapperObjectIndex)); | |
| 43 } | |
| 44 static void derefObject(void*); | |
| 45 static WrapperTypeInfo info; | |
| 46 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | |
| 47 static void installPerContextProperties(v8::Handle<v8::Object>, TestActiveDO
MObject*, v8::Isolate*) { } | |
| 48 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8:
:Isolate*) { } | |
| 49 private: | |
| 50 friend v8::Handle<v8::Object> wrap(TestActiveDOMObject*, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate*); | |
| 51 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestActiveDOMObject>,
v8::Handle<v8::Object> creationContext, v8::Isolate*); | |
| 52 }; | |
| 53 | |
| 54 template<> | |
| 55 class WrapperTypeTraits<TestActiveDOMObject > { | |
| 56 public: | |
| 57 static WrapperTypeInfo* info() { return &V8TestActiveDOMObject::info; } | |
| 58 }; | |
| 59 | |
| 60 | |
| 61 inline v8::Handle<v8::Object> wrap(TestActiveDOMObject* impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) | |
| 62 { | |
| 63 ASSERT(impl); | |
| 64 ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty()); | |
| 65 return V8TestActiveDOMObject::createWrapper(impl, creationContext, isolate); | |
| 66 } | |
| 67 | |
| 68 inline v8::Handle<v8::Value> toV8(TestActiveDOMObject* impl, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate* isolate) | |
| 69 { | |
| 70 if (UNLIKELY(!impl)) | |
| 71 return v8NullWithCheck(isolate); | |
| 72 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate); | |
| 73 if (!wrapper.IsEmpty()) | |
| 74 return wrapper; | |
| 75 return wrap(impl, creationContext, isolate); | |
| 76 } | |
| 77 | |
| 78 inline v8::Handle<v8::Value> toV8ForMainWorld(TestActiveDOMObject* impl, v8::Han
dle<v8::Object> creationContext, v8::Isolate* isolate) | |
| 79 { | |
| 80 ASSERT(worldType(isolate) == MainWorld); | |
| 81 if (UNLIKELY(!impl)) | |
| 82 return v8NullWithCheck(isolate); | |
| 83 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld(impl); | |
| 84 if (!wrapper.IsEmpty()) | |
| 85 return wrapper; | |
| 86 return wrap(impl, creationContext, isolate); | |
| 87 } | |
| 88 | |
| 89 template<class HolderContainer, class Wrappable> | |
| 90 inline v8::Handle<v8::Value> toV8Fast(TestActiveDOMObject* impl, const HolderCon
tainer& container, Wrappable* wrappable) | |
| 91 { | |
| 92 if (UNLIKELY(!impl)) | |
| 93 return v8Null(container.GetIsolate()); | |
| 94 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast(impl, containe
r, wrappable); | |
| 95 if (!wrapper.IsEmpty()) | |
| 96 return wrapper; | |
| 97 return wrap(impl, container.Holder(), container.GetIsolate()); | |
| 98 } | |
| 99 | |
| 100 template<class HolderContainer, class Wrappable> | |
| 101 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestActiveDOMObject* impl, con
st HolderContainer& container, Wrappable* wrappable) | |
| 102 { | |
| 103 ASSERT(worldType(container.GetIsolate()) == MainWorld); | |
| 104 if (UNLIKELY(!impl)) | |
| 105 return v8Null(container.GetIsolate()); | |
| 106 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld(impl); | |
| 107 if (!wrapper.IsEmpty()) | |
| 108 return wrapper; | |
| 109 return wrap(impl, container.Holder(), container.GetIsolate()); | |
| 110 } | |
| 111 | |
| 112 template<class HolderContainer, class Wrappable> | |
| 113 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< TestActiveDOMObjec
t > impl, const HolderContainer& container, Wrappable* wrappable) | |
| 114 { | |
| 115 return toV8FastForMainWorld(impl.get(), container, wrappable); | |
| 116 } | |
| 117 | |
| 118 | |
| 119 template<class HolderContainer, class Wrappable> | |
| 120 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestActiveDOMObject > impl, co
nst HolderContainer& container, Wrappable* wrappable) | |
| 121 { | |
| 122 return toV8Fast(impl.get(), container, wrappable); | |
| 123 } | |
| 124 | |
| 125 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestActiveDOMObject > impl, v8::Ha
ndle<v8::Object> creationContext, v8::Isolate* isolate) | |
| 126 { | |
| 127 return toV8(impl.get(), creationContext, isolate); | |
| 128 } | |
| 129 | |
| 130 } | |
| 131 | |
| 132 #endif // V8TestActiveDOMObject_h | |
| OLD | NEW |