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

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

Issue 447523003: Move most DOM attributes to prototype chains Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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
« no previous file with comments | « Source/bindings/tests/results/core/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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestTypedefs.h" 8 #include "V8TestTypedefs.h"
9 9
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
(...skipping 16 matching lines...) Expand all
27 27
28 const WrapperTypeInfo V8TestTypedefs::wrapperTypeInfo = { gin::kEmbedderBlink, V 8TestTypedefs::domTemplate, V8TestTypedefs::refObject, V8TestTypedefs::derefObje ct, V8TestTypedefs::trace, 0, 0, V8TestTypedefs::installConditionallyEnabledMeth ods, V8TestTypedefs::installConditionallyEnabledProperties, 0, WrapperTypeInfo:: WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::Not InheritFromEventTarget, WrapperTypeInfo::Independent, WrapperTypeInfo::RefCounte dObject }; 28 const WrapperTypeInfo V8TestTypedefs::wrapperTypeInfo = { gin::kEmbedderBlink, V 8TestTypedefs::domTemplate, V8TestTypedefs::refObject, V8TestTypedefs::derefObje ct, V8TestTypedefs::trace, 0, 0, V8TestTypedefs::installConditionallyEnabledMeth ods, V8TestTypedefs::installConditionallyEnabledProperties, 0, WrapperTypeInfo:: WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::Not InheritFromEventTarget, WrapperTypeInfo::Independent, WrapperTypeInfo::RefCounte dObject };
29 29
30 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestTypedefs .h. 30 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestTypedefs .h.
31 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in 31 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
32 // bindings/core/v8/ScriptWrappable.h. 32 // bindings/core/v8/ScriptWrappable.h.
33 const WrapperTypeInfo& TestTypedefs::s_wrapperTypeInfo = V8TestTypedefs::wrapper TypeInfo; 33 const WrapperTypeInfo& TestTypedefs::s_wrapperTypeInfo = V8TestTypedefs::wrapper TypeInfo;
34 34
35 namespace TestTypedefsV8Internal { 35 namespace TestTypedefsV8Internal {
36 36
37 static void uLongLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8: :Value>& info) 37 static void uLongLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8: :Value>& info)
38 { 38 {
39 v8::Local<v8::Object> holder = info.Holder(); 39 v8::Local<v8::Object> holder = info.Holder();
40 TestTypedefs* impl = V8TestTypedefs::toImpl(holder); 40 TestTypedefs* impl = V8TestTypedefs::toImpl(holder);
41 v8SetReturnValue(info, static_cast<double>(impl->uLongLongAttribute())); 41 v8SetReturnValue(info, static_cast<double>(impl->uLongLongAttribute()));
42 } 42 }
43 43
44 static void uLongLongAttributeAttributeGetterCallback(v8::Local<v8::String>, con st v8::PropertyCallbackInfo<v8::Value>& info) 44 static void uLongLongAttributeAttributeGetterCallback(const v8::FunctionCallback Info<v8::Value>& info)
45 { 45 {
46 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 46 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
47 TestTypedefsV8Internal::uLongLongAttributeAttributeGetter(info); 47 TestTypedefsV8Internal::uLongLongAttributeAttributeGetter(info);
48 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 48 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
49 } 49 }
50 50
51 static void uLongLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, cons t v8::PropertyCallbackInfo<void>& info) 51 static void uLongLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, cons t v8::FunctionCallbackInfo<v8::Value>& info)
52 { 52 {
53 v8::Local<v8::Object> holder = info.Holder(); 53 v8::Local<v8::Object> holder = info.Holder();
54 ExceptionState exceptionState(ExceptionState::SetterContext, "uLongLongAttri bute", "TestTypedefs", holder, info.GetIsolate()); 54 ExceptionState exceptionState(ExceptionState::SetterContext, "uLongLongAttri bute", "TestTypedefs", holder, info.GetIsolate());
55 TestTypedefs* impl = V8TestTypedefs::toImpl(holder); 55 TestTypedefs* impl = V8TestTypedefs::toImpl(holder);
56 TONATIVE_VOID_EXCEPTIONSTATE(unsigned long long, cppValue, toUInt64(v8Value, exceptionState), exceptionState); 56 TONATIVE_VOID_EXCEPTIONSTATE(unsigned long long, cppValue, toUInt64(v8Value, exceptionState), exceptionState);
57 impl->setULongLongAttribute(cppValue); 57 impl->setULongLongAttribute(cppValue);
58 } 58 }
59 59
60 static void uLongLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8: :Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 60 static void uLongLongAttributeAttributeSetterCallback(const v8::FunctionCallback Info<v8::Value>& info)
61 { 61 {
62 v8::Local<v8::Value> v8Value = info[0];
62 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 63 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
63 TestTypedefsV8Internal::uLongLongAttributeAttributeSetter(v8Value, info); 64 TestTypedefsV8Internal::uLongLongAttributeAttributeSetter(v8Value, info);
64 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 65 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
65 } 66 }
66 67
67 static void TestTypedefsConstructorGetter(v8::Local<v8::String>, const v8::Prope rtyCallbackInfo<v8::Value>& info) 68 static void TestTypedefsConstructorGetter(v8::Local<v8::String>, const v8::Prope rtyCallbackInfo<v8::Value>& info)
68 { 69 {
69 v8::Local<v8::Value> data = info.Data(); 70 v8::Local<v8::Value> data = info.Data();
70 ASSERT(data->IsExternal()); 71 ASSERT(data->IsExternal());
71 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre ationContext()); 72 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre ationContext());
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 } 269 }
269 RefPtr<TestTypedefs> impl = TestTypedefs::create(stringArg); 270 RefPtr<TestTypedefs> impl = TestTypedefs::create(stringArg);
270 v8::Local<v8::Object> wrapper = info.Holder(); 271 v8::Local<v8::Object> wrapper = info.Holder();
271 impl->associateWithWrapper(info.GetIsolate(), &V8TestTypedefs::wrapperTypeIn fo, wrapper); 272 impl->associateWithWrapper(info.GetIsolate(), &V8TestTypedefs::wrapperTypeIn fo, wrapper);
272 v8SetReturnValue(info, wrapper); 273 v8SetReturnValue(info, wrapper);
273 } 274 }
274 275
275 } // namespace TestTypedefsV8Internal 276 } // namespace TestTypedefsV8Internal
276 277
277 static const V8DOMConfiguration::AttributeConfiguration V8TestTypedefsAttributes [] = { 278 static const V8DOMConfiguration::AttributeConfiguration V8TestTypedefsAttributes [] = {
278 {"uLongLongAttribute", TestTypedefsV8Internal::uLongLongAttributeAttributeGe tterCallback, TestTypedefsV8Internal::uLongLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyA ttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration ::OnInstance},
279 {"tAttribute", TestTypedefsV8Internal::TestTypedefsConstructorGetter, TestTy pedefsV8Internal::TestTypedefsForceSetAttributeOnThisCallback, 0, 0, const_cast< WrapperTypeInfo*>(&V8TestInterface::wrapperTypeInfo), static_cast<v8::AccessCont rol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfig uration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 279 {"tAttribute", TestTypedefsV8Internal::TestTypedefsConstructorGetter, TestTy pedefsV8Internal::TestTypedefsForceSetAttributeOnThisCallback, 0, 0, const_cast< WrapperTypeInfo*>(&V8TestInterface::wrapperTypeInfo), static_cast<v8::AccessCont rol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfig uration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
280 }; 280 };
281 281
282 static const V8DOMConfiguration::AccessorConfiguration V8TestTypedefsAccessors[] = {
283 {"uLongLongAttribute", TestTypedefsV8Internal::uLongLongAttributeAttributeGe tterCallback, TestTypedefsV8Internal::uLongLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyA ttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts},
284 };
285
282 static const V8DOMConfiguration::MethodConfiguration V8TestTypedefsMethods[] = { 286 static const V8DOMConfiguration::MethodConfiguration V8TestTypedefsMethods[] = {
283 {"voidMethodArrayOfLongsArg", TestTypedefsV8Internal::voidMethodArrayOfLongs ArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 287 {"voidMethodArrayOfLongsArg", TestTypedefsV8Internal::voidMethodArrayOfLongs ArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts},
284 {"voidMethodFloatArgStringArg", TestTypedefsV8Internal::voidMethodFloatArgSt ringArgMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAllScripts}, 288 {"voidMethodFloatArgStringArg", TestTypedefsV8Internal::voidMethodFloatArgSt ringArgMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAllScripts},
285 {"voidMethodTestCallbackInterfaceTypeArg", TestTypedefsV8Internal::voidMetho dTestCallbackInterfaceTypeArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedTo AllScripts}, 289 {"voidMethodTestCallbackInterfaceTypeArg", TestTypedefsV8Internal::voidMetho dTestCallbackInterfaceTypeArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedTo AllScripts},
286 {"uLongLongMethodTestInterfaceEmptyTypeSequenceArg", TestTypedefsV8Internal: :uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethodCallback, 0, 1, V8DOMConf iguration::ExposedToAllScripts}, 290 {"uLongLongMethodTestInterfaceEmptyTypeSequenceArg", TestTypedefsV8Internal: :uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethodCallback, 0, 1, V8DOMConf iguration::ExposedToAllScripts},
287 {"testInterfaceOrTestInterfaceEmptyMethod", TestTypedefsV8Internal::testInte rfaceOrTestInterfaceEmptyMethodMethodCallback, 0, 0, V8DOMConfiguration::Exposed ToAllScripts}, 291 {"testInterfaceOrTestInterfaceEmptyMethod", TestTypedefsV8Internal::testInte rfaceOrTestInterfaceEmptyMethodMethodCallback, 0, 0, V8DOMConfiguration::Exposed ToAllScripts},
288 {"domStringOrDoubleMethod", TestTypedefsV8Internal::domStringOrDoubleMethodM ethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 292 {"domStringOrDoubleMethod", TestTypedefsV8Internal::domStringOrDoubleMethodM ethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts},
289 {"arrayOfStringsMethodArrayOfStringsArg", TestTypedefsV8Internal::arrayOfStr ingsMethodArrayOfStringsArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAl lScripts}, 293 {"arrayOfStringsMethodArrayOfStringsArg", TestTypedefsV8Internal::arrayOfStr ingsMethodArrayOfStringsArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAl lScripts},
290 {"stringArrayMethodStringArrayArg", TestTypedefsV8Internal::stringArrayMetho dStringArrayArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 294 {"stringArrayMethodStringArrayArg", TestTypedefsV8Internal::stringArrayMetho dStringArrayArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
291 }; 295 };
(...skipping 14 matching lines...) Expand all
306 TestTypedefsV8Internal::constructor(info); 310 TestTypedefsV8Internal::constructor(info);
307 } 311 }
308 312
309 static void installV8TestTypedefsTemplate(v8::Local<v8::FunctionTemplate> functi onTemplate, v8::Isolate* isolate) 313 static void installV8TestTypedefsTemplate(v8::Local<v8::FunctionTemplate> functi onTemplate, v8::Isolate* isolate)
310 { 314 {
311 functionTemplate->ReadOnlyPrototype(); 315 functionTemplate->ReadOnlyPrototype();
312 316
313 v8::Local<v8::Signature> defaultSignature; 317 v8::Local<v8::Signature> defaultSignature;
314 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func tionTemplate, "TestTypedefs", v8::Local<v8::FunctionTemplate>(), V8TestTypedefs: :internalFieldCount, 318 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func tionTemplate, "TestTypedefs", v8::Local<v8::FunctionTemplate>(), V8TestTypedefs: :internalFieldCount,
315 V8TestTypedefsAttributes, WTF_ARRAY_LENGTH(V8TestTypedefsAttributes), 319 V8TestTypedefsAttributes, WTF_ARRAY_LENGTH(V8TestTypedefsAttributes),
316 0, 0, 320 V8TestTypedefsAccessors, WTF_ARRAY_LENGTH(V8TestTypedefsAccessors),
317 V8TestTypedefsMethods, WTF_ARRAY_LENGTH(V8TestTypedefsMethods)); 321 V8TestTypedefsMethods, WTF_ARRAY_LENGTH(V8TestTypedefsMethods));
318 functionTemplate->SetCallHandler(V8TestTypedefs::constructorCallback); 322 functionTemplate->SetCallHandler(V8TestTypedefs::constructorCallback);
319 functionTemplate->SetLength(1); 323 functionTemplate->SetLength(1);
320 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate(); 324 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate();
321 ALLOW_UNUSED_LOCAL(instanceTemplate); 325 ALLOW_UNUSED_LOCAL(instanceTemplate);
322 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate(); 326 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate();
323 ALLOW_UNUSED_LOCAL(prototypeTemplate); 327 ALLOW_UNUSED_LOCAL(prototypeTemplate);
324 328
325 // Custom toString template 329 // Custom toString template
326 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :from(isolate)->toStringTemplate()); 330 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :from(isolate)->toStringTemplate());
(...skipping 23 matching lines...) Expand all
350 { 354 {
351 scriptWrappable->toImpl<TestTypedefs>()->ref(); 355 scriptWrappable->toImpl<TestTypedefs>()->ref();
352 } 356 }
353 357
354 void V8TestTypedefs::derefObject(ScriptWrappable* scriptWrappable) 358 void V8TestTypedefs::derefObject(ScriptWrappable* scriptWrappable)
355 { 359 {
356 scriptWrappable->toImpl<TestTypedefs>()->deref(); 360 scriptWrappable->toImpl<TestTypedefs>()->deref();
357 } 361 }
358 362
359 } // namespace blink 363 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/core/V8TestObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698