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

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

Issue 64763004: IDL compiler: [Unforgeable] methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: FIXME Created 7 years, 1 month 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 * 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 5451 matching lines...) Expand 10 before | Expand all | Expand 10 after
5462 imp->notEnumerableReadOnlyVoidMethod(); 5462 imp->notEnumerableReadOnlyVoidMethod();
5463 } 5463 }
5464 5464
5465 static void notEnumerableReadOnlyVoidMethodMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info) 5465 static void notEnumerableReadOnlyVoidMethodMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info)
5466 { 5466 {
5467 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5467 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5468 TestObjectPythonV8Internal::notEnumerableReadOnlyVoidMethodMethod(info); 5468 TestObjectPythonV8Internal::notEnumerableReadOnlyVoidMethodMethod(info);
5469 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 5469 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
5470 } 5470 }
5471 5471
5472 static void unforgeableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value >& info)
5473 {
5474 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
5475 imp->unforgeableVoidMethod();
5476 }
5477
5478 static void unforgeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& info)
5479 {
5480 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5481 TestObjectPythonV8Internal::unforgeableVoidMethodMethod(info);
5482 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
5483 }
5484
5472 } // namespace TestObjectPythonV8Internal 5485 } // namespace TestObjectPythonV8Internal
5473 5486
5474 static const V8DOMConfiguration::AttributeConfiguration V8TestObjectPythonAttrib utes[] = { 5487 static const V8DOMConfiguration::AttributeConfiguration V8TestObjectPythonAttrib utes[] = {
5475 {"readonlyStringAttribute", TestObjectPythonV8Internal::readonlyStringAttrib uteAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAU LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5488 {"readonlyStringAttribute", TestObjectPythonV8Internal::readonlyStringAttrib uteAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAU LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5476 {"readonlyTestInterfaceEmptyAttribute", TestObjectPythonV8Internal::readonly TestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8:: AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5489 {"readonlyTestInterfaceEmptyAttribute", TestObjectPythonV8Internal::readonly TestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8:: AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5477 {"readonlyLongAttribute", TestObjectPythonV8Internal::readonlyLongAttributeA ttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5490 {"readonlyLongAttribute", TestObjectPythonV8Internal::readonlyLongAttributeA ttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5478 {"dateAttribute", TestObjectPythonV8Internal::dateAttributeAttributeGetterCa llback, TestObjectPythonV8Internal::dateAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribut e>(v8::None), 0 /* on instance */}, 5491 {"dateAttribute", TestObjectPythonV8Internal::dateAttributeAttributeGetterCa llback, TestObjectPythonV8Internal::dateAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribut e>(v8::None), 0 /* on instance */},
5479 {"stringAttribute", TestObjectPythonV8Internal::stringAttributeAttributeGett erCallback, TestObjectPythonV8Internal::stringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAt tribute>(v8::None), 0 /* on instance */}, 5492 {"stringAttribute", TestObjectPythonV8Internal::stringAttributeAttributeGett erCallback, TestObjectPythonV8Internal::stringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAt tribute>(v8::None), 0 /* on instance */},
5480 {"readonlyDOMTimeStampAttribute", TestObjectPythonV8Internal::readonlyDOMTim eStampAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessContro l>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5493 {"readonlyDOMTimeStampAttribute", TestObjectPythonV8Internal::readonlyDOMTim eStampAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessContro l>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5481 {"booleanAttribute", TestObjectPythonV8Internal::booleanAttributeAttributeGe tterCallback, TestObjectPythonV8Internal::booleanAttributeAttributeSetterCallbac k, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Propert yAttribute>(v8::None), 0 /* on instance */}, 5494 {"booleanAttribute", TestObjectPythonV8Internal::booleanAttributeAttributeGe tterCallback, TestObjectPythonV8Internal::booleanAttributeAttributeSetterCallbac k, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Propert yAttribute>(v8::None), 0 /* on instance */},
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
5843 const int perWorldBindingsVoidMethodTestInterfaceEmptyArgArgc = 1; 5856 const int perWorldBindingsVoidMethodTestInterfaceEmptyArgArgc = 1;
5844 v8::Handle<v8::FunctionTemplate> perWorldBindingsVoidMethodTestInterfaceEmpt yArgArgv[perWorldBindingsVoidMethodTestInterfaceEmptyArgArgc] = { V8PerIsolateDa ta::from(isolate)->rawTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWo rldType) }; 5857 v8::Handle<v8::FunctionTemplate> perWorldBindingsVoidMethodTestInterfaceEmpt yArgArgv[perWorldBindingsVoidMethodTestInterfaceEmptyArgArgc] = { V8PerIsolateDa ta::from(isolate)->rawTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWo rldType) };
5845 v8::Handle<v8::Signature> perWorldBindingsVoidMethodTestInterfaceEmptyArgSig nature = v8::Signature::New(desc, perWorldBindingsVoidMethodTestInterfaceEmptyAr gArgc, perWorldBindingsVoidMethodTestInterfaceEmptyArgArgv); 5858 v8::Handle<v8::Signature> perWorldBindingsVoidMethodTestInterfaceEmptyArgSig nature = v8::Signature::New(desc, perWorldBindingsVoidMethodTestInterfaceEmptyAr gArgc, perWorldBindingsVoidMethodTestInterfaceEmptyArgArgv);
5846 if (currentWorldType == MainWorld) { 5859 if (currentWorldType == MainWorld) {
5847 proto->Set(v8::String::NewSymbol("perWorldBindingsVoidMethodTestInterfac eEmptyArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::perWorldBindi ngsVoidMethodTestInterfaceEmptyArgMethodCallbackForMainWorld, v8Undefined(), per WorldBindingsVoidMethodTestInterfaceEmptyArgSignature, 1)); 5860 proto->Set(v8::String::NewSymbol("perWorldBindingsVoidMethodTestInterfac eEmptyArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::perWorldBindi ngsVoidMethodTestInterfaceEmptyArgMethodCallbackForMainWorld, v8Undefined(), per WorldBindingsVoidMethodTestInterfaceEmptyArgSignature, 1));
5848 } else { 5861 } else {
5849 proto->Set(v8::String::NewSymbol("perWorldBindingsVoidMethodTestInterfac eEmptyArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::perWorldBindi ngsVoidMethodTestInterfaceEmptyArgMethodCallback, v8Undefined(), perWorldBinding sVoidMethodTestInterfaceEmptyArgSignature, 1)); 5862 proto->Set(v8::String::NewSymbol("perWorldBindingsVoidMethodTestInterfac eEmptyArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::perWorldBindi ngsVoidMethodTestInterfaceEmptyArgMethodCallback, v8Undefined(), perWorldBinding sVoidMethodTestInterfaceEmptyArgSignature, 1));
5850 } 5863 }
5851 proto->Set(v8::String::NewSymbol("readOnlyVoidMethod"), v8::FunctionTemplate ::New(TestObjectPythonV8Internal::readOnlyVoidMethodMethodCallback, v8Undefined( ), defaultSignature, 0), static_cast<v8::PropertyAttribute>(v8::DontDelete | v8: :ReadOnly)); 5864 proto->Set(v8::String::NewSymbol("readOnlyVoidMethod"), v8::FunctionTemplate ::New(TestObjectPythonV8Internal::readOnlyVoidMethodMethodCallback, v8Undefined( ), defaultSignature, 0), static_cast<v8::PropertyAttribute>(v8::DontDelete | v8: :ReadOnly));
5852 proto->Set(v8::String::NewSymbol("notEnumerableReadOnlyVoidMethod"), v8::Fun ctionTemplate::New(TestObjectPythonV8Internal::notEnumerableReadOnlyVoidMethodMe thodCallback, v8Undefined(), defaultSignature, 0), static_cast<v8::PropertyAttri bute>(v8::DontDelete | v8::DontEnum | v8::ReadOnly)); 5865 proto->Set(v8::String::NewSymbol("notEnumerableReadOnlyVoidMethod"), v8::Fun ctionTemplate::New(TestObjectPythonV8Internal::notEnumerableReadOnlyVoidMethodMe thodCallback, v8Undefined(), defaultSignature, 0), static_cast<v8::PropertyAttri bute>(v8::DontDelete | v8::DontEnum | v8::ReadOnly));
5866 instance->Set(v8::String::NewSymbol("unforgeableVoidMethod"), v8::FunctionTe mplate::New(TestObjectPythonV8Internal::unforgeableVoidMethodMethodCallback, v8U ndefined(), defaultSignature, 0));
5853 desc->SetNativeDataProperty(v8::String::NewSymbol("staticStringAttribute"), TestObjectPythonV8Internal::staticStringAttributeAttributeGetterCallback, TestOb jectPythonV8Internal::staticStringAttributeAttributeSetterCallback, v8::External ::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorS ignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); 5867 desc->SetNativeDataProperty(v8::String::NewSymbol("staticStringAttribute"), TestObjectPythonV8Internal::staticStringAttributeAttributeGetterCallback, TestOb jectPythonV8Internal::staticStringAttributeAttributeSetterCallback, v8::External ::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorS ignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
5854 desc->SetNativeDataProperty(v8::String::NewSymbol("staticLongAttribute"), Te stObjectPythonV8Internal::staticLongAttributeAttributeGetterCallback, TestObject PythonV8Internal::staticLongAttributeAttributeSetterCallback, v8::External::New( 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignatu re>(), static_cast<v8::AccessControl>(v8::DEFAULT)); 5868 desc->SetNativeDataProperty(v8::String::NewSymbol("staticLongAttribute"), Te stObjectPythonV8Internal::staticLongAttributeAttributeGetterCallback, TestObject PythonV8Internal::staticLongAttributeAttributeSetterCallback, v8::External::New( 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignatu re>(), static_cast<v8::AccessControl>(v8::DEFAULT));
5855 5869
5856 // Custom toString template 5870 // Custom toString template
5857 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to StringTemplate()); 5871 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to StringTemplate());
5858 return desc; 5872 return desc;
5859 } 5873 }
5860 5874
5861 v8::Handle<v8::FunctionTemplate> V8TestObjectPython::GetTemplate(v8::Isolate* is olate, WrapperWorldType currentWorldType) 5875 v8::Handle<v8::FunctionTemplate> V8TestObjectPython::GetTemplate(v8::Isolate* is olate, WrapperWorldType currentWorldType)
5862 { 5876 {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
5925 V8DOMWrapper::associateObjectWithWrapper<V8TestObjectPython>(impl, &wrapperT ypeInfo, wrapper, isolate, WrapperConfiguration::Independent); 5939 V8DOMWrapper::associateObjectWithWrapper<V8TestObjectPython>(impl, &wrapperT ypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
5926 return wrapper; 5940 return wrapper;
5927 } 5941 }
5928 5942
5929 void V8TestObjectPython::derefObject(void* object) 5943 void V8TestObjectPython::derefObject(void* object)
5930 { 5944 {
5931 fromInternalPointer(object)->deref(); 5945 fromInternalPointer(object)->deref();
5932 } 5946 }
5933 5947
5934 } // namespace WebCore 5948 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698