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 V8TestInterface { | 32 class V8TestInterface { |
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 TestInterface* toNative(v8::Handle<v8::Object> object) | 37 static TestInterface* toNative(v8::Handle<v8::Object> object) |
38 { | 38 { |
39 return reinterpret_cast<TestInterface*>(object->GetAlignedPointerFromInt
ernalField(v8DOMWrapperObjectIndex)); | 39 return fromWrappedType(object->GetAlignedPointerFromInternalField(v8DOMW
rapperObjectIndex)); |
40 } | 40 } |
41 static void derefObject(void*); | 41 static void derefObject(void*); |
42 static WrapperTypeInfo info; | 42 static WrapperTypeInfo info; |
43 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); | 43 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); |
44 #if ENABLE(Condition22) || ENABLE(Condition23) | 44 #if ENABLE(Condition22) || ENABLE(Condition23) |
45 static void implementsMethod3MethodCustom(const v8::FunctionCallbackInfo<v8:
:Value>&); | 45 static void implementsMethod3MethodCustom(const v8::FunctionCallbackInfo<v8:
:Value>&); |
46 #endif // ENABLE(Condition22) || ENABLE(Condition23) | 46 #endif // ENABLE(Condition22) || ENABLE(Condition23) |
47 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 47 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
48 #if ENABLE(Condition22) || ENABLE(Condition23) | 48 #if ENABLE(Condition22) || ENABLE(Condition23) |
49 static void implementsStr3AttrGetterCustom(v8::Local<v8::String> name, const
v8::PropertyCallbackInfo<v8::Value>&); | 49 static void implementsStr3AttrGetterCustom(v8::Local<v8::String> name, const
v8::PropertyCallbackInfo<v8::Value>&); |
50 #endif // ENABLE(Condition22) || ENABLE(Condition23) | 50 #endif // ENABLE(Condition22) || ENABLE(Condition23) |
51 #if ENABLE(Condition22) || ENABLE(Condition23) | 51 #if ENABLE(Condition22) || ENABLE(Condition23) |
52 static void implementsStr3AttrSetterCustom(v8::Local<v8::String> name, v8::L
ocal<v8::Value>, const v8::PropertyCallbackInfo<void>&); | 52 static void implementsStr3AttrSetterCustom(v8::Local<v8::String> name, v8::L
ocal<v8::Value>, const v8::PropertyCallbackInfo<void>&); |
53 #endif // ENABLE(Condition22) || ENABLE(Condition23) | 53 #endif // ENABLE(Condition22) || ENABLE(Condition23) |
54 static void namedPropertySetterCustom(v8::Local<v8::String>, v8::Local<v8::V
alue>, const v8::PropertyCallbackInfo<v8::Value>&); | 54 static void namedPropertySetterCustom(v8::Local<v8::String>, v8::Local<v8::V
alue>, const v8::PropertyCallbackInfo<v8::Value>&); |
55 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | 55 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; |
| 56 static inline void* toWrappedType(TestInterface* impl) |
| 57 { |
| 58 return impl; |
| 59 } |
| 60 |
| 61 static inline TestInterface* fromWrappedType(void* object) |
| 62 { |
| 63 return static_cast<TestInterface*>(object); |
| 64 } |
56 static void installPerContextProperties(v8::Handle<v8::Object>, TestInterfac
e*, v8::Isolate*); | 65 static void installPerContextProperties(v8::Handle<v8::Object>, TestInterfac
e*, v8::Isolate*); |
57 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8:
:Isolate*) { } | 66 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8:
:Isolate*) { } |
58 private: | 67 private: |
59 friend v8::Handle<v8::Object> wrap(TestInterface*, v8::Handle<v8::Object> cr
eationContext, v8::Isolate*); | 68 friend v8::Handle<v8::Object> wrap(TestInterface*, v8::Handle<v8::Object> cr
eationContext, v8::Isolate*); |
60 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterface>, v8::H
andle<v8::Object> creationContext, v8::Isolate*); | 69 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterface>, v8::H
andle<v8::Object> creationContext, v8::Isolate*); |
61 }; | 70 }; |
62 | 71 |
63 template<> | 72 template<> |
64 class WrapperTypeTraits<TestInterface > { | 73 class WrapperTypeTraits<TestInterface > { |
65 public: | 74 public: |
66 static WrapperTypeInfo* info() { return &V8TestInterface::info; } | 75 static WrapperTypeInfo* info() { return &V8TestInterface::info; } |
67 }; | 76 }; |
68 | 77 |
69 | 78 |
70 inline v8::Handle<v8::Object> wrap(TestInterface* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) | 79 inline v8::Handle<v8::Object> wrap(TestInterface* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) |
71 { | 80 { |
72 ASSERT(impl); | 81 ASSERT(impl); |
73 ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty()); | 82 ASSERT(DOMDataStore::getWrapper<V8TestInterface>(impl, isolate).IsEmpty()); |
74 if (ScriptWrappable::wrapperCanBeStoredInObject(impl)) { | 83 if (ScriptWrappable::wrapperCanBeStoredInObject(impl)) { |
75 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl); | 84 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl); |
76 // Might be a XXXConstructor::info instead of an XXX::info. These will b
oth have | 85 // Might be a XXXConstructor::info instead of an XXX::info. These will b
oth have |
77 // the same object de-ref functions, though, so use that as the basis of
the check. | 86 // the same object de-ref functions, though, so use that as the basis of
the check. |
78 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== V8TestInterface::info.derefObjectFunction); | 87 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== V8TestInterface::info.derefObjectFunction); |
79 } | 88 } |
80 return V8TestInterface::createWrapper(impl, creationContext, isolate); | 89 return V8TestInterface::createWrapper(impl, creationContext, isolate); |
81 } | 90 } |
82 | 91 |
83 inline v8::Handle<v8::Value> toV8(TestInterface* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) | 92 inline v8::Handle<v8::Value> toV8(TestInterface* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) |
84 { | 93 { |
85 if (UNLIKELY(!impl)) | 94 if (UNLIKELY(!impl)) |
86 return v8NullWithCheck(isolate); | 95 return v8NullWithCheck(isolate); |
87 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate); | 96 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterface>(im
pl, isolate); |
88 if (!wrapper.IsEmpty()) | 97 if (!wrapper.IsEmpty()) |
89 return wrapper; | 98 return wrapper; |
90 return wrap(impl, creationContext, isolate); | 99 return wrap(impl, creationContext, isolate); |
91 } | 100 } |
92 | 101 |
93 inline v8::Handle<v8::Value> toV8ForMainWorld(TestInterface* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) | 102 inline v8::Handle<v8::Value> toV8ForMainWorld(TestInterface* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) |
94 { | 103 { |
95 ASSERT(worldType(isolate) == MainWorld); | 104 ASSERT(worldType(isolate) == MainWorld); |
96 if (UNLIKELY(!impl)) | 105 if (UNLIKELY(!impl)) |
97 return v8NullWithCheck(isolate); | 106 return v8NullWithCheck(isolate); |
98 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld(impl); | 107 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld<V8TestI
nterface>(impl); |
99 if (!wrapper.IsEmpty()) | 108 if (!wrapper.IsEmpty()) |
100 return wrapper; | 109 return wrapper; |
101 return wrap(impl, creationContext, isolate); | 110 return wrap(impl, creationContext, isolate); |
102 } | 111 } |
103 | 112 |
104 template<class HolderContainer, class Wrappable> | 113 template<class HolderContainer, class Wrappable> |
105 inline v8::Handle<v8::Value> toV8Fast(TestInterface* impl, const HolderContainer
& container, Wrappable* wrappable) | 114 inline v8::Handle<v8::Value> toV8Fast(TestInterface* impl, const HolderContainer
& container, Wrappable* wrappable) |
106 { | 115 { |
107 if (UNLIKELY(!impl)) | 116 if (UNLIKELY(!impl)) |
108 return v8::Null(container.GetIsolate()); | 117 return v8::Null(container.GetIsolate()); |
109 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast(impl, containe
r, wrappable); | 118 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast<V8TestInterfac
e>(impl, container, wrappable); |
110 if (!wrapper.IsEmpty()) | 119 if (!wrapper.IsEmpty()) |
111 return wrapper; | 120 return wrapper; |
112 return wrap(impl, container.Holder(), container.GetIsolate()); | 121 return wrap(impl, container.Holder(), container.GetIsolate()); |
113 } | 122 } |
114 | 123 |
115 template<class HolderContainer, class Wrappable> | 124 template<class HolderContainer, class Wrappable> |
116 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestInterface* impl, const Hol
derContainer& container, Wrappable* wrappable) | 125 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestInterface* impl, const Hol
derContainer& container, Wrappable* wrappable) |
117 { | 126 { |
118 ASSERT(worldType(container.GetIsolate()) == MainWorld); | 127 ASSERT(worldType(container.GetIsolate()) == MainWorld); |
119 if (UNLIKELY(!impl)) | 128 if (UNLIKELY(!impl)) |
120 return v8::Null(container.GetIsolate()); | 129 return v8::Null(container.GetIsolate()); |
121 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld(impl); | 130 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld<V8Test
Interface>(impl); |
122 if (!wrapper.IsEmpty()) | 131 if (!wrapper.IsEmpty()) |
123 return wrapper; | 132 return wrapper; |
124 return wrap(impl, container.Holder(), container.GetIsolate()); | 133 return wrap(impl, container.Holder(), container.GetIsolate()); |
125 } | 134 } |
126 | 135 |
127 template<class HolderContainer, class Wrappable> | 136 template<class HolderContainer, class Wrappable> |
128 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< TestInterface > im
pl, const HolderContainer& container, Wrappable* wrappable) | 137 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< TestInterface > im
pl, const HolderContainer& container, Wrappable* wrappable) |
129 { | 138 { |
130 return toV8FastForMainWorld(impl.get(), container, wrappable); | 139 return toV8FastForMainWorld(impl.get(), container, wrappable); |
131 } | 140 } |
132 | 141 |
133 | 142 |
134 template<class HolderContainer, class Wrappable> | 143 template<class HolderContainer, class Wrappable> |
135 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestInterface > impl, const Ho
lderContainer& container, Wrappable* wrappable) | 144 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestInterface > impl, const Ho
lderContainer& container, Wrappable* wrappable) |
136 { | 145 { |
137 return toV8Fast(impl.get(), container, wrappable); | 146 return toV8Fast(impl.get(), container, wrappable); |
138 } | 147 } |
139 | 148 |
140 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestInterface > impl, v8::Handle<v
8::Object> creationContext, v8::Isolate* isolate) | 149 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestInterface > impl, v8::Handle<v
8::Object> creationContext, v8::Isolate* isolate) |
141 { | 150 { |
142 return toV8(impl.get(), creationContext, isolate); | 151 return toV8(impl.get(), creationContext, isolate); |
143 } | 152 } |
144 | 153 |
145 } | 154 } |
146 | 155 |
147 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 156 #endif // ENABLE(Condition1) || ENABLE(Condition2) |
148 | 157 |
149 #endif // V8TestInterface_h | 158 #endif // V8TestInterface_h |
OLD | NEW |