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

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: Fix caps 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 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 v8SetReturnValueInt(info, value); 1021 v8SetReturnValueInt(info, value);
1022 } 1022 }
1023 1023
1024 static void raisesExceptionReadonlyLongAttributeAttributeGetterCallback(v8::Loca l<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info) 1024 static void raisesExceptionReadonlyLongAttributeAttributeGetterCallback(v8::Loca l<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
1025 { 1025 {
1026 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1026 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1027 TestObjectPythonV8Internal::raisesExceptionReadonlyLongAttributeAttributeGet ter(name, info); 1027 TestObjectPythonV8Internal::raisesExceptionReadonlyLongAttributeAttributeGet ter(name, info);
1028 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1028 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1029 } 1029 }
1030 1030
1031 static void enabledAtRuntimeReadonlyLongAttributeAttributeGetter(v8::Local<v8::S tring> name, const v8::PropertyCallbackInfo<v8::Value>& info) 1031 static void runtimeEnabledReadonlyLongAttributeAttributeGetter(v8::Local<v8::Str ing> name, const v8::PropertyCallbackInfo<v8::Value>& info)
1032 { 1032 {
1033 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); 1033 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
1034 v8SetReturnValueInt(info, imp->enabledAtRuntimeReadonlyLongAttribute()); 1034 v8SetReturnValueInt(info, imp->runtimeEnabledReadonlyLongAttribute());
1035 } 1035 }
1036 1036
1037 static void enabledAtRuntimeReadonlyLongAttributeAttributeGetterCallback(v8::Loc al<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info) 1037 static void runtimeEnabledReadonlyLongAttributeAttributeGetterCallback(v8::Local <v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
1038 { 1038 {
1039 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1039 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1040 TestObjectPythonV8Internal::enabledAtRuntimeReadonlyLongAttributeAttributeGe tter(name, info); 1040 TestObjectPythonV8Internal::runtimeEnabledReadonlyLongAttributeAttributeGett er(name, info);
1041 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1041 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1042 } 1042 }
1043 1043
1044 #if ENABLE(Condition) 1044 #if ENABLE(Condition)
1045 static void conditionalEnabledAtRuntimeReadonlyLongAttributeAttributeGetter(v8:: Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info) 1045 static void conditionalEnabledAtRuntimeReadonlyLongAttributeAttributeGetter(v8:: Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
1046 { 1046 {
1047 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); 1047 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
1048 v8SetReturnValueInt(info, imp->conditionalEnabledAtRuntimeReadonlyLongAttrib ute()); 1048 v8SetReturnValueInt(info, imp->conditionalEnabledAtRuntimeReadonlyLongAttrib ute());
1049 } 1049 }
1050 #endif // ENABLE(Condition) 1050 #endif // ENABLE(Condition)
1051 1051
1052 #if ENABLE(Condition) 1052 #if ENABLE(Condition)
1053 static void conditionalEnabledAtRuntimeReadonlyLongAttributeAttributeGetterCallb ack(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info) 1053 static void conditionalEnabledAtRuntimeReadonlyLongAttributeAttributeGetterCallb ack(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
1054 { 1054 {
1055 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1055 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1056 TestObjectPythonV8Internal::conditionalEnabledAtRuntimeReadonlyLongAttribute AttributeGetter(name, info); 1056 TestObjectPythonV8Internal::conditionalEnabledAtRuntimeReadonlyLongAttribute AttributeGetter(name, info);
1057 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1057 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1058 } 1058 }
1059 #endif // ENABLE(Condition) 1059 #endif // ENABLE(Condition)
1060 1060
1061 static void perContextEnabledReadonlyLongAttributeAttributeGetter(v8::Local<v8:: String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
1062 {
1063 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
1064 v8SetReturnValueInt(info, imp->perContextEnabledReadonlyLongAttribute());
1065 }
1066
1067 static void perContextEnabledReadonlyLongAttributeAttributeGetterCallback(v8::Lo cal<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
1068 {
1069 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1070 TestObjectPythonV8Internal::perContextEnabledReadonlyLongAttributeAttributeG etter(name, info);
1071 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1072 }
1073
1061 } // namespace TestObjectPythonV8Internal 1074 } // namespace TestObjectPythonV8Internal
1062 1075
1063 static const V8DOMConfiguration::AttributeConfiguration V8TestObjectPythonAttrib utes[] = { 1076 static const V8DOMConfiguration::AttributeConfiguration V8TestObjectPythonAttrib utes[] = {
1064 {"readonlyDateAttribute", TestObjectPythonV8Internal::readonlyDateAttributeA ttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 1077 {"readonlyDateAttribute", TestObjectPythonV8Internal::readonlyDateAttributeA ttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1065 {"readonlyStringAttribute", TestObjectPythonV8Internal::readonlyStringAttrib uteAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAU LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 1078 {"readonlyStringAttribute", TestObjectPythonV8Internal::readonlyStringAttrib uteAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAU LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1066 {"readonlyDOMTimeStampAttribute", TestObjectPythonV8Internal::readonlyDOMTim eStampAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessContro l>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 1079 {"readonlyDOMTimeStampAttribute", TestObjectPythonV8Internal::readonlyDOMTim eStampAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessContro l>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1067 {"readonlyBooleanAttribute", TestObjectPythonV8Internal::readonlyBooleanAttr ibuteAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEF AULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 1080 {"readonlyBooleanAttribute", TestObjectPythonV8Internal::readonlyBooleanAttr ibuteAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEF AULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1068 {"readonlyByteAttribute", TestObjectPythonV8Internal::readonlyByteAttributeA ttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 1081 {"readonlyByteAttribute", TestObjectPythonV8Internal::readonlyByteAttributeA ttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1069 {"readonlyDoubleAttribute", TestObjectPythonV8Internal::readonlyDoubleAttrib uteAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAU LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 1082 {"readonlyDoubleAttribute", TestObjectPythonV8Internal::readonlyDoubleAttrib uteAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAU LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1070 {"readonlyFloatAttribute", TestObjectPythonV8Internal::readonlyFloatAttribut eAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT ), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 1083 {"readonlyFloatAttribute", TestObjectPythonV8Internal::readonlyFloatAttribut eAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT ), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(desc, "TestOb jectPython", v8::Local<v8::FunctionTemplate>(), V8TestObjectPython::internalFiel dCount, 1160 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(desc, "TestOb jectPython", v8::Local<v8::FunctionTemplate>(), V8TestObjectPython::internalFiel dCount,
1148 V8TestObjectPythonAttributes, WTF_ARRAY_LENGTH(V8TestObjectPythonAttribu tes), 1161 V8TestObjectPythonAttributes, WTF_ARRAY_LENGTH(V8TestObjectPythonAttribu tes),
1149 0, 0, isolate, currentWorldType); 1162 0, 0, isolate, currentWorldType);
1150 UNUSED_PARAM(defaultSignature); 1163 UNUSED_PARAM(defaultSignature);
1151 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); 1164 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
1152 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); 1165 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
1153 UNUSED_PARAM(instance); 1166 UNUSED_PARAM(instance);
1154 UNUSED_PARAM(proto); 1167 UNUSED_PARAM(proto);
1155 if (RuntimeEnabledFeatures::featureNameEnabled()) { 1168 if (RuntimeEnabledFeatures::featureNameEnabled()) {
1156 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\ 1169 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\
1157 {"enabledAtRuntimeReadonlyLongAttribute", TestObjectPythonV8Internal::en abledAtRuntimeReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_c ast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None ), 0 /* on instance */}; 1170 {"runtimeEnabledReadonlyLongAttribute", TestObjectPythonV8Internal::runt imeEnabledReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast< v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
1158 V8DOMConfiguration::installAttribute(instance, proto, attributeConfigura tion, isolate, currentWorldType); 1171 V8DOMConfiguration::installAttribute(instance, proto, attributeConfigura tion, isolate, currentWorldType);
1159 } 1172 }
1160 #if ENABLE(Condition) 1173 #if ENABLE(Condition)
1161 if (RuntimeEnabledFeatures::featureNameEnabled()) { 1174 if (RuntimeEnabledFeatures::featureNameEnabled()) {
1162 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\ 1175 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\
1163 {"conditionalEnabledAtRuntimeReadonlyLongAttribute", TestObjectPythonV8I nternal::conditionalEnabledAtRuntimeReadonlyLongAttributeAttributeGetterCallback , 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Prope rtyAttribute>(v8::None), 0 /* on instance */}; 1176 {"conditionalEnabledAtRuntimeReadonlyLongAttribute", TestObjectPythonV8I nternal::conditionalEnabledAtRuntimeReadonlyLongAttributeAttributeGetterCallback , 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Prope rtyAttribute>(v8::None), 0 /* on instance */};
1164 V8DOMConfiguration::installAttribute(instance, proto, attributeConfigura tion, isolate, currentWorldType); 1177 V8DOMConfiguration::installAttribute(instance, proto, attributeConfigura tion, isolate, currentWorldType);
1165 } 1178 }
1166 #endif // ENABLE(Condition) 1179 #endif // ENABLE(Condition)
1167 desc->SetNativeDataProperty(v8::String::NewSymbol("staticReadonlyStringAttri bute"), TestObjectPythonV8Internal::staticReadonlyStringAttributeAttributeGetter Callback, 0, v8::External::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT )); 1180 desc->SetNativeDataProperty(v8::String::NewSymbol("staticReadonlyStringAttri bute"), TestObjectPythonV8Internal::staticReadonlyStringAttributeAttributeGetter Callback, 0, v8::External::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT ));
(...skipping 24 matching lines...) Expand all
1192 return V8PerIsolateData::from(isolate)->hasInstance(&info, value, currentWor ldType); 1205 return V8PerIsolateData::from(isolate)->hasInstance(&info, value, currentWor ldType);
1193 } 1206 }
1194 1207
1195 bool V8TestObjectPython::HasInstanceInAnyWorld(v8::Handle<v8::Value> value, v8:: Isolate* isolate) 1208 bool V8TestObjectPython::HasInstanceInAnyWorld(v8::Handle<v8::Value> value, v8:: Isolate* isolate)
1196 { 1209 {
1197 return V8PerIsolateData::from(isolate)->hasInstance(&info, value, MainWorld) 1210 return V8PerIsolateData::from(isolate)->hasInstance(&info, value, MainWorld)
1198 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, IsolatedWo rld) 1211 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, IsolatedWo rld)
1199 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, WorkerWorl d); 1212 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, WorkerWorl d);
1200 } 1213 }
1201 1214
1215 void V8TestObjectPython::installPerContextProperties(v8::Handle<v8::Object> inst ance, TestObjectPython* impl, v8::Isolate* isolate)
1216 {
1217 v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetProto type());
1218 if (ContextFeatures::featureNameEnabled(impl->document())) {
1219 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\
1220 {"perContextEnabledReadonlyLongAttribute", TestObjectPythonV8Internal::p erContextEnabledReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static _cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No ne), 0 /* on instance */};
1221 V8DOMConfiguration::installAttribute(instance, proto, attributeConfigura tion, isolate);
1222 }
1223 }
1224
1202 v8::Handle<v8::Object> V8TestObjectPython::createWrapper(PassRefPtr<TestObjectPy thon> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 1225 v8::Handle<v8::Object> V8TestObjectPython::createWrapper(PassRefPtr<TestObjectPy thon> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
1203 { 1226 {
1204 ASSERT(impl); 1227 ASSERT(impl);
1205 ASSERT(!DOMDataStore::containsWrapper<V8TestObjectPython>(impl.get(), isolat e)); 1228 ASSERT(!DOMDataStore::containsWrapper<V8TestObjectPython>(impl.get(), isolat e));
1206 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { 1229 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
1207 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje ct(impl.get()); 1230 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje ct(impl.get());
1208 // Might be a XXXConstructor::info instead of an XXX::info. These will b oth have 1231 // Might be a XXXConstructor::info instead of an XXX::info. These will b oth have
1209 // the same object de-ref functions, though, so use that as the basis of the check. 1232 // the same object de-ref functions, though, so use that as the basis of the check.
1210 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == info.derefObjectFunction); 1233 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == info.derefObjectFunction);
1211 } 1234 }
1212 1235
1213 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &info, toInternalPointer(impl.get()), isolate); 1236 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &info, toInternalPointer(impl.get()), isolate);
1214 if (UNLIKELY(wrapper.IsEmpty())) 1237 if (UNLIKELY(wrapper.IsEmpty()))
1215 return wrapper; 1238 return wrapper;
1216 1239
1217 installPerContextProperties(wrapper, impl.get(), isolate); 1240 installPerContextProperties(wrapper, impl.get(), isolate);
1218 V8DOMWrapper::associateObjectWithWrapper<V8TestObjectPython>(impl, &info, wr apper, isolate, WrapperConfiguration::Independent); 1241 V8DOMWrapper::associateObjectWithWrapper<V8TestObjectPython>(impl, &info, wr apper, isolate, WrapperConfiguration::Independent);
1219 return wrapper; 1242 return wrapper;
1220 } 1243 }
1221 1244
1222 void V8TestObjectPython::derefObject(void* object) 1245 void V8TestObjectPython::derefObject(void* object)
1223 { 1246 {
1224 fromInternalPointer(object)->deref(); 1247 fromInternalPointer(object)->deref();
1225 } 1248 }
1226 1249
1227 } // namespace WebCore 1250 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698