OLD | NEW |
1 /* | 1 /* |
2 This file is part of the Blink open source project. | 2 This file is part of the Blink open source project. |
3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! | 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! |
4 | 4 |
5 This library is free software; you can redistribute it and/or | 5 This library is free software; you can redistribute it and/or |
6 modify it under the terms of the GNU Library General Public | 6 modify it under the terms of the GNU Library General Public |
7 License as published by the Free Software Foundation; either | 7 License as published by the Free Software Foundation; either |
8 version 2 of the License, or (at your option) any later version. | 8 version 2 of the License, or (at your option) any later version. |
9 | 9 |
10 This library is distributed in the hope that it will be useful, | 10 This library is distributed in the hope that it will be useful, |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 namespace WebCore { | 30 namespace WebCore { |
31 | 31 |
32 class V8TestNode { | 32 class V8TestNode { |
33 public: | 33 public: |
34 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
e); | 34 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
e); |
35 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); | 35 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); |
36 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor
ldType); | 36 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor
ldType); |
37 static TestNode* toNative(v8::Handle<v8::Object> object) | 37 static TestNode* toNative(v8::Handle<v8::Object> object) |
38 { | 38 { |
39 return reinterpret_cast<TestNode*>(object->GetAlignedPointerFromInternal
Field(v8DOMWrapperObjectIndex)); | 39 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); |
40 } | 40 } |
41 static void derefObject(void*); | 41 static void derefObject(void*); |
42 static WrapperTypeInfo info; | 42 static WrapperTypeInfo info; |
43 static EventTarget* toEventTarget(v8::Handle<v8::Object>); | 43 static EventTarget* toEventTarget(v8::Handle<v8::Object>); |
44 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 44 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
45 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | 45 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; |
| 46 static inline void* toInternalPointer(TestNode* impl) |
| 47 { |
| 48 return V8Node::toInternalPointer(impl); |
| 49 } |
| 50 |
| 51 static inline TestNode* fromInternalPointer(void* object) |
| 52 { |
| 53 return static_cast<TestNode*>(V8Node::fromInternalPointer(object)); |
| 54 } |
46 static void installPerContextProperties(v8::Handle<v8::Object>, TestNode*, v
8::Isolate*) { } | 55 static void installPerContextProperties(v8::Handle<v8::Object>, TestNode*, v
8::Isolate*) { } |
47 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8:
:Isolate*) { } | 56 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8:
:Isolate*) { } |
48 private: | 57 private: |
49 friend v8::Handle<v8::Object> wrap(TestNode*, v8::Handle<v8::Object> creatio
nContext, v8::Isolate*); | 58 friend v8::Handle<v8::Object> wrap(TestNode*, v8::Handle<v8::Object> creatio
nContext, v8::Isolate*); |
50 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestNode>, v8::Handle
<v8::Object> creationContext, v8::Isolate*); | 59 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestNode>, v8::Handle
<v8::Object> creationContext, v8::Isolate*); |
51 }; | 60 }; |
52 | 61 |
53 template<> | 62 template<> |
54 class WrapperTypeTraits<TestNode > { | 63 class WrapperTypeTraits<TestNode > { |
55 public: | 64 public: |
56 static WrapperTypeInfo* info() { return &V8TestNode::info; } | 65 static WrapperTypeInfo* info() { return &V8TestNode::info; } |
57 }; | 66 }; |
58 | 67 |
59 | 68 |
60 inline v8::Handle<v8::Object> wrap(TestNode* impl, v8::Handle<v8::Object> creati
onContext, v8::Isolate* isolate) | 69 inline v8::Handle<v8::Object> wrap(TestNode* impl, v8::Handle<v8::Object> creati
onContext, v8::Isolate* isolate) |
61 { | 70 { |
62 ASSERT(impl); | 71 ASSERT(impl); |
63 ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty()); | 72 ASSERT(DOMDataStore::getWrapper<V8TestNode>(impl, isolate).IsEmpty()); |
64 if (ScriptWrappable::wrapperCanBeStoredInObject(impl)) { | 73 if (ScriptWrappable::wrapperCanBeStoredInObject(impl)) { |
65 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl); | 74 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl); |
66 // Might be a XXXConstructor::info instead of an XXX::info. These will b
oth have | 75 // Might be a XXXConstructor::info instead of an XXX::info. These will b
oth have |
67 // the same object de-ref functions, though, so use that as the basis of
the check. | 76 // the same object de-ref functions, though, so use that as the basis of
the check. |
68 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== V8TestNode::info.derefObjectFunction); | 77 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== V8TestNode::info.derefObjectFunction); |
69 } | 78 } |
70 return V8TestNode::createWrapper(impl, creationContext, isolate); | 79 return V8TestNode::createWrapper(impl, creationContext, isolate); |
71 } | 80 } |
72 | 81 |
73 inline v8::Handle<v8::Value> toV8(TestNode* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) | 82 inline v8::Handle<v8::Value> toV8(TestNode* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) |
74 { | 83 { |
75 if (UNLIKELY(!impl)) | 84 if (UNLIKELY(!impl)) |
76 return v8NullWithCheck(isolate); | 85 return v8NullWithCheck(isolate); |
77 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate); | 86 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestNode>(impl, i
solate); |
78 if (!wrapper.IsEmpty()) | 87 if (!wrapper.IsEmpty()) |
79 return wrapper; | 88 return wrapper; |
80 return wrap(impl, creationContext, isolate); | 89 return wrap(impl, creationContext, isolate); |
81 } | 90 } |
82 | 91 |
83 inline v8::Handle<v8::Value> toV8ForMainWorld(TestNode* impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) | 92 inline v8::Handle<v8::Value> toV8ForMainWorld(TestNode* impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) |
84 { | 93 { |
85 ASSERT(worldType(isolate) == MainWorld); | 94 ASSERT(worldType(isolate) == MainWorld); |
86 if (UNLIKELY(!impl)) | 95 if (UNLIKELY(!impl)) |
87 return v8NullWithCheck(isolate); | 96 return v8NullWithCheck(isolate); |
88 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld(impl); | 97 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld<V8TestN
ode>(impl); |
89 if (!wrapper.IsEmpty()) | 98 if (!wrapper.IsEmpty()) |
90 return wrapper; | 99 return wrapper; |
91 return wrap(impl, creationContext, isolate); | 100 return wrap(impl, creationContext, isolate); |
92 } | 101 } |
93 | 102 |
94 template<class HolderContainer, class Wrappable> | 103 template<class HolderContainer, class Wrappable> |
95 inline v8::Handle<v8::Value> toV8Fast(TestNode* impl, const HolderContainer& con
tainer, Wrappable* wrappable) | 104 inline v8::Handle<v8::Value> toV8Fast(TestNode* impl, const HolderContainer& con
tainer, Wrappable* wrappable) |
96 { | 105 { |
97 if (UNLIKELY(!impl)) | 106 if (UNLIKELY(!impl)) |
98 return v8::Null(container.GetIsolate()); | 107 return v8::Null(container.GetIsolate()); |
99 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast(impl, containe
r, wrappable); | 108 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast<V8TestNode>(im
pl, container, wrappable); |
100 if (!wrapper.IsEmpty()) | 109 if (!wrapper.IsEmpty()) |
101 return wrapper; | 110 return wrapper; |
102 return wrap(impl, container.Holder(), container.GetIsolate()); | 111 return wrap(impl, container.Holder(), container.GetIsolate()); |
103 } | 112 } |
104 | 113 |
105 template<class HolderContainer, class Wrappable> | 114 template<class HolderContainer, class Wrappable> |
106 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestNode* impl, const HolderCo
ntainer& container, Wrappable* wrappable) | 115 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestNode* impl, const HolderCo
ntainer& container, Wrappable* wrappable) |
107 { | 116 { |
108 ASSERT(worldType(container.GetIsolate()) == MainWorld); | 117 ASSERT(worldType(container.GetIsolate()) == MainWorld); |
109 if (UNLIKELY(!impl)) | 118 if (UNLIKELY(!impl)) |
110 return v8::Null(container.GetIsolate()); | 119 return v8::Null(container.GetIsolate()); |
111 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld(impl); | 120 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld<V8Test
Node>(impl); |
112 if (!wrapper.IsEmpty()) | 121 if (!wrapper.IsEmpty()) |
113 return wrapper; | 122 return wrapper; |
114 return wrap(impl, container.Holder(), container.GetIsolate()); | 123 return wrap(impl, container.Holder(), container.GetIsolate()); |
115 } | 124 } |
116 | 125 |
117 template<class HolderContainer, class Wrappable> | 126 template<class HolderContainer, class Wrappable> |
118 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< TestNode > impl, c
onst HolderContainer& container, Wrappable* wrappable) | 127 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< TestNode > impl, c
onst HolderContainer& container, Wrappable* wrappable) |
119 { | 128 { |
120 return toV8FastForMainWorld(impl.get(), container, wrappable); | 129 return toV8FastForMainWorld(impl.get(), container, wrappable); |
121 } | 130 } |
122 | 131 |
123 | 132 |
124 template<class HolderContainer, class Wrappable> | 133 template<class HolderContainer, class Wrappable> |
125 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestNode > impl, const HolderC
ontainer& container, Wrappable* wrappable) | 134 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestNode > impl, const HolderC
ontainer& container, Wrappable* wrappable) |
126 { | 135 { |
127 return toV8Fast(impl.get(), container, wrappable); | 136 return toV8Fast(impl.get(), container, wrappable); |
128 } | 137 } |
129 | 138 |
130 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestNode > impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) | 139 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestNode > impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) |
131 { | 140 { |
132 return toV8(impl.get(), creationContext, isolate); | 141 return toV8(impl.get(), creationContext, isolate); |
133 } | 142 } |
134 | 143 |
135 } | 144 } |
136 | 145 |
137 #endif // V8TestNode_h | 146 #endif // V8TestNode_h |
OLD | NEW |