Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: Source/bindings/tests/results/V8TestObjectPython.cpp

Issue 26547005: IDL compiler: [PerContextEnabled] for getters (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reupload Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // In ScriptWrappable::init, the use of a local function declaration has an issu e on Windows: 74 // In ScriptWrappable::init, the use of a local function declaration has an issu e on Windows:
75 // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function 75 // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
76 // in the global namespace. 76 // in the global namespace.
77 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe edback/details/664619/the-namespace-of-local-function-declarations-in-c) 77 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe edback/details/664619/the-namespace-of-local-function-declarations-in-c)
78 void webCoreInitializeScriptWrappableForInterface(WebCore::TestObjectPython* obj ect) 78 void webCoreInitializeScriptWrappableForInterface(WebCore::TestObjectPython* obj ect)
79 { 79 {
80 WebCore::initializeScriptWrappableForInterface(object); 80 WebCore::initializeScriptWrappableForInterface(object);
81 } 81 }
82 82
83 namespace WebCore { 83 namespace WebCore {
84 WrapperTypeInfo V8TestObjectPython::info = { V8TestObjectPython::GetTemplate, V8 TestObjectPython::derefObject, 0, 0, 0, V8TestObjectPython::installPerContextPro totypeProperties, 0, WrapperTypeObjectPrototype }; 84 WrapperTypeInfo V8TestObjectPython::info = { V8TestObjectPython::GetTemplate, V8 TestObjectPython::derefObject, 0, 0, 0, V8TestObjectPython::installPerContextEna bledPrototypeProperties, 0, WrapperTypeObjectPrototype };
85 85
86 namespace TestObjectPythonV8Internal { 86 namespace TestObjectPythonV8Internal {
87 87
88 template <typename T> void V8_USE(T) { } 88 template <typename T> void V8_USE(T) { }
89 89
90 static void readonlyDateAttributeAttributeGetter(v8::Local<v8::String> name, con st v8::PropertyCallbackInfo<v8::Value>& info) 90 static void readonlyDateAttributeAttributeGetter(v8::Local<v8::String> name, con st v8::PropertyCallbackInfo<v8::Value>& info)
91 { 91 {
92 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); 92 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
93 v8SetReturnValue(info, v8DateOrNull(imp->readonlyDateAttribute(), info.GetIs olate())); 93 v8SetReturnValue(info, v8DateOrNull(imp->readonlyDateAttribute(), info.GetIs olate()));
94 } 94 }
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 v8SetReturnValueInt(info, imp->notEnumerableReadonlyLongAttribute()); 1006 v8SetReturnValueInt(info, imp->notEnumerableReadonlyLongAttribute());
1007 } 1007 }
1008 1008
1009 static void notEnumerableReadonlyLongAttributeAttributeGetterCallback(v8::Local< v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info) 1009 static void notEnumerableReadonlyLongAttributeAttributeGetterCallback(v8::Local< v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
1010 { 1010 {
1011 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1011 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1012 TestObjectPythonV8Internal::notEnumerableReadonlyLongAttributeAttributeGette r(name, info); 1012 TestObjectPythonV8Internal::notEnumerableReadonlyLongAttributeAttributeGette r(name, info);
1013 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1013 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1014 } 1014 }
1015 1015
1016 static void perContextEnabledReadonlyLongAttributeAttributeGetter(v8::Local<v8:: String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
1017 {
1018 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
1019 v8SetReturnValueInt(info, imp->perContextEnabledReadonlyLongAttribute());
1020 }
1021
1022 static void perContextEnabledReadonlyLongAttributeAttributeGetterCallback(v8::Lo cal<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
1023 {
1024 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1025 TestObjectPythonV8Internal::perContextEnabledReadonlyLongAttributeAttributeG etter(name, info);
1026 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1027 }
1028
1016 static void raisesExceptionReadonlyLongAttributeAttributeGetter(v8::Local<v8::St ring> name, const v8::PropertyCallbackInfo<v8::Value>& info) 1029 static void raisesExceptionReadonlyLongAttributeAttributeGetter(v8::Local<v8::St ring> name, const v8::PropertyCallbackInfo<v8::Value>& info)
1017 { 1030 {
1018 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); 1031 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
1019 ExceptionState es(info.GetIsolate()); 1032 ExceptionState es(info.GetIsolate());
1020 int value = imp->raisesExceptionReadonlyLongAttribute(es); 1033 int value = imp->raisesExceptionReadonlyLongAttribute(es);
1021 if (UNLIKELY(es.throwIfNeeded())) 1034 if (UNLIKELY(es.throwIfNeeded()))
1022 return; 1035 return;
1023 v8SetReturnValueInt(info, value); 1036 v8SetReturnValueInt(info, value);
1024 } 1037 }
1025 1038
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1509 return V8PerIsolateData::from(isolate)->hasInstance(&info, value, currentWor ldType); 1522 return V8PerIsolateData::from(isolate)->hasInstance(&info, value, currentWor ldType);
1510 } 1523 }
1511 1524
1512 bool V8TestObjectPython::HasInstanceInAnyWorld(v8::Handle<v8::Value> value, v8:: Isolate* isolate) 1525 bool V8TestObjectPython::HasInstanceInAnyWorld(v8::Handle<v8::Value> value, v8:: Isolate* isolate)
1513 { 1526 {
1514 return V8PerIsolateData::from(isolate)->hasInstance(&info, value, MainWorld) 1527 return V8PerIsolateData::from(isolate)->hasInstance(&info, value, MainWorld)
1515 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, IsolatedWo rld) 1528 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, IsolatedWo rld)
1516 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, WorkerWorl d); 1529 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, WorkerWorl d);
1517 } 1530 }
1518 1531
1532 void V8TestObjectPython::installPerContextEnabledProperties(v8::Handle<v8::Objec t> instance, TestObjectPython* impl, v8::Isolate* isolate)
1533 {
1534 v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetProto type());
1535 if (ContextFeatures::featureNameEnabled(impl->document())) {
1536 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\
1537 {"perContextEnabledReadonlyLongAttribute", TestObjectPythonV8Internal::p erContextEnabledReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static _cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No ne), 0 /* on instance */};
1538 V8DOMConfiguration::installAttribute(instance, proto, attributeConfigura tion, isolate);
1539 }
1540 }
1541
1519 v8::Handle<v8::Object> V8TestObjectPython::createWrapper(PassRefPtr<TestObjectPy thon> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 1542 v8::Handle<v8::Object> V8TestObjectPython::createWrapper(PassRefPtr<TestObjectPy thon> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
1520 { 1543 {
1521 ASSERT(impl); 1544 ASSERT(impl);
1522 ASSERT(!DOMDataStore::containsWrapper<V8TestObjectPython>(impl.get(), isolat e)); 1545 ASSERT(!DOMDataStore::containsWrapper<V8TestObjectPython>(impl.get(), isolat e));
1523 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { 1546 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
1524 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje ct(impl.get()); 1547 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje ct(impl.get());
1525 // Might be a XXXConstructor::info instead of an XXX::info. These will b oth have 1548 // Might be a XXXConstructor::info instead of an XXX::info. These will b oth have
1526 // the same object de-ref functions, though, so use that as the basis of the check. 1549 // the same object de-ref functions, though, so use that as the basis of the check.
1527 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == info.derefObjectFunction); 1550 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == info.derefObjectFunction);
1528 } 1551 }
1529 1552
1530 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &info, toInternalPointer(impl.get()), isolate); 1553 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &info, toInternalPointer(impl.get()), isolate);
1531 if (UNLIKELY(wrapper.IsEmpty())) 1554 if (UNLIKELY(wrapper.IsEmpty()))
1532 return wrapper; 1555 return wrapper;
1533 1556
1534 installPerContextProperties(wrapper, impl.get(), isolate); 1557 installPerContextEnabledProperties(wrapper, impl.get(), isolate);
1535 V8DOMWrapper::associateObjectWithWrapper<V8TestObjectPython>(impl, &info, wr apper, isolate, WrapperConfiguration::Independent); 1558 V8DOMWrapper::associateObjectWithWrapper<V8TestObjectPython>(impl, &info, wr apper, isolate, WrapperConfiguration::Independent);
1536 return wrapper; 1559 return wrapper;
1537 } 1560 }
1538 1561
1539 void V8TestObjectPython::derefObject(void* object) 1562 void V8TestObjectPython::derefObject(void* object)
1540 { 1563 {
1541 fromInternalPointer(object)->deref(); 1564 fromInternalPointer(object)->deref();
1542 } 1565 }
1543 1566
1544 } // namespace WebCore 1567 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestObjectPython.h ('k') | Source/bindings/tests/results/V8TestOverloadedConstructors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698