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 20 matching lines...) Expand all Loading... |
31 #include "core/dom/ContextFeatures.h" | 31 #include "core/dom/ContextFeatures.h" |
32 #include "core/dom/Document.h" | 32 #include "core/dom/Document.h" |
33 #include "platform/TraceEvent.h" | 33 #include "platform/TraceEvent.h" |
34 #include "wtf/UnusedParam.h" | 34 #include "wtf/UnusedParam.h" |
35 | 35 |
36 namespace WebCore { | 36 namespace WebCore { |
37 | 37 |
38 static void initializeScriptWrappableForInterface(TestCustomAccessors* object) | 38 static void initializeScriptWrappableForInterface(TestCustomAccessors* object) |
39 { | 39 { |
40 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 40 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
41 ScriptWrappable::setTypeInfoInObject(object, &V8TestCustomAccessors::inf
o); | 41 ScriptWrappable::setTypeInfoInObject(object, &V8TestCustomAccessors::wra
pperTypeInfo); |
42 else | 42 else |
43 ASSERT_NOT_REACHED(); | 43 ASSERT_NOT_REACHED(); |
44 } | 44 } |
45 | 45 |
46 } // namespace WebCore | 46 } // namespace WebCore |
47 | 47 |
48 // In ScriptWrappable::init, the use of a local function declaration has an issu
e on Windows: | 48 // In ScriptWrappable::init, the use of a local function declaration has an issu
e on Windows: |
49 // the local declaration does not pick up the surrounding namespace. Therefore,
we provide this function | 49 // the local declaration does not pick up the surrounding namespace. Therefore,
we provide this function |
50 // in the global namespace. | 50 // in the global namespace. |
51 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe
edback/details/664619/the-namespace-of-local-function-declarations-in-c) | 51 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe
edback/details/664619/the-namespace-of-local-function-declarations-in-c) |
52 void webCoreInitializeScriptWrappableForInterface(WebCore::TestCustomAccessors*
object) | 52 void webCoreInitializeScriptWrappableForInterface(WebCore::TestCustomAccessors*
object) |
53 { | 53 { |
54 WebCore::initializeScriptWrappableForInterface(object); | 54 WebCore::initializeScriptWrappableForInterface(object); |
55 } | 55 } |
56 | 56 |
57 namespace WebCore { | 57 namespace WebCore { |
58 WrapperTypeInfo V8TestCustomAccessors::info = { V8TestCustomAccessors::GetTempla
te, V8TestCustomAccessors::derefObject, 0, 0, 0, V8TestCustomAccessors::installP
erContextEnabledPrototypeProperties, 0, WrapperTypeObjectPrototype }; | 58 WrapperTypeInfo V8TestCustomAccessors::wrapperTypeInfo = { V8TestCustomAccessors
::GetTemplate, V8TestCustomAccessors::derefObject, 0, 0, 0, V8TestCustomAccessor
s::installPerContextEnabledPrototypeProperties, 0, WrapperTypeObjectPrototype }; |
59 | 59 |
60 namespace TestCustomAccessorsV8Internal { | 60 namespace TestCustomAccessorsV8Internal { |
61 | 61 |
62 template <typename T> void V8_USE(T) { } | 62 template <typename T> void V8_USE(T) { } |
63 | 63 |
64 static void anotherFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& arg
s) | 64 static void anotherFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& arg
s) |
65 { | 65 { |
66 if (UNLIKELY(args.Length() < 1)) { | 66 if (UNLIKELY(args.Length() < 1)) { |
67 throwTypeError(ExceptionMessages::failedToExecute("anotherFunction", "Te
stCustomAccessors", ExceptionMessages::notEnoughArguments(1, args.Length())), ar
gs.GetIsolate()); | 67 throwTypeError(ExceptionMessages::failedToExecute("anotherFunction", "Te
stCustomAccessors", ExceptionMessages::notEnoughArguments(1, args.Length())), ar
gs.GetIsolate()); |
68 return; | 68 return; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 desc->InstanceTemplate()->SetNamedPropertyHandler(TestCustomAccessorsV8Inter
nal::namedPropertyGetterCallback, TestCustomAccessorsV8Internal::namedPropertySe
tterCallback, TestCustomAccessorsV8Internal::namedPropertyQueryCallback, TestCus
tomAccessorsV8Internal::namedPropertyDeleterCallback, TestCustomAccessorsV8Inter
nal::namedPropertyEnumeratorCallback); | 160 desc->InstanceTemplate()->SetNamedPropertyHandler(TestCustomAccessorsV8Inter
nal::namedPropertyGetterCallback, TestCustomAccessorsV8Internal::namedPropertySe
tterCallback, TestCustomAccessorsV8Internal::namedPropertyQueryCallback, TestCus
tomAccessorsV8Internal::namedPropertyDeleterCallback, TestCustomAccessorsV8Inter
nal::namedPropertyEnumeratorCallback); |
161 | 161 |
162 // Custom toString template | 162 // Custom toString template |
163 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); | 163 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); |
164 return desc; | 164 return desc; |
165 } | 165 } |
166 | 166 |
167 v8::Handle<v8::FunctionTemplate> V8TestCustomAccessors::GetTemplate(v8::Isolate*
isolate, WrapperWorldType currentWorldType) | 167 v8::Handle<v8::FunctionTemplate> V8TestCustomAccessors::GetTemplate(v8::Isolate*
isolate, WrapperWorldType currentWorldType) |
168 { | 168 { |
169 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 169 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
170 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&info); | 170 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
171 if (result != data->templateMap(currentWorldType).end()) | 171 if (result != data->templateMap(currentWorldType).end()) |
172 return result->value.newLocal(isolate); | 172 return result->value.newLocal(isolate); |
173 | 173 |
174 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 174 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
175 v8::HandleScope handleScope(isolate); | 175 v8::HandleScope handleScope(isolate); |
176 v8::Handle<v8::FunctionTemplate> templ = | 176 v8::Handle<v8::FunctionTemplate> templ = |
177 ConfigureV8TestCustomAccessorsTemplate(data->rawTemplate(&info, currentW
orldType), isolate, currentWorldType); | 177 ConfigureV8TestCustomAccessorsTemplate(data->rawTemplate(&wrapperTypeInf
o, currentWorldType), isolate, currentWorldType); |
178 data->templateMap(currentWorldType).add(&info, UnsafePersistent<v8::Function
Template>(isolate, templ)); | 178 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
179 return handleScope.Close(templ); | 179 return handleScope.Close(templ); |
180 } | 180 } |
181 | 181 |
182 bool V8TestCustomAccessors::HasInstance(v8::Handle<v8::Value> jsValue, v8::Isola
te* isolate, WrapperWorldType currentWorldType) | 182 bool V8TestCustomAccessors::HasInstance(v8::Handle<v8::Value> jsValue, v8::Isola
te* isolate, WrapperWorldType currentWorldType) |
183 { | 183 { |
184 return V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, currentW
orldType); | 184 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); |
185 } | 185 } |
186 | 186 |
187 bool V8TestCustomAccessors::HasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue,
v8::Isolate* isolate) | 187 bool V8TestCustomAccessors::HasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue,
v8::Isolate* isolate) |
188 { | 188 { |
189 return V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, MainWorl
d) | 189 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, MainWorld) |
190 || V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, Isolated
World) | 190 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, IsolatedWorld) |
191 || V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, WorkerWo
rld); | 191 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, WorkerWorld); |
192 } | 192 } |
193 | 193 |
194 v8::Handle<v8::Object> V8TestCustomAccessors::createWrapper(PassRefPtr<TestCusto
mAccessors> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 194 v8::Handle<v8::Object> V8TestCustomAccessors::createWrapper(PassRefPtr<TestCusto
mAccessors> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
195 { | 195 { |
196 ASSERT(impl); | 196 ASSERT(impl); |
197 ASSERT(!DOMDataStore::containsWrapper<V8TestCustomAccessors>(impl.get(), iso
late)); | 197 ASSERT(!DOMDataStore::containsWrapper<V8TestCustomAccessors>(impl.get(), iso
late)); |
198 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 198 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
199 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); | 199 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); |
200 // Might be a XXXConstructor::info instead of an XXX::info. These will b
oth have | 200 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have |
201 // the same object de-ref functions, though, so use that as the basis of
the check. | 201 // the same object de-ref functions, though, so use that as the basis of
the check. |
202 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== info.derefObjectFunction); | 202 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); |
203 } | 203 } |
204 | 204 |
205 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &info, toInternalPointer(impl.get()), isolate); | 205 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); |
206 if (UNLIKELY(wrapper.IsEmpty())) | 206 if (UNLIKELY(wrapper.IsEmpty())) |
207 return wrapper; | 207 return wrapper; |
208 | 208 |
209 installPerContextEnabledProperties(wrapper, impl.get(), isolate); | 209 installPerContextEnabledProperties(wrapper, impl.get(), isolate); |
210 V8DOMWrapper::associateObjectWithWrapper<V8TestCustomAccessors>(impl, &info,
wrapper, isolate, WrapperConfiguration::Independent); | 210 V8DOMWrapper::associateObjectWithWrapper<V8TestCustomAccessors>(impl, &wrapp
erTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); |
211 return wrapper; | 211 return wrapper; |
212 } | 212 } |
213 | 213 |
214 void V8TestCustomAccessors::derefObject(void* object) | 214 void V8TestCustomAccessors::derefObject(void* object) |
215 { | 215 { |
216 fromInternalPointer(object)->deref(); | 216 fromInternalPointer(object)->deref(); |
217 } | 217 } |
218 | 218 |
219 } // namespace WebCore | 219 } // namespace WebCore |
OLD | NEW |