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 17 matching lines...) Expand all Loading... |
28 | 28 |
29 namespace WebCore { | 29 namespace WebCore { |
30 | 30 |
31 class V8TestObject { | 31 class V8TestObject { |
32 public: | 32 public: |
33 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
e); | 33 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
e); |
34 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); | 34 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); |
35 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor
ldType); | 35 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor
ldType); |
36 static TestObj* toNative(v8::Handle<v8::Object> object) | 36 static TestObj* toNative(v8::Handle<v8::Object> object) |
37 { | 37 { |
38 return reinterpret_cast<TestObj*>(object->GetAlignedPointerFromInternalF
ield(v8DOMWrapperObjectIndex)); | 38 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); |
39 } | 39 } |
40 static void derefObject(void*); | 40 static void derefObject(void*); |
41 static WrapperTypeInfo info; | 41 static WrapperTypeInfo info; |
42 static void customMethodMethodCustom(const v8::FunctionCallbackInfo<v8::Valu
e>&); | 42 static void customMethodMethodCustom(const v8::FunctionCallbackInfo<v8::Valu
e>&); |
43 static void customMethodWithArgsMethodCustom(const v8::FunctionCallbackInfo<
v8::Value>&); | 43 static void customMethodWithArgsMethodCustom(const v8::FunctionCallbackInfo<
v8::Value>&); |
44 static void classMethod2MethodCustom(const v8::FunctionCallbackInfo<v8::Valu
e>&); | 44 static void classMethod2MethodCustom(const v8::FunctionCallbackInfo<v8::Valu
e>&); |
45 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 45 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
46 static void customAttrAttrGetterCustom(v8::Local<v8::String> name, const v8:
:PropertyCallbackInfo<v8::Value>&); | 46 static void customAttrAttrGetterCustom(v8::Local<v8::String> name, const v8:
:PropertyCallbackInfo<v8::Value>&); |
47 static void customAttrAttrSetterCustom(v8::Local<v8::String> name, v8::Local
<v8::Value>, const v8::PropertyCallbackInfo<void>&); | 47 static void customAttrAttrSetterCustom(v8::Local<v8::String> name, v8::Local
<v8::Value>, const v8::PropertyCallbackInfo<void>&); |
48 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | 48 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; |
| 49 static inline void* toInternalPointer(TestObj* impl) |
| 50 { |
| 51 return impl; |
| 52 } |
| 53 |
| 54 static inline TestObj* fromInternalPointer(void* object) |
| 55 { |
| 56 return static_cast<TestObj*>(object); |
| 57 } |
49 static void installPerContextProperties(v8::Handle<v8::Object>, TestObj*, v8
::Isolate*); | 58 static void installPerContextProperties(v8::Handle<v8::Object>, TestObj*, v8
::Isolate*); |
50 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8:
:Isolate*); | 59 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8:
:Isolate*); |
51 private: | 60 private: |
52 friend v8::Handle<v8::Object> wrap(TestObj*, v8::Handle<v8::Object> creation
Context, v8::Isolate*); | 61 friend v8::Handle<v8::Object> wrap(TestObj*, v8::Handle<v8::Object> creation
Context, v8::Isolate*); |
53 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestObj>, v8::Handle<
v8::Object> creationContext, v8::Isolate*); | 62 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestObj>, v8::Handle<
v8::Object> creationContext, v8::Isolate*); |
54 }; | 63 }; |
55 | 64 |
56 template<> | 65 template<> |
57 class WrapperTypeTraits<TestObj > { | 66 class WrapperTypeTraits<TestObj > { |
58 public: | 67 public: |
59 static WrapperTypeInfo* info() { return &V8TestObject::info; } | 68 static WrapperTypeInfo* info() { return &V8TestObject::info; } |
60 }; | 69 }; |
61 | 70 |
62 | 71 |
63 inline v8::Handle<v8::Object> wrap(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) | 72 inline v8::Handle<v8::Object> wrap(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) |
64 { | 73 { |
65 ASSERT(impl); | 74 ASSERT(impl); |
66 ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty()); | 75 ASSERT(DOMDataStore::getWrapper<V8TestObject>(impl, isolate).IsEmpty()); |
67 if (ScriptWrappable::wrapperCanBeStoredInObject(impl)) { | 76 if (ScriptWrappable::wrapperCanBeStoredInObject(impl)) { |
68 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl); | 77 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl); |
69 // Might be a XXXConstructor::info instead of an XXX::info. These will b
oth have | 78 // Might be a XXXConstructor::info instead of an XXX::info. These will b
oth have |
70 // the same object de-ref functions, though, so use that as the basis of
the check. | 79 // the same object de-ref functions, though, so use that as the basis of
the check. |
71 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== V8TestObject::info.derefObjectFunction); | 80 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== V8TestObject::info.derefObjectFunction); |
72 } | 81 } |
73 return V8TestObject::createWrapper(impl, creationContext, isolate); | 82 return V8TestObject::createWrapper(impl, creationContext, isolate); |
74 } | 83 } |
75 | 84 |
76 inline v8::Handle<v8::Value> toV8(TestObj* impl, v8::Handle<v8::Object> creation
Context, v8::Isolate* isolate) | 85 inline v8::Handle<v8::Value> toV8(TestObj* impl, v8::Handle<v8::Object> creation
Context, v8::Isolate* isolate) |
77 { | 86 { |
78 if (UNLIKELY(!impl)) | 87 if (UNLIKELY(!impl)) |
79 return v8NullWithCheck(isolate); | 88 return v8NullWithCheck(isolate); |
80 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate); | 89 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestObject>(impl,
isolate); |
81 if (!wrapper.IsEmpty()) | 90 if (!wrapper.IsEmpty()) |
82 return wrapper; | 91 return wrapper; |
83 return wrap(impl, creationContext, isolate); | 92 return wrap(impl, creationContext, isolate); |
84 } | 93 } |
85 | 94 |
86 inline v8::Handle<v8::Value> toV8ForMainWorld(TestObj* impl, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate* isolate) | 95 inline v8::Handle<v8::Value> toV8ForMainWorld(TestObj* impl, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate* isolate) |
87 { | 96 { |
88 ASSERT(worldType(isolate) == MainWorld); | 97 ASSERT(worldType(isolate) == MainWorld); |
89 if (UNLIKELY(!impl)) | 98 if (UNLIKELY(!impl)) |
90 return v8NullWithCheck(isolate); | 99 return v8NullWithCheck(isolate); |
91 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld(impl); | 100 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld<V8TestO
bject>(impl); |
92 if (!wrapper.IsEmpty()) | 101 if (!wrapper.IsEmpty()) |
93 return wrapper; | 102 return wrapper; |
94 return wrap(impl, creationContext, isolate); | 103 return wrap(impl, creationContext, isolate); |
95 } | 104 } |
96 | 105 |
97 template<class HolderContainer, class Wrappable> | 106 template<class HolderContainer, class Wrappable> |
98 inline v8::Handle<v8::Value> toV8Fast(TestObj* impl, const HolderContainer& cont
ainer, Wrappable* wrappable) | 107 inline v8::Handle<v8::Value> toV8Fast(TestObj* impl, const HolderContainer& cont
ainer, Wrappable* wrappable) |
99 { | 108 { |
100 if (UNLIKELY(!impl)) | 109 if (UNLIKELY(!impl)) |
101 return v8::Null(container.GetIsolate()); | 110 return v8::Null(container.GetIsolate()); |
102 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast(impl, containe
r, wrappable); | 111 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast<V8TestObject>(
impl, container, wrappable); |
103 if (!wrapper.IsEmpty()) | 112 if (!wrapper.IsEmpty()) |
104 return wrapper; | 113 return wrapper; |
105 return wrap(impl, container.Holder(), container.GetIsolate()); | 114 return wrap(impl, container.Holder(), container.GetIsolate()); |
106 } | 115 } |
107 | 116 |
108 template<class HolderContainer, class Wrappable> | 117 template<class HolderContainer, class Wrappable> |
109 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestObj* impl, const HolderCon
tainer& container, Wrappable* wrappable) | 118 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestObj* impl, const HolderCon
tainer& container, Wrappable* wrappable) |
110 { | 119 { |
111 ASSERT(worldType(container.GetIsolate()) == MainWorld); | 120 ASSERT(worldType(container.GetIsolate()) == MainWorld); |
112 if (UNLIKELY(!impl)) | 121 if (UNLIKELY(!impl)) |
113 return v8::Null(container.GetIsolate()); | 122 return v8::Null(container.GetIsolate()); |
114 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld(impl); | 123 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld<V8Test
Object>(impl); |
115 if (!wrapper.IsEmpty()) | 124 if (!wrapper.IsEmpty()) |
116 return wrapper; | 125 return wrapper; |
117 return wrap(impl, container.Holder(), container.GetIsolate()); | 126 return wrap(impl, container.Holder(), container.GetIsolate()); |
118 } | 127 } |
119 | 128 |
120 template<class HolderContainer, class Wrappable> | 129 template<class HolderContainer, class Wrappable> |
121 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< TestObj > impl, co
nst HolderContainer& container, Wrappable* wrappable) | 130 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< TestObj > impl, co
nst HolderContainer& container, Wrappable* wrappable) |
122 { | 131 { |
123 return toV8FastForMainWorld(impl.get(), container, wrappable); | 132 return toV8FastForMainWorld(impl.get(), container, wrappable); |
124 } | 133 } |
125 | 134 |
126 | 135 |
127 template<class HolderContainer, class Wrappable> | 136 template<class HolderContainer, class Wrappable> |
128 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestObj > impl, const HolderCo
ntainer& container, Wrappable* wrappable) | 137 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestObj > impl, const HolderCo
ntainer& container, Wrappable* wrappable) |
129 { | 138 { |
130 return toV8Fast(impl.get(), container, wrappable); | 139 return toV8Fast(impl.get(), container, wrappable); |
131 } | 140 } |
132 | 141 |
133 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestObj > impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) | 142 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestObj > impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) |
134 { | 143 { |
135 return toV8(impl.get(), creationContext, isolate); | 144 return toV8(impl.get(), creationContext, isolate); |
136 } | 145 } |
137 | 146 |
138 } | 147 } |
139 | 148 |
140 #endif // V8TestObject_h | 149 #endif // V8TestObject_h |
OLD | NEW |