| 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 V8TestCustomAccessors { | 31 class V8TestCustomAccessors { |
| 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 TestCustomAccessors* toNative(v8::Handle<v8::Object> object) | 36 static TestCustomAccessors* toNative(v8::Handle<v8::Object> object) |
| 37 { | 37 { |
| 38 return reinterpret_cast<TestCustomAccessors*>(object->GetAlignedPointerF
romInternalField(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 indexedPropertyGetterCustom(uint32_t, const v8::PropertyCallback
Info<v8::Value>&); | 42 static void indexedPropertyGetterCustom(uint32_t, const v8::PropertyCallback
Info<v8::Value>&); |
| 43 static void indexedPropertySetterCustom(uint32_t, v8::Local<v8::Value>, cons
t v8::PropertyCallbackInfo<v8::Value>&); | 43 static void indexedPropertySetterCustom(uint32_t, v8::Local<v8::Value>, cons
t v8::PropertyCallbackInfo<v8::Value>&); |
| 44 static void indexedPropertyDeleterCustom(uint32_t, const v8::PropertyCallbac
kInfo<v8::Boolean>&); | 44 static void indexedPropertyDeleterCustom(uint32_t, const v8::PropertyCallbac
kInfo<v8::Boolean>&); |
| 45 static void namedPropertyGetterCustom(v8::Local<v8::String>, const v8::Prope
rtyCallbackInfo<v8::Value>&); | 45 static void namedPropertyGetterCustom(v8::Local<v8::String>, const v8::Prope
rtyCallbackInfo<v8::Value>&); |
| 46 static void namedPropertySetterCustom(v8::Local<v8::String>, v8::Local<v8::V
alue>, const v8::PropertyCallbackInfo<v8::Value>&); | 46 static void namedPropertySetterCustom(v8::Local<v8::String>, v8::Local<v8::V
alue>, const v8::PropertyCallbackInfo<v8::Value>&); |
| 47 static void namedPropertyDeleterCustom(v8::Local<v8::String>, const v8::Prop
ertyCallbackInfo<v8::Boolean>&); | 47 static void namedPropertyDeleterCustom(v8::Local<v8::String>, const v8::Prop
ertyCallbackInfo<v8::Boolean>&); |
| 48 static void namedPropertyEnumeratorCustom(const v8::PropertyCallbackInfo<v8:
:Array>&); | 48 static void namedPropertyEnumeratorCustom(const v8::PropertyCallbackInfo<v8:
:Array>&); |
| 49 static void namedPropertyQueryCustom(v8::Local<v8::String>, const v8::Proper
tyCallbackInfo<v8::Integer>&); | 49 static void namedPropertyQueryCustom(v8::Local<v8::String>, const v8::Proper
tyCallbackInfo<v8::Integer>&); |
| 50 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | 50 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; |
| 51 static inline void* toInternalPointer(TestCustomAccessors* impl) |
| 52 { |
| 53 return impl; |
| 54 } |
| 55 |
| 56 static inline TestCustomAccessors* fromInternalPointer(void* object) |
| 57 { |
| 58 return static_cast<TestCustomAccessors*>(object); |
| 59 } |
| 51 static void installPerContextProperties(v8::Handle<v8::Object>, TestCustomAc
cessors*, v8::Isolate*) { } | 60 static void installPerContextProperties(v8::Handle<v8::Object>, TestCustomAc
cessors*, v8::Isolate*) { } |
| 52 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8:
:Isolate*) { } | 61 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8:
:Isolate*) { } |
| 53 private: | 62 private: |
| 54 friend v8::Handle<v8::Object> wrap(TestCustomAccessors*, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate*); | 63 friend v8::Handle<v8::Object> wrap(TestCustomAccessors*, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate*); |
| 55 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestCustomAccessors>,
v8::Handle<v8::Object> creationContext, v8::Isolate*); | 64 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestCustomAccessors>,
v8::Handle<v8::Object> creationContext, v8::Isolate*); |
| 56 }; | 65 }; |
| 57 | 66 |
| 58 template<> | 67 template<> |
| 59 class WrapperTypeTraits<TestCustomAccessors > { | 68 class WrapperTypeTraits<TestCustomAccessors > { |
| 60 public: | 69 public: |
| 61 static WrapperTypeInfo* info() { return &V8TestCustomAccessors::info; } | 70 static WrapperTypeInfo* info() { return &V8TestCustomAccessors::info; } |
| 62 }; | 71 }; |
| 63 | 72 |
| 64 | 73 |
| 65 inline v8::Handle<v8::Object> wrap(TestCustomAccessors* impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) | 74 inline v8::Handle<v8::Object> wrap(TestCustomAccessors* impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) |
| 66 { | 75 { |
| 67 ASSERT(impl); | 76 ASSERT(impl); |
| 68 ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty()); | 77 ASSERT(DOMDataStore::getWrapper<V8TestCustomAccessors>(impl, isolate).IsEmpt
y()); |
| 69 if (ScriptWrappable::wrapperCanBeStoredInObject(impl)) { | 78 if (ScriptWrappable::wrapperCanBeStoredInObject(impl)) { |
| 70 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl); | 79 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl); |
| 71 // Might be a XXXConstructor::info instead of an XXX::info. These will b
oth have | 80 // Might be a XXXConstructor::info instead of an XXX::info. These will b
oth have |
| 72 // the same object de-ref functions, though, so use that as the basis of
the check. | 81 // the same object de-ref functions, though, so use that as the basis of
the check. |
| 73 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== V8TestCustomAccessors::info.derefObjectFunction); | 82 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== V8TestCustomAccessors::info.derefObjectFunction); |
| 74 } | 83 } |
| 75 return V8TestCustomAccessors::createWrapper(impl, creationContext, isolate); | 84 return V8TestCustomAccessors::createWrapper(impl, creationContext, isolate); |
| 76 } | 85 } |
| 77 | 86 |
| 78 inline v8::Handle<v8::Value> toV8(TestCustomAccessors* impl, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate* isolate) | 87 inline v8::Handle<v8::Value> toV8(TestCustomAccessors* impl, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate* isolate) |
| 79 { | 88 { |
| 80 if (UNLIKELY(!impl)) | 89 if (UNLIKELY(!impl)) |
| 81 return v8NullWithCheck(isolate); | 90 return v8NullWithCheck(isolate); |
| 82 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate); | 91 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestCustomAccesso
rs>(impl, isolate); |
| 83 if (!wrapper.IsEmpty()) | 92 if (!wrapper.IsEmpty()) |
| 84 return wrapper; | 93 return wrapper; |
| 85 return wrap(impl, creationContext, isolate); | 94 return wrap(impl, creationContext, isolate); |
| 86 } | 95 } |
| 87 | 96 |
| 88 inline v8::Handle<v8::Value> toV8ForMainWorld(TestCustomAccessors* impl, v8::Han
dle<v8::Object> creationContext, v8::Isolate* isolate) | 97 inline v8::Handle<v8::Value> toV8ForMainWorld(TestCustomAccessors* impl, v8::Han
dle<v8::Object> creationContext, v8::Isolate* isolate) |
| 89 { | 98 { |
| 90 ASSERT(worldType(isolate) == MainWorld); | 99 ASSERT(worldType(isolate) == MainWorld); |
| 91 if (UNLIKELY(!impl)) | 100 if (UNLIKELY(!impl)) |
| 92 return v8NullWithCheck(isolate); | 101 return v8NullWithCheck(isolate); |
| 93 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld(impl); | 102 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld<V8TestC
ustomAccessors>(impl); |
| 94 if (!wrapper.IsEmpty()) | 103 if (!wrapper.IsEmpty()) |
| 95 return wrapper; | 104 return wrapper; |
| 96 return wrap(impl, creationContext, isolate); | 105 return wrap(impl, creationContext, isolate); |
| 97 } | 106 } |
| 98 | 107 |
| 99 template<class HolderContainer, class Wrappable> | 108 template<class HolderContainer, class Wrappable> |
| 100 inline v8::Handle<v8::Value> toV8Fast(TestCustomAccessors* impl, const HolderCon
tainer& container, Wrappable* wrappable) | 109 inline v8::Handle<v8::Value> toV8Fast(TestCustomAccessors* impl, const HolderCon
tainer& container, Wrappable* wrappable) |
| 101 { | 110 { |
| 102 if (UNLIKELY(!impl)) | 111 if (UNLIKELY(!impl)) |
| 103 return v8::Null(container.GetIsolate()); | 112 return v8::Null(container.GetIsolate()); |
| 104 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast(impl, containe
r, wrappable); | 113 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast<V8TestCustomAc
cessors>(impl, container, wrappable); |
| 105 if (!wrapper.IsEmpty()) | 114 if (!wrapper.IsEmpty()) |
| 106 return wrapper; | 115 return wrapper; |
| 107 return wrap(impl, container.Holder(), container.GetIsolate()); | 116 return wrap(impl, container.Holder(), container.GetIsolate()); |
| 108 } | 117 } |
| 109 | 118 |
| 110 template<class HolderContainer, class Wrappable> | 119 template<class HolderContainer, class Wrappable> |
| 111 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestCustomAccessors* impl, con
st HolderContainer& container, Wrappable* wrappable) | 120 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestCustomAccessors* impl, con
st HolderContainer& container, Wrappable* wrappable) |
| 112 { | 121 { |
| 113 ASSERT(worldType(container.GetIsolate()) == MainWorld); | 122 ASSERT(worldType(container.GetIsolate()) == MainWorld); |
| 114 if (UNLIKELY(!impl)) | 123 if (UNLIKELY(!impl)) |
| 115 return v8::Null(container.GetIsolate()); | 124 return v8::Null(container.GetIsolate()); |
| 116 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld(impl); | 125 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld<V8Test
CustomAccessors>(impl); |
| 117 if (!wrapper.IsEmpty()) | 126 if (!wrapper.IsEmpty()) |
| 118 return wrapper; | 127 return wrapper; |
| 119 return wrap(impl, container.Holder(), container.GetIsolate()); | 128 return wrap(impl, container.Holder(), container.GetIsolate()); |
| 120 } | 129 } |
| 121 | 130 |
| 122 template<class HolderContainer, class Wrappable> | 131 template<class HolderContainer, class Wrappable> |
| 123 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< TestCustomAccessor
s > impl, const HolderContainer& container, Wrappable* wrappable) | 132 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< TestCustomAccessor
s > impl, const HolderContainer& container, Wrappable* wrappable) |
| 124 { | 133 { |
| 125 return toV8FastForMainWorld(impl.get(), container, wrappable); | 134 return toV8FastForMainWorld(impl.get(), container, wrappable); |
| 126 } | 135 } |
| 127 | 136 |
| 128 | 137 |
| 129 template<class HolderContainer, class Wrappable> | 138 template<class HolderContainer, class Wrappable> |
| 130 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestCustomAccessors > impl, co
nst HolderContainer& container, Wrappable* wrappable) | 139 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestCustomAccessors > impl, co
nst HolderContainer& container, Wrappable* wrappable) |
| 131 { | 140 { |
| 132 return toV8Fast(impl.get(), container, wrappable); | 141 return toV8Fast(impl.get(), container, wrappable); |
| 133 } | 142 } |
| 134 | 143 |
| 135 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestCustomAccessors > impl, v8::Ha
ndle<v8::Object> creationContext, v8::Isolate* isolate) | 144 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestCustomAccessors > impl, v8::Ha
ndle<v8::Object> creationContext, v8::Isolate* isolate) |
| 136 { | 145 { |
| 137 return toV8(impl.get(), creationContext, isolate); | 146 return toV8(impl.get(), creationContext, isolate); |
| 138 } | 147 } |
| 139 | 148 |
| 140 } | 149 } |
| 141 | 150 |
| 142 #endif // V8TestCustomAccessors_h | 151 #endif // V8TestCustomAccessors_h |
| OLD | NEW |