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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 #include "platform/TraceEvent.h" | 61 #include "platform/TraceEvent.h" |
62 #include "wtf/GetPtr.h" | 62 #include "wtf/GetPtr.h" |
63 #include "wtf/RefPtr.h" | 63 #include "wtf/RefPtr.h" |
64 #include "wtf/UnusedParam.h" | 64 #include "wtf/UnusedParam.h" |
65 | 65 |
66 namespace WebCore { | 66 namespace WebCore { |
67 | 67 |
68 static void initializeScriptWrappableForInterface(TestObjectPython* object) | 68 static void initializeScriptWrappableForInterface(TestObjectPython* object) |
69 { | 69 { |
70 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 70 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
71 ScriptWrappable::setTypeInfoInObject(object, &V8TestObjectPython::info); | 71 ScriptWrappable::setTypeInfoInObject(object, &V8TestObjectPython::wrappe
rTypeInfo); |
72 else | 72 else |
73 ASSERT_NOT_REACHED(); | 73 ASSERT_NOT_REACHED(); |
74 } | 74 } |
75 | 75 |
76 } // namespace WebCore | 76 } // namespace WebCore |
77 | 77 |
78 // In ScriptWrappable::init, the use of a local function declaration has an issu
e on Windows: | 78 // In ScriptWrappable::init, the use of a local function declaration has an issu
e on Windows: |
79 // the local declaration does not pick up the surrounding namespace. Therefore,
we provide this function | 79 // the local declaration does not pick up the surrounding namespace. Therefore,
we provide this function |
80 // in the global namespace. | 80 // in the global namespace. |
81 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe
edback/details/664619/the-namespace-of-local-function-declarations-in-c) | 81 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe
edback/details/664619/the-namespace-of-local-function-declarations-in-c) |
82 void webCoreInitializeScriptWrappableForInterface(WebCore::TestObjectPython* obj
ect) | 82 void webCoreInitializeScriptWrappableForInterface(WebCore::TestObjectPython* obj
ect) |
83 { | 83 { |
84 WebCore::initializeScriptWrappableForInterface(object); | 84 WebCore::initializeScriptWrappableForInterface(object); |
85 } | 85 } |
86 | 86 |
87 namespace WebCore { | 87 namespace WebCore { |
88 WrapperTypeInfo V8TestObjectPython::info = { V8TestObjectPython::GetTemplate, V8
TestObjectPython::derefObject, 0, 0, 0, V8TestObjectPython::installPerContextEna
bledPrototypeProperties, 0, WrapperTypeObjectPrototype }; | 88 WrapperTypeInfo V8TestObjectPython::wrapperTypeInfo = { V8TestObjectPython::GetT
emplate, V8TestObjectPython::derefObject, 0, 0, 0, V8TestObjectPython::installPe
rContextEnabledPrototypeProperties, 0, WrapperTypeObjectPrototype }; |
89 | 89 |
90 namespace TestObjectPythonV8Internal { | 90 namespace TestObjectPythonV8Internal { |
91 | 91 |
92 template <typename T> void V8_USE(T) { } | 92 template <typename T> void V8_USE(T) { } |
93 | 93 |
94 static void readonlyStringAttributeAttributeGetter(v8::Local<v8::String> name, c
onst v8::PropertyCallbackInfo<v8::Value>& info) | 94 static void readonlyStringAttributeAttributeGetter(v8::Local<v8::String> name, c
onst v8::PropertyCallbackInfo<v8::Value>& info) |
95 { | 95 { |
96 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); | 96 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); |
97 v8SetReturnValueString(info, imp->readonlyStringAttribute(), info.GetIsolate
()); | 97 v8SetReturnValueString(info, imp->readonlyStringAttribute(), info.GetIsolate
()); |
98 } | 98 } |
(...skipping 3307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3406 desc->SetNativeDataProperty(v8::String::NewSymbol("staticLongAttribute"), Te
stObjectPythonV8Internal::staticLongAttributeAttributeGetterCallback, TestObject
PythonV8Internal::staticLongAttributeAttributeSetterCallback, v8::External::New(
0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignatu
re>(), static_cast<v8::AccessControl>(v8::DEFAULT)); | 3406 desc->SetNativeDataProperty(v8::String::NewSymbol("staticLongAttribute"), Te
stObjectPythonV8Internal::staticLongAttributeAttributeGetterCallback, TestObject
PythonV8Internal::staticLongAttributeAttributeSetterCallback, v8::External::New(
0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignatu
re>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
3407 | 3407 |
3408 // Custom toString template | 3408 // Custom toString template |
3409 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); | 3409 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); |
3410 return desc; | 3410 return desc; |
3411 } | 3411 } |
3412 | 3412 |
3413 v8::Handle<v8::FunctionTemplate> V8TestObjectPython::GetTemplate(v8::Isolate* is
olate, WrapperWorldType currentWorldType) | 3413 v8::Handle<v8::FunctionTemplate> V8TestObjectPython::GetTemplate(v8::Isolate* is
olate, WrapperWorldType currentWorldType) |
3414 { | 3414 { |
3415 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 3415 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
3416 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&info); | 3416 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
3417 if (result != data->templateMap(currentWorldType).end()) | 3417 if (result != data->templateMap(currentWorldType).end()) |
3418 return result->value.newLocal(isolate); | 3418 return result->value.newLocal(isolate); |
3419 | 3419 |
3420 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 3420 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
3421 v8::HandleScope handleScope(isolate); | 3421 v8::HandleScope handleScope(isolate); |
3422 v8::Handle<v8::FunctionTemplate> templ = | 3422 v8::Handle<v8::FunctionTemplate> templ = |
3423 ConfigureV8TestObjectPythonTemplate(data->rawTemplate(&info, currentWorl
dType), isolate, currentWorldType); | 3423 ConfigureV8TestObjectPythonTemplate(data->rawTemplate(&wrapperTypeInfo,
currentWorldType), isolate, currentWorldType); |
3424 data->templateMap(currentWorldType).add(&info, UnsafePersistent<v8::Function
Template>(isolate, templ)); | 3424 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
3425 return handleScope.Close(templ); | 3425 return handleScope.Close(templ); |
3426 } | 3426 } |
3427 | 3427 |
3428 bool V8TestObjectPython::HasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate*
isolate, WrapperWorldType currentWorldType) | 3428 bool V8TestObjectPython::HasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate*
isolate, WrapperWorldType currentWorldType) |
3429 { | 3429 { |
3430 return V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, currentW
orldType); | 3430 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); |
3431 } | 3431 } |
3432 | 3432 |
3433 bool V8TestObjectPython::HasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8
::Isolate* isolate) | 3433 bool V8TestObjectPython::HasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8
::Isolate* isolate) |
3434 { | 3434 { |
3435 return V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, MainWorl
d) | 3435 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, MainWorld) |
3436 || V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, Isolated
World) | 3436 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, IsolatedWorld) |
3437 || V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, WorkerWo
rld); | 3437 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, WorkerWorld); |
3438 } | 3438 } |
3439 | 3439 |
3440 void V8TestObjectPython::installPerContextEnabledProperties(v8::Handle<v8::Objec
t> instance, TestObjectPython* impl, v8::Isolate* isolate) | 3440 void V8TestObjectPython::installPerContextEnabledProperties(v8::Handle<v8::Objec
t> instance, TestObjectPython* impl, v8::Isolate* isolate) |
3441 { | 3441 { |
3442 v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetProto
type()); | 3442 v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetProto
type()); |
3443 if (ContextFeatures::featureNameEnabled(impl->document())) { | 3443 if (ContextFeatures::featureNameEnabled(impl->document())) { |
3444 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 3444 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
3445 {"perContextEnabledLongAttribute", TestObjectPythonV8Internal::perContex
tEnabledLongAttributeAttributeGetterCallback, TestObjectPythonV8Internal::perCon
textEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::Access
Control>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on ins
tance */}; | 3445 {"perContextEnabledLongAttribute", TestObjectPythonV8Internal::perContex
tEnabledLongAttributeAttributeGetterCallback, TestObjectPythonV8Internal::perCon
textEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::Access
Control>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on ins
tance */}; |
3446 V8DOMConfiguration::installAttribute(instance, proto, attributeConfigura
tion, isolate); | 3446 V8DOMConfiguration::installAttribute(instance, proto, attributeConfigura
tion, isolate); |
3447 } | 3447 } |
3448 } | 3448 } |
3449 | 3449 |
3450 v8::Handle<v8::Object> V8TestObjectPython::createWrapper(PassRefPtr<TestObjectPy
thon> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 3450 v8::Handle<v8::Object> V8TestObjectPython::createWrapper(PassRefPtr<TestObjectPy
thon> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
3451 { | 3451 { |
3452 ASSERT(impl); | 3452 ASSERT(impl); |
3453 ASSERT(!DOMDataStore::containsWrapper<V8TestObjectPython>(impl.get(), isolat
e)); | 3453 ASSERT(!DOMDataStore::containsWrapper<V8TestObjectPython>(impl.get(), isolat
e)); |
3454 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 3454 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
3455 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); | 3455 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); |
3456 // Might be a XXXConstructor::info instead of an XXX::info. These will b
oth have | 3456 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have |
3457 // the same object de-ref functions, though, so use that as the basis of
the check. | 3457 // the same object de-ref functions, though, so use that as the basis of
the check. |
3458 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== info.derefObjectFunction); | 3458 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); |
3459 } | 3459 } |
3460 | 3460 |
3461 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &info, toInternalPointer(impl.get()), isolate); | 3461 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); |
3462 if (UNLIKELY(wrapper.IsEmpty())) | 3462 if (UNLIKELY(wrapper.IsEmpty())) |
3463 return wrapper; | 3463 return wrapper; |
3464 | 3464 |
3465 installPerContextEnabledProperties(wrapper, impl.get(), isolate); | 3465 installPerContextEnabledProperties(wrapper, impl.get(), isolate); |
3466 V8DOMWrapper::associateObjectWithWrapper<V8TestObjectPython>(impl, &info, wr
apper, isolate, WrapperConfiguration::Independent); | 3466 V8DOMWrapper::associateObjectWithWrapper<V8TestObjectPython>(impl, &wrapperT
ypeInfo, wrapper, isolate, WrapperConfiguration::Independent); |
3467 return wrapper; | 3467 return wrapper; |
3468 } | 3468 } |
3469 | 3469 |
3470 void V8TestObjectPython::derefObject(void* object) | 3470 void V8TestObjectPython::derefObject(void* object) |
3471 { | 3471 { |
3472 fromInternalPointer(object)->deref(); | 3472 fromInternalPointer(object)->deref(); |
3473 } | 3473 } |
3474 | 3474 |
3475 } // namespace WebCore | 3475 } // namespace WebCore |
OLD | NEW |