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

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

Issue 39393004: IDL compiler: rename WrapperTypeInfo info => wrapperTypeInfo (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 27 matching lines...) Expand all
38 #include "core/dom/Document.h" 38 #include "core/dom/Document.h"
39 #include "core/svg/properties/SVGPropertyTearOff.h" 39 #include "core/svg/properties/SVGPropertyTearOff.h"
40 #include "platform/TraceEvent.h" 40 #include "platform/TraceEvent.h"
41 #include "wtf/UnusedParam.h" 41 #include "wtf/UnusedParam.h"
42 42
43 namespace WebCore { 43 namespace WebCore {
44 44
45 static void initializeScriptWrappableForInterface(TestTypedefs* object) 45 static void initializeScriptWrappableForInterface(TestTypedefs* object)
46 { 46 {
47 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) 47 if (ScriptWrappable::wrapperCanBeStoredInObject(object))
48 ScriptWrappable::setTypeInfoInObject(object, &V8TestTypedefs::info); 48 ScriptWrappable::setTypeInfoInObject(object, &V8TestTypedefs::wrapperTyp eInfo);
49 else 49 else
50 ASSERT_NOT_REACHED(); 50 ASSERT_NOT_REACHED();
51 } 51 }
52 52
53 } // namespace WebCore 53 } // namespace WebCore
54 54
55 // In ScriptWrappable::init, the use of a local function declaration has an issu e on Windows: 55 // In ScriptWrappable::init, the use of a local function declaration has an issu e on Windows:
56 // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function 56 // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
57 // in the global namespace. 57 // in the global namespace.
58 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe edback/details/664619/the-namespace-of-local-function-declarations-in-c) 58 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe edback/details/664619/the-namespace-of-local-function-declarations-in-c)
59 void webCoreInitializeScriptWrappableForInterface(WebCore::TestTypedefs* object) 59 void webCoreInitializeScriptWrappableForInterface(WebCore::TestTypedefs* object)
60 { 60 {
61 WebCore::initializeScriptWrappableForInterface(object); 61 WebCore::initializeScriptWrappableForInterface(object);
62 } 62 }
63 63
64 namespace WebCore { 64 namespace WebCore {
65 WrapperTypeInfo V8TestTypedefs::info = { V8TestTypedefs::GetTemplate, V8TestType defs::derefObject, 0, 0, 0, V8TestTypedefs::installPerContextEnabledPrototypePro perties, 0, WrapperTypeObjectPrototype }; 65 WrapperTypeInfo V8TestTypedefs::wrapperTypeInfo = { V8TestTypedefs::GetTemplate, V8TestTypedefs::derefObject, 0, 0, 0, V8TestTypedefs::installPerContextEnabledP rototypeProperties, 0, WrapperTypeObjectPrototype };
66 66
67 namespace TestTypedefsV8Internal { 67 namespace TestTypedefsV8Internal {
68 68
69 template <typename T> void V8_USE(T) { } 69 template <typename T> void V8_USE(T) { }
70 70
71 static void unsignedLongLongAttrAttributeGetter(v8::Local<v8::String> name, cons t v8::PropertyCallbackInfo<v8::Value>& info) 71 static void unsignedLongLongAttrAttributeGetter(v8::Local<v8::String> name, cons t v8::PropertyCallbackInfo<v8::Value>& info)
72 { 72 {
73 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); 73 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
74 v8SetReturnValue(info, static_cast<double>(imp->unsignedLongLongAttr())); 74 v8SetReturnValue(info, static_cast<double>(imp->unsignedLongLongAttr()));
75 } 75 }
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, hello, args[0]); 475 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, hello, args[0]);
476 if (args.Length() <= 1 || !args[1]->IsFunction()) { 476 if (args.Length() <= 1 || !args[1]->IsFunction()) {
477 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestTy pedefs", "The callback provided as parameter 2 is not a function."), args.GetIso late()); 477 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestTy pedefs", "The callback provided as parameter 2 is not a function."), args.GetIso late());
478 return; 478 return;
479 } 479 }
480 RefPtr<TestCallback> testCallback = V8TestCallback::create(args[1], getExecu tionContext()); 480 RefPtr<TestCallback> testCallback = V8TestCallback::create(args[1], getExecu tionContext());
481 481
482 RefPtr<TestTypedefs> impl = TestTypedefs::create(hello, testCallback); 482 RefPtr<TestTypedefs> impl = TestTypedefs::create(hello, testCallback);
483 v8::Handle<v8::Object> wrapper = args.Holder(); 483 v8::Handle<v8::Object> wrapper = args.Holder();
484 484
485 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl.release(), &V8 TestTypedefs::info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent) ; 485 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl.release(), &V8 TestTypedefs::wrapperTypeInfo, wrapper, args.GetIsolate(), WrapperConfiguration: :Dependent);
486 args.GetReturnValue().Set(wrapper); 486 args.GetReturnValue().Set(wrapper);
487 } 487 }
488 488
489 } // namespace TestTypedefsV8Internal 489 } // namespace TestTypedefsV8Internal
490 490
491 static const V8DOMConfiguration::AttributeConfiguration V8TestTypedefsAttributes [] = { 491 static const V8DOMConfiguration::AttributeConfiguration V8TestTypedefsAttributes [] = {
492 {"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 */}, 492 {"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 */},
493 {"immutableSerializedScriptValue", TestTypedefsV8Internal::immutableSerializ edScriptValueAttributeGetterCallback, TestTypedefsV8Internal::immutableSerialize dScriptValueAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8: :DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 493 {"immutableSerializedScriptValue", TestTypedefsV8Internal::immutableSerializ edScriptValueAttributeGetterCallback, TestTypedefsV8Internal::immutableSerialize dScriptValueAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8: :DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
494 {"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 */}, 494 {"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 */},
495 {"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 */}, 495 {"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 */},
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(desc, "TestTy pedefs", v8::Local<v8::FunctionTemplate>(), V8TestTypedefs::internalFieldCount, 533 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(desc, "TestTy pedefs", v8::Local<v8::FunctionTemplate>(), V8TestTypedefs::internalFieldCount,
534 V8TestTypedefsAttributes, WTF_ARRAY_LENGTH(V8TestTypedefsAttributes), 534 V8TestTypedefsAttributes, WTF_ARRAY_LENGTH(V8TestTypedefsAttributes),
535 V8TestTypedefsMethods, WTF_ARRAY_LENGTH(V8TestTypedefsMethods), isolate, currentWorldType); 535 V8TestTypedefsMethods, WTF_ARRAY_LENGTH(V8TestTypedefsMethods), isolate, currentWorldType);
536 UNUSED_PARAM(defaultSignature); 536 UNUSED_PARAM(defaultSignature);
537 desc->SetCallHandler(V8TestTypedefs::constructorCallback); 537 desc->SetCallHandler(V8TestTypedefs::constructorCallback);
538 desc->SetLength(2); 538 desc->SetLength(2);
539 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); 539 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
540 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); 540 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
541 UNUSED_PARAM(instance); 541 UNUSED_PARAM(instance);
542 UNUSED_PARAM(proto); 542 UNUSED_PARAM(proto);
543 desc->SetNativeDataProperty(v8::String::NewSymbol("TestSubObj"), TestTypedef sV8Internal::TestTypedefsConstructorGetter, 0, v8::External::New(&V8TestSubObj:: info), static_cast<v8::PropertyAttribute>(v8::DontEnum), v8::Handle<v8::Accessor Signature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); 543 desc->SetNativeDataProperty(v8::String::NewSymbol("TestSubObj"), TestTypedef sV8Internal::TestTypedefsConstructorGetter, 0, v8::External::New(&V8TestSubObj:: wrapperTypeInfo), static_cast<v8::PropertyAttribute>(v8::DontEnum), v8::Handle<v 8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
544 544
545 // Custom toString template 545 // Custom toString template
546 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to StringTemplate()); 546 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to StringTemplate());
547 return desc; 547 return desc;
548 } 548 }
549 549
550 v8::Handle<v8::FunctionTemplate> V8TestTypedefs::GetTemplate(v8::Isolate* isolat e, WrapperWorldType currentWorldType) 550 v8::Handle<v8::FunctionTemplate> V8TestTypedefs::GetTemplate(v8::Isolate* isolat e, WrapperWorldType currentWorldType)
551 { 551 {
552 V8PerIsolateData* data = V8PerIsolateData::from(isolate); 552 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
553 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo rldType).find(&info); 553 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo rldType).find(&wrapperTypeInfo);
554 if (result != data->templateMap(currentWorldType).end()) 554 if (result != data->templateMap(currentWorldType).end())
555 return result->value.newLocal(isolate); 555 return result->value.newLocal(isolate);
556 556
557 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); 557 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
558 v8::HandleScope handleScope(isolate); 558 v8::HandleScope handleScope(isolate);
559 v8::Handle<v8::FunctionTemplate> templ = 559 v8::Handle<v8::FunctionTemplate> templ =
560 ConfigureV8TestTypedefsTemplate(data->rawTemplate(&info, currentWorldTyp e), isolate, currentWorldType); 560 ConfigureV8TestTypedefsTemplate(data->rawTemplate(&wrapperTypeInfo, curr entWorldType), isolate, currentWorldType);
561 data->templateMap(currentWorldType).add(&info, UnsafePersistent<v8::Function Template>(isolate, templ)); 561 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v 8::FunctionTemplate>(isolate, templ));
562 return handleScope.Close(templ); 562 return handleScope.Close(templ);
563 } 563 }
564 564
565 bool V8TestTypedefs::HasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* iso late, WrapperWorldType currentWorldType) 565 bool V8TestTypedefs::HasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* iso late, WrapperWorldType currentWorldType)
566 { 566 {
567 return V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, currentW orldType); 567 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu e, currentWorldType);
568 } 568 }
569 569
570 bool V8TestTypedefs::HasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Is olate* isolate) 570 bool V8TestTypedefs::HasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Is olate* isolate)
571 { 571 {
572 return V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, MainWorl d) 572 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu e, MainWorld)
573 || V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, Isolated World) 573 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu e, IsolatedWorld)
574 || V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, WorkerWo rld); 574 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu e, WorkerWorld);
575 } 575 }
576 576
577 v8::Handle<v8::Object> V8TestTypedefs::createWrapper(PassRefPtr<TestTypedefs> im pl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 577 v8::Handle<v8::Object> V8TestTypedefs::createWrapper(PassRefPtr<TestTypedefs> im pl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
578 { 578 {
579 ASSERT(impl); 579 ASSERT(impl);
580 ASSERT(!DOMDataStore::containsWrapper<V8TestTypedefs>(impl.get(), isolate)); 580 ASSERT(!DOMDataStore::containsWrapper<V8TestTypedefs>(impl.get(), isolate));
581 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { 581 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
582 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje ct(impl.get()); 582 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje ct(impl.get());
583 // Might be a XXXConstructor::info instead of an XXX::info. These will b oth have 583 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper TypeInfo. These will both have
584 // the same object de-ref functions, though, so use that as the basis of the check. 584 // the same object de-ref functions, though, so use that as the basis of the check.
585 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == info.derefObjectFunction); 585 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
586 } 586 }
587 587
588 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &info, toInternalPointer(impl.get()), isolate); 588 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
589 if (UNLIKELY(wrapper.IsEmpty())) 589 if (UNLIKELY(wrapper.IsEmpty()))
590 return wrapper; 590 return wrapper;
591 591
592 installPerContextEnabledProperties(wrapper, impl.get(), isolate); 592 installPerContextEnabledProperties(wrapper, impl.get(), isolate);
593 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl, &info, wrappe r, isolate, WrapperConfiguration::Independent); 593 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl, &wrapperTypeI nfo, wrapper, isolate, WrapperConfiguration::Independent);
594 return wrapper; 594 return wrapper;
595 } 595 }
596 596
597 void V8TestTypedefs::derefObject(void* object) 597 void V8TestTypedefs::derefObject(void* object)
598 { 598 {
599 fromInternalPointer(object)->deref(); 599 fromInternalPointer(object)->deref();
600 } 600 }
601 601
602 } // namespace WebCore 602 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestTypedefs.h ('k') | Source/bindings/v8/CustomElementConstructorBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698