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

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

Issue 127903002: Empty reflected attributes and string literals in extended attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: docstring formatting Created 6 years, 11 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
« no previous file with comments | « Source/bindings/tests/results/V8TestObject.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 3195 matching lines...) Expand 10 before | Expand all | Expand 10 after
3206 imp->setUnforgeableLongAttribute(cppValue); 3206 imp->setUnforgeableLongAttribute(cppValue);
3207 } 3207 }
3208 3208
3209 static void unforgeableLongAttributeAttributeSetterCallback(v8::Local<v8::String >, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 3209 static void unforgeableLongAttributeAttributeSetterCallback(v8::Local<v8::String >, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
3210 { 3210 {
3211 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3211 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3212 TestObjectPythonV8Internal::unforgeableLongAttributeAttributeSetter(jsValue, info); 3212 TestObjectPythonV8Internal::unforgeableLongAttributeAttributeSetter(jsValue, info);
3213 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3213 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3214 } 3214 }
3215 3215
3216 static void anotherStringAttributeAttributeGetter(const v8::PropertyCallbackInfo <v8::Value>& info)
3217 {
3218 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
3219 v8SetReturnValueString(info, imp->fastGetAttribute(HTMLNames::ReflectUrlAttr ibuteAsAStringAttr), info.GetIsolate());
3220 }
3221
3222 static void anotherStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3223 {
3224 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
3225 TestObjectPythonV8Internal::anotherStringAttributeAttributeGetter(info);
3226 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3227 }
3228
3229 static void anotherStringAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
3230 {
3231 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
3232 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
3233 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
3234 imp->setAttribute(HTMLNames::ReflectUrlAttributeAsAStringAttr, cppValue);
3235 }
3236
3237 static void anotherStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
3238 {
3239 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3240 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
3241 TestObjectPythonV8Internal::anotherStringAttributeAttributeSetter(jsValue, i nfo);
3242 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3243 }
3244
3216 static void TestObjectPythonConstructorGetter(v8::Local<v8::String>, const v8::P ropertyCallbackInfo<v8::Value>& info) 3245 static void TestObjectPythonConstructorGetter(v8::Local<v8::String>, const v8::P ropertyCallbackInfo<v8::Value>& info)
3217 { 3246 {
3218 v8::Handle<v8::Value> data = info.Data(); 3247 v8::Handle<v8::Value> data = info.Data();
3219 ASSERT(data->IsExternal()); 3248 ASSERT(data->IsExternal());
3220 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre ationContext()); 3249 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre ationContext());
3221 if (!perContextData) 3250 if (!perContextData)
3222 return; 3251 return;
3223 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u nwrap(data))); 3252 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u nwrap(data)));
3224 } 3253 }
3225 3254
(...skipping 3138 matching lines...) Expand 10 before | Expand all | Expand 10 after
6364 {"setterCallWithActiveWindowAndFirstWindowStringAttribute", TestObjectPython V8Internal::setterCallWithActiveWindowAndFirstWindowStringAttributeAttributeGett erCallback, TestObjectPythonV8Internal::setterCallWithActiveWindowAndFirstWindow StringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>( v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */} , 6393 {"setterCallWithActiveWindowAndFirstWindowStringAttribute", TestObjectPython V8Internal::setterCallWithActiveWindowAndFirstWindowStringAttributeAttributeGett erCallback, TestObjectPythonV8Internal::setterCallWithActiveWindowAndFirstWindow StringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>( v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */} ,
6365 {"setterRaisesExceptionLongAttribute", TestObjectPythonV8Internal::setterRai sesExceptionLongAttributeAttributeGetterCallback, TestObjectPythonV8Internal::se tterRaisesExceptionLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8 ::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 / * on instance */}, 6394 {"setterRaisesExceptionLongAttribute", TestObjectPythonV8Internal::setterRai sesExceptionLongAttributeAttributeGetterCallback, TestObjectPythonV8Internal::se tterRaisesExceptionLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8 ::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 / * on instance */},
6366 {"strictTypeCheckingFloatAttribute", TestObjectPythonV8Internal::strictTypeC heckingFloatAttributeAttributeGetterCallback, TestObjectPythonV8Internal::strict TypeCheckingFloatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i nstance */}, 6395 {"strictTypeCheckingFloatAttribute", TestObjectPythonV8Internal::strictTypeC heckingFloatAttributeAttributeGetterCallback, TestObjectPythonV8Internal::strict TypeCheckingFloatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i nstance */},
6367 {"strictTypeCheckingTestInterfaceAttribute", TestObjectPythonV8Internal::str ictTypeCheckingTestInterfaceAttributeAttributeGetterCallback, TestObjectPythonV8 Internal::strictTypeCheckingTestInterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribu te>(v8::None), 0 /* on instance */}, 6396 {"strictTypeCheckingTestInterfaceAttribute", TestObjectPythonV8Internal::str ictTypeCheckingTestInterfaceAttributeAttributeGetterCallback, TestObjectPythonV8 Internal::strictTypeCheckingTestInterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribu te>(v8::None), 0 /* on instance */},
6368 {"treatNullAsNullStringStringAttribute", TestObjectPythonV8Internal::treatNu llAsNullStringStringAttributeAttributeGetterCallback, TestObjectPythonV8Internal ::treatNullAsNullStringStringAttributeAttributeSetterCallback, 0, 0, 0, static_c ast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None ), 0 /* on instance */}, 6397 {"treatNullAsNullStringStringAttribute", TestObjectPythonV8Internal::treatNu llAsNullStringStringAttributeAttributeGetterCallback, TestObjectPythonV8Internal ::treatNullAsNullStringStringAttributeAttributeSetterCallback, 0, 0, 0, static_c ast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None ), 0 /* on instance */},
6369 {"treatReturnedNullStringAsNullStringAttribute", TestObjectPythonV8Internal: :treatReturnedNullStringAsNullStringAttributeAttributeGetterCallback, TestObject PythonV8Internal::treatReturnedNullStringAsNullStringAttributeAttributeSetterCal lback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pro pertyAttribute>(v8::None), 0 /* on instance */}, 6398 {"treatReturnedNullStringAsNullStringAttribute", TestObjectPythonV8Internal: :treatReturnedNullStringAsNullStringAttributeAttributeGetterCallback, TestObject PythonV8Internal::treatReturnedNullStringAsNullStringAttributeAttributeSetterCal lback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pro pertyAttribute>(v8::None), 0 /* on instance */},
6370 {"treatReturnedNullStringAsUndefinedStringAttribute", TestObjectPythonV8Inte rnal::treatReturnedNullStringAsUndefinedStringAttributeAttributeGetterCallback, TestObjectPythonV8Internal::treatReturnedNullStringAsUndefinedStringAttributeAtt ributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stat ic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 6399 {"treatReturnedNullStringAsUndefinedStringAttribute", TestObjectPythonV8Inte rnal::treatReturnedNullStringAsUndefinedStringAttributeAttributeGetterCallback, TestObjectPythonV8Internal::treatReturnedNullStringAsUndefinedStringAttributeAtt ributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stat ic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
6371 {"urlStringAttribute", TestObjectPythonV8Internal::urlStringAttributeAttribu teGetterCallback, TestObjectPythonV8Internal::urlStringAttributeAttributeSetterC allback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::P ropertyAttribute>(v8::None), 0 /* on instance */}, 6400 {"urlStringAttribute", TestObjectPythonV8Internal::urlStringAttributeAttribu teGetterCallback, TestObjectPythonV8Internal::urlStringAttributeAttributeSetterC allback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::P ropertyAttribute>(v8::None), 0 /* on instance */},
6372 {"urlStringAttribute", TestObjectPythonV8Internal::urlStringAttributeAttribu teGetterCallback, TestObjectPythonV8Internal::urlStringAttributeAttributeSetterC allback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::P ropertyAttribute>(v8::None), 0 /* on instance */}, 6401 {"urlStringAttribute", TestObjectPythonV8Internal::urlStringAttributeAttribu teGetterCallback, TestObjectPythonV8Internal::urlStringAttributeAttributeSetterC allback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::P ropertyAttribute>(v8::None), 0 /* on instance */},
6373 {"unforgeableLongAttribute", TestObjectPythonV8Internal::unforgeableLongAttr ibuteAttributeGetterCallback, TestObjectPythonV8Internal::unforgeableLongAttribu teAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::PROHIBITS _OVERWRITING), static_cast<v8::PropertyAttribute>(v8::DontDelete), 0 /* on insta nce */}, 6402 {"unforgeableLongAttribute", TestObjectPythonV8Internal::unforgeableLongAttr ibuteAttributeGetterCallback, TestObjectPythonV8Internal::unforgeableLongAttribu teAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::PROHIBITS _OVERWRITING), static_cast<v8::PropertyAttribute>(v8::DontDelete), 0 /* on insta nce */},
6403 {"anotherStringAttribute", TestObjectPythonV8Internal::anotherStringAttribut eAttributeGetterCallback, TestObjectPythonV8Internal::anotherStringAttributeAttr ibuteSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stati c_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
6374 }; 6404 };
6375 6405
6376 static const V8DOMConfiguration::AccessorConfiguration V8TestObjectPythonAccesso rs[] = { 6406 static const V8DOMConfiguration::AccessorConfiguration V8TestObjectPythonAccesso rs[] = {
6377 {"exposeJSAccessorsLongAttribute", TestObjectPythonV8Internal::exposeJSAcces sorsLongAttributeAttributeGetterCallback, TestObjectPythonV8Internal::exposeJSAc cessorsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessCont rol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)}, 6407 {"exposeJSAccessorsLongAttribute", TestObjectPythonV8Internal::exposeJSAcces sorsLongAttributeAttributeGetterCallback, TestObjectPythonV8Internal::exposeJSAc cessorsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessCont rol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)},
6378 }; 6408 };
6379 6409
6380 static const V8DOMConfiguration::MethodConfiguration V8TestObjectPythonMethods[] = { 6410 static const V8DOMConfiguration::MethodConfiguration V8TestObjectPythonMethods[] = {
6381 {"voidMethod", TestObjectPythonV8Internal::voidMethodMethodCallback, 0, 0}, 6411 {"voidMethod", TestObjectPythonV8Internal::voidMethodMethodCallback, 0, 0},
6382 {"dateMethod", TestObjectPythonV8Internal::dateMethodMethodCallback, 0, 0}, 6412 {"dateMethod", TestObjectPythonV8Internal::dateMethodMethodCallback, 0, 0},
6383 {"stringMethod", TestObjectPythonV8Internal::stringMethodMethodCallback, 0, 0}, 6413 {"stringMethod", TestObjectPythonV8Internal::stringMethodMethodCallback, 0, 0},
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
6692 fromInternalPointer(object)->deref(); 6722 fromInternalPointer(object)->deref();
6693 } 6723 }
6694 6724
6695 template<> 6725 template<>
6696 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object > creationContext, v8::Isolate* isolate) 6726 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object > creationContext, v8::Isolate* isolate)
6697 { 6727 {
6698 return toV8(impl, creationContext, isolate); 6728 return toV8(impl, creationContext, isolate);
6699 } 6729 }
6700 6730
6701 } // namespace WebCore 6731 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698