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

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

Issue 186673002: Support deprecation + use counters for constructor attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Always generate constructor getter callbacks Created 6 years, 9 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
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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 static void TestTypedefsConstructorGetter(v8::Local<v8::String>, const v8::Prope rtyCallbackInfo<v8::Value>& info) 226 static void TestTypedefsConstructorGetter(v8::Local<v8::String>, const v8::Prope rtyCallbackInfo<v8::Value>& info)
227 { 227 {
228 v8::Handle<v8::Value> data = info.Data(); 228 v8::Handle<v8::Value> data = info.Data();
229 ASSERT(data->IsExternal()); 229 ASSERT(data->IsExternal());
230 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre ationContext()); 230 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre ationContext());
231 if (!perContextData) 231 if (!perContextData)
232 return; 232 return;
233 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u nwrap(data))); 233 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u nwrap(data)));
234 } 234 }
235 235
236 static void TestSubObjConstructorGetterCallback(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info)
237 {
238 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
239 TestTypedefsV8Internal::TestTypedefsConstructorGetter(property, info);
240 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
241 }
242
236 static void TestTypedefsReplaceableAttributeSetter(v8::Local<v8::String> name, v 8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 243 static void TestTypedefsReplaceableAttributeSetter(v8::Local<v8::String> name, v 8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
237 { 244 {
238 info.This()->ForceSet(name, jsValue); 245 info.This()->ForceSet(name, jsValue);
239 } 246 }
240 247
241 static void TestTypedefsReplaceableAttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 248 static void TestTypedefsReplaceableAttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
242 { 249 {
243 TestTypedefsV8Internal::TestTypedefsReplaceableAttributeSetter(name, jsValue , info); 250 TestTypedefsV8Internal::TestTypedefsReplaceableAttributeSetter(name, jsValue , info);
244 } 251 }
245 252
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 v8::Handle<v8::Object> wrapper = info.Holder(); 411 v8::Handle<v8::Object> wrapper = info.Holder();
405 412
406 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl.release(), &V8 TestTypedefs::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration: :Dependent); 413 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl.release(), &V8 TestTypedefs::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration: :Dependent);
407 v8SetReturnValue(info, wrapper); 414 v8SetReturnValue(info, wrapper);
408 } 415 }
409 416
410 } // namespace TestTypedefsV8Internal 417 } // namespace TestTypedefsV8Internal
411 418
412 static const V8DOMConfiguration::AttributeConfiguration V8TestTypedefsAttributes [] = { 419 static const V8DOMConfiguration::AttributeConfiguration V8TestTypedefsAttributes [] = {
413 {"unsignedLongLongAttr", TestTypedefsV8Internal::unsignedLongLongAttrAttribu teGetterCallback, TestTypedefsV8Internal::unsignedLongLongAttrAttributeSetterCal lback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pro pertyAttribute>(v8::None), 0 /* on instance */}, 420 {"unsignedLongLongAttr", TestTypedefsV8Internal::unsignedLongLongAttrAttribu teGetterCallback, TestTypedefsV8Internal::unsignedLongLongAttrAttributeSetterCal lback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pro pertyAttribute>(v8::None), 0 /* on instance */},
414 {"TestSubObj", TestTypedefsV8Internal::TestTypedefsConstructorGetter, TestTy pedefsV8Internal::TestTypedefsReplaceableAttributeSetterCallback, 0, 0, const_ca st<WrapperTypeInfo*>(&V8TestSubObj::wrapperTypeInfo), static_cast<v8::AccessCont rol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on ins tance */}, 421 {"TestSubObj", TestTypedefsV8Internal::TestSubObjConstructorGetterCallback, TestTypedefsV8Internal::TestTypedefsReplaceableAttributeSetterCallback, 0, 0, co nst_cast<WrapperTypeInfo*>(&V8TestSubObj::wrapperTypeInfo), static_cast<v8::Acce ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */},
415 {"attrWithGetterException", TestTypedefsV8Internal::attrWithGetterExceptionA ttributeGetterCallback, TestTypedefsV8Internal::attrWithGetterExceptionAttribute SetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas t<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 422 {"attrWithGetterException", TestTypedefsV8Internal::attrWithGetterExceptionA ttributeGetterCallback, TestTypedefsV8Internal::attrWithGetterExceptionAttribute SetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas t<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
416 {"attrWithSetterException", TestTypedefsV8Internal::attrWithSetterExceptionA ttributeGetterCallback, TestTypedefsV8Internal::attrWithSetterExceptionAttribute SetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas t<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 423 {"attrWithSetterException", TestTypedefsV8Internal::attrWithSetterExceptionA ttributeGetterCallback, TestTypedefsV8Internal::attrWithSetterExceptionAttribute SetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas t<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
417 {"stringAttrWithGetterException", TestTypedefsV8Internal::stringAttrWithGett erExceptionAttributeGetterCallback, TestTypedefsV8Internal::stringAttrWithGetter ExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DE FAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 424 {"stringAttrWithGetterException", TestTypedefsV8Internal::stringAttrWithGett erExceptionAttributeGetterCallback, TestTypedefsV8Internal::stringAttrWithGetter ExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DE FAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
418 {"stringAttrWithSetterException", TestTypedefsV8Internal::stringAttrWithSett erExceptionAttributeGetterCallback, TestTypedefsV8Internal::stringAttrWithSetter ExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DE FAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 425 {"stringAttrWithSetterException", TestTypedefsV8Internal::stringAttrWithSett erExceptionAttributeGetterCallback, TestTypedefsV8Internal::stringAttrWithSetter ExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DE FAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
419 }; 426 };
420 427
421 static const V8DOMConfiguration::MethodConfiguration V8TestTypedefsMethods[] = { 428 static const V8DOMConfiguration::MethodConfiguration V8TestTypedefsMethods[] = {
422 {"func", TestTypedefsV8Internal::funcMethodCallback, 0, 0}, 429 {"func", TestTypedefsV8Internal::funcMethodCallback, 0, 0},
423 {"setShadow", TestTypedefsV8Internal::setShadowMethodCallback, 0, 3}, 430 {"setShadow", TestTypedefsV8Internal::setShadowMethodCallback, 0, 3},
424 {"voidMethodTestCallbackInterfaceArgument", TestTypedefsV8Internal::voidMeth odTestCallbackInterfaceArgumentMethodCallback, 0, 1}, 431 {"voidMethodTestCallbackInterfaceArgument", TestTypedefsV8Internal::voidMeth odTestCallbackInterfaceArgumentMethodCallback, 0, 1},
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 fromInternalPointer(object)->deref(); 524 fromInternalPointer(object)->deref();
518 } 525 }
519 526
520 template<> 527 template<>
521 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate) 528 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate)
522 { 529 {
523 return toV8(impl, creationContext, isolate); 530 return toV8(impl, creationContext, isolate);
524 } 531 }
525 532
526 } // namespace WebCore 533 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698