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 V8TestSerializedScriptValueInterface { | 32 class V8TestSerializedScriptValueInterface { |
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 TestSerializedScriptValueInterface* toNative(v8::Handle<v8::Object> o
bject) | 37 static TestSerializedScriptValueInterface* toNative(v8::Handle<v8::Object> o
bject) |
38 { | 38 { |
39 return reinterpret_cast<TestSerializedScriptValueInterface*>(object->Get
AlignedPointerFromInternalField(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 const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | 43 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; |
| 44 static inline void* toInternalPointer(TestSerializedScriptValueInterface* im
pl) |
| 45 { |
| 46 return impl; |
| 47 } |
| 48 |
| 49 static inline TestSerializedScriptValueInterface* fromInternalPointer(void*
object) |
| 50 { |
| 51 return static_cast<TestSerializedScriptValueInterface*>(object); |
| 52 } |
44 static void installPerContextProperties(v8::Handle<v8::Object>, TestSerializ
edScriptValueInterface*, v8::Isolate*) { } | 53 static void installPerContextProperties(v8::Handle<v8::Object>, TestSerializ
edScriptValueInterface*, v8::Isolate*) { } |
45 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8:
:Isolate*) { } | 54 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8:
:Isolate*) { } |
46 private: | 55 private: |
47 friend v8::Handle<v8::Object> wrap(TestSerializedScriptValueInterface*, v8::
Handle<v8::Object> creationContext, v8::Isolate*); | 56 friend v8::Handle<v8::Object> wrap(TestSerializedScriptValueInterface*, v8::
Handle<v8::Object> creationContext, v8::Isolate*); |
48 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestSerializedScriptV
alueInterface>, v8::Handle<v8::Object> creationContext, v8::Isolate*); | 57 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestSerializedScriptV
alueInterface>, v8::Handle<v8::Object> creationContext, v8::Isolate*); |
49 }; | 58 }; |
50 | 59 |
51 template<> | 60 template<> |
52 class WrapperTypeTraits<TestSerializedScriptValueInterface > { | 61 class WrapperTypeTraits<TestSerializedScriptValueInterface > { |
53 public: | 62 public: |
54 static WrapperTypeInfo* info() { return &V8TestSerializedScriptValueInterfac
e::info; } | 63 static WrapperTypeInfo* info() { return &V8TestSerializedScriptValueInterfac
e::info; } |
55 }; | 64 }; |
56 | 65 |
57 | 66 |
58 inline v8::Handle<v8::Object> wrap(TestSerializedScriptValueInterface* impl, v8:
:Handle<v8::Object> creationContext, v8::Isolate* isolate) | 67 inline v8::Handle<v8::Object> wrap(TestSerializedScriptValueInterface* impl, v8:
:Handle<v8::Object> creationContext, v8::Isolate* isolate) |
59 { | 68 { |
60 ASSERT(impl); | 69 ASSERT(impl); |
61 ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty()); | 70 ASSERT(DOMDataStore::getWrapper<V8TestSerializedScriptValueInterface>(impl,
isolate).IsEmpty()); |
62 if (ScriptWrappable::wrapperCanBeStoredInObject(impl)) { | 71 if (ScriptWrappable::wrapperCanBeStoredInObject(impl)) { |
63 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl); | 72 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl); |
64 // Might be a XXXConstructor::info instead of an XXX::info. These will b
oth have | 73 // Might be a XXXConstructor::info instead of an XXX::info. These will b
oth have |
65 // the same object de-ref functions, though, so use that as the basis of
the check. | 74 // the same object de-ref functions, though, so use that as the basis of
the check. |
66 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== V8TestSerializedScriptValueInterface::info.derefObjectFunction); | 75 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== V8TestSerializedScriptValueInterface::info.derefObjectFunction); |
67 } | 76 } |
68 return V8TestSerializedScriptValueInterface::createWrapper(impl, creationCon
text, isolate); | 77 return V8TestSerializedScriptValueInterface::createWrapper(impl, creationCon
text, isolate); |
69 } | 78 } |
70 | 79 |
71 inline v8::Handle<v8::Value> toV8(TestSerializedScriptValueInterface* impl, v8::
Handle<v8::Object> creationContext, v8::Isolate* isolate) | 80 inline v8::Handle<v8::Value> toV8(TestSerializedScriptValueInterface* impl, v8::
Handle<v8::Object> creationContext, v8::Isolate* isolate) |
72 { | 81 { |
73 if (UNLIKELY(!impl)) | 82 if (UNLIKELY(!impl)) |
74 return v8NullWithCheck(isolate); | 83 return v8NullWithCheck(isolate); |
75 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate); | 84 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestSerializedScr
iptValueInterface>(impl, isolate); |
76 if (!wrapper.IsEmpty()) | 85 if (!wrapper.IsEmpty()) |
77 return wrapper; | 86 return wrapper; |
78 return wrap(impl, creationContext, isolate); | 87 return wrap(impl, creationContext, isolate); |
79 } | 88 } |
80 | 89 |
81 inline v8::Handle<v8::Value> toV8ForMainWorld(TestSerializedScriptValueInterface
* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 90 inline v8::Handle<v8::Value> toV8ForMainWorld(TestSerializedScriptValueInterface
* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
82 { | 91 { |
83 ASSERT(worldType(isolate) == MainWorld); | 92 ASSERT(worldType(isolate) == MainWorld); |
84 if (UNLIKELY(!impl)) | 93 if (UNLIKELY(!impl)) |
85 return v8NullWithCheck(isolate); | 94 return v8NullWithCheck(isolate); |
86 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld(impl); | 95 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld<V8TestS
erializedScriptValueInterface>(impl); |
87 if (!wrapper.IsEmpty()) | 96 if (!wrapper.IsEmpty()) |
88 return wrapper; | 97 return wrapper; |
89 return wrap(impl, creationContext, isolate); | 98 return wrap(impl, creationContext, isolate); |
90 } | 99 } |
91 | 100 |
92 template<class HolderContainer, class Wrappable> | 101 template<class HolderContainer, class Wrappable> |
93 inline v8::Handle<v8::Value> toV8Fast(TestSerializedScriptValueInterface* impl,
const HolderContainer& container, Wrappable* wrappable) | 102 inline v8::Handle<v8::Value> toV8Fast(TestSerializedScriptValueInterface* impl,
const HolderContainer& container, Wrappable* wrappable) |
94 { | 103 { |
95 if (UNLIKELY(!impl)) | 104 if (UNLIKELY(!impl)) |
96 return v8::Null(container.GetIsolate()); | 105 return v8::Null(container.GetIsolate()); |
97 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast(impl, containe
r, wrappable); | 106 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast<V8TestSerializ
edScriptValueInterface>(impl, container, wrappable); |
98 if (!wrapper.IsEmpty()) | 107 if (!wrapper.IsEmpty()) |
99 return wrapper; | 108 return wrapper; |
100 return wrap(impl, container.Holder(), container.GetIsolate()); | 109 return wrap(impl, container.Holder(), container.GetIsolate()); |
101 } | 110 } |
102 | 111 |
103 template<class HolderContainer, class Wrappable> | 112 template<class HolderContainer, class Wrappable> |
104 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestSerializedScriptValueInter
face* impl, const HolderContainer& container, Wrappable* wrappable) | 113 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestSerializedScriptValueInter
face* impl, const HolderContainer& container, Wrappable* wrappable) |
105 { | 114 { |
106 ASSERT(worldType(container.GetIsolate()) == MainWorld); | 115 ASSERT(worldType(container.GetIsolate()) == MainWorld); |
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::getWrapperForMainWorld(impl); | 118 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld<V8Test
SerializedScriptValueInterface>(impl); |
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(PassRefPtr< TestSerializedScri
ptValueInterface > impl, const HolderContainer& container, Wrappable* wrappable) | 125 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< TestSerializedScri
ptValueInterface > impl, const HolderContainer& container, Wrappable* wrappable) |
117 { | 126 { |
118 return toV8FastForMainWorld(impl.get(), container, wrappable); | 127 return toV8FastForMainWorld(impl.get(), container, wrappable); |
119 } | 128 } |
120 | 129 |
121 | 130 |
122 template<class HolderContainer, class Wrappable> | 131 template<class HolderContainer, class Wrappable> |
123 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestSerializedScriptValueInter
face > impl, const HolderContainer& container, Wrappable* wrappable) | 132 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestSerializedScriptValueInter
face > impl, const HolderContainer& container, Wrappable* wrappable) |
124 { | 133 { |
125 return toV8Fast(impl.get(), container, wrappable); | 134 return toV8Fast(impl.get(), container, wrappable); |
126 } | 135 } |
127 | 136 |
128 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestSerializedScriptValueInterface
> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 137 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestSerializedScriptValueInterface
> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
129 { | 138 { |
130 return toV8(impl.get(), creationContext, isolate); | 139 return toV8(impl.get(), creationContext, isolate); |
131 } | 140 } |
132 | 141 |
133 } | 142 } |
134 | 143 |
135 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 144 #endif // ENABLE(Condition1) || ENABLE(Condition2) |
136 | 145 |
137 #endif // V8TestSerializedScriptValueInterface_h | 146 #endif // V8TestSerializedScriptValueInterface_h |
OLD | NEW |