| 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 V8TestNode_h | |
| 22 #define V8TestNode_h | |
| 23 | |
| 24 #include "TestNode.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 V8TestNode { | |
| 35 public: | |
| 36 static const bool hasDependentLifetime = true; | |
| 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 TestNode* toNative(v8::Handle<v8::Object> object) | |
| 41 { | |
| 42 return reinterpret_cast<TestNode*>(object->GetAlignedPointerFromInternal
Field(v8DOMWrapperObjectIndex)); | |
| 43 } | |
| 44 static void derefObject(void*); | |
| 45 static WrapperTypeInfo info; | |
| 46 static EventTarget* toEventTarget(v8::Handle<v8::Object>); | |
| 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>, TestNode*, v
8::Isolate*) { } | |
| 50 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8:
:Isolate*) { } | |
| 51 private: | |
| 52 friend v8::Handle<v8::Object> wrap(TestNode*, v8::Handle<v8::Object> creatio
nContext, v8::Isolate*); | |
| 53 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestNode>, v8::Handle
<v8::Object> creationContext, v8::Isolate*); | |
| 54 }; | |
| 55 | |
| 56 template<> | |
| 57 class WrapperTypeTraits<TestNode > { | |
| 58 public: | |
| 59 static WrapperTypeInfo* info() { return &V8TestNode::info; } | |
| 60 }; | |
| 61 | |
| 62 | |
| 63 inline v8::Handle<v8::Object> wrap(TestNode* impl, v8::Handle<v8::Object> creati
onContext, v8::Isolate* isolate) | |
| 64 { | |
| 65 ASSERT(impl); | |
| 66 ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty()); | |
| 67 return V8TestNode::createWrapper(impl, creationContext, isolate); | |
| 68 } | |
| 69 | |
| 70 inline v8::Handle<v8::Value> toV8(TestNode* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) | |
| 71 { | |
| 72 if (UNLIKELY(!impl)) | |
| 73 return v8NullWithCheck(isolate); | |
| 74 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate); | |
| 75 if (!wrapper.IsEmpty()) | |
| 76 return wrapper; | |
| 77 return wrap(impl, creationContext, isolate); | |
| 78 } | |
| 79 | |
| 80 inline v8::Handle<v8::Value> toV8ForMainWorld(TestNode* impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) | |
| 81 { | |
| 82 ASSERT(worldType(isolate) == MainWorld); | |
| 83 if (UNLIKELY(!impl)) | |
| 84 return v8NullWithCheck(isolate); | |
| 85 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld(impl); | |
| 86 if (!wrapper.IsEmpty()) | |
| 87 return wrapper; | |
| 88 return wrap(impl, creationContext, isolate); | |
| 89 } | |
| 90 | |
| 91 template<class HolderContainer, class Wrappable> | |
| 92 inline v8::Handle<v8::Value> toV8Fast(TestNode* impl, const HolderContainer& con
tainer, Wrappable* wrappable) | |
| 93 { | |
| 94 if (UNLIKELY(!impl)) | |
| 95 return v8Null(container.GetIsolate()); | |
| 96 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast(impl, containe
r, wrappable); | |
| 97 if (!wrapper.IsEmpty()) | |
| 98 return wrapper; | |
| 99 return wrap(impl, container.Holder(), container.GetIsolate()); | |
| 100 } | |
| 101 | |
| 102 template<class HolderContainer, class Wrappable> | |
| 103 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestNode* impl, const HolderCo
ntainer& container, Wrappable* wrappable) | |
| 104 { | |
| 105 ASSERT(worldType(container.GetIsolate()) == MainWorld); | |
| 106 if (UNLIKELY(!impl)) | |
| 107 return v8Null(container.GetIsolate()); | |
| 108 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld(impl); | |
| 109 if (!wrapper.IsEmpty()) | |
| 110 return wrapper; | |
| 111 return wrap(impl, container.Holder(), container.GetIsolate()); | |
| 112 } | |
| 113 | |
| 114 template<class HolderContainer, class Wrappable> | |
| 115 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< TestNode > impl, c
onst HolderContainer& container, Wrappable* wrappable) | |
| 116 { | |
| 117 return toV8FastForMainWorld(impl.get(), container, wrappable); | |
| 118 } | |
| 119 | |
| 120 | |
| 121 template<class HolderContainer, class Wrappable> | |
| 122 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestNode > impl, const HolderC
ontainer& container, Wrappable* wrappable) | |
| 123 { | |
| 124 return toV8Fast(impl.get(), container, wrappable); | |
| 125 } | |
| 126 | |
| 127 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestNode > impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) | |
| 128 { | |
| 129 return toV8(impl.get(), creationContext, isolate); | |
| 130 } | |
| 131 | |
| 132 } | |
| 133 | |
| 134 #endif // V8TestNode_h | |
| OLD | NEW |