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

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

Issue 15076011: Support union return type for anonymous named/indexed getter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 7 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 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 10 matching lines...) Expand all
21 #include "config.h" 21 #include "config.h"
22 #include "V8TestObject.h" 22 #include "V8TestObject.h"
23 23
24 #include "HTMLNames.h" 24 #include "HTMLNames.h"
25 #include "RuntimeEnabledFeatures.h" 25 #include "RuntimeEnabledFeatures.h"
26 #include "ScriptProfile.h" 26 #include "ScriptProfile.h"
27 #include "V8DOMStringList.h" 27 #include "V8DOMStringList.h"
28 #include "V8Document.h" 28 #include "V8Document.h"
29 #include "V8Float32Array.h" 29 #include "V8Float32Array.h"
30 #include "V8Node.h" 30 #include "V8Node.h"
31 #include "V8NodeList.h"
31 #include "V8SVGDocument.h" 32 #include "V8SVGDocument.h"
32 #include "V8SVGPoint.h" 33 #include "V8SVGPoint.h"
33 #include "V8ScriptProfile.h" 34 #include "V8ScriptProfile.h"
34 #include "V8TestCallback.h" 35 #include "V8TestCallback.h"
35 #include "V8TestNode.h" 36 #include "V8TestNode.h"
36 #include "V8TestSubObj.h" 37 #include "V8TestSubObj.h"
37 #include "bindings/v8/BindingSecurity.h" 38 #include "bindings/v8/BindingSecurity.h"
38 #include "bindings/v8/Dictionary.h" 39 #include "bindings/v8/Dictionary.h"
39 #include "bindings/v8/ScriptController.h" 40 #include "bindings/v8/ScriptController.h"
40 #include "bindings/v8/ScriptValue.h" 41 #include "bindings/v8/ScriptValue.h"
(...skipping 2505 matching lines...) Expand 10 before | Expand all | Expand 10 after
2546 { 2547 {
2547 return TestObjV8Internal::optionsObjectMethod(args); 2548 return TestObjV8Internal::optionsObjectMethod(args);
2548 } 2549 }
2549 2550
2550 static v8::Handle<v8::Value> namedItemMethod(const v8::Arguments& args) 2551 static v8::Handle<v8::Value> namedItemMethod(const v8::Arguments& args)
2551 { 2552 {
2552 if (args.Length() < 1) 2553 if (args.Length() < 1)
2553 return throwNotEnoughArgumentsError(args.GetIsolate()); 2554 return throwNotEnoughArgumentsError(args.GetIsolate());
2554 TestObj* imp = V8TestObject::toNative(args.Holder()); 2555 TestObj* imp = V8TestObject::toNative(args.Holder());
2555 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, name, args[0]); 2556 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, name, args[0]);
2556 return v8String(imp->namedItem(name), args.GetIsolate(), ReturnUnsafeHandle) ; 2557 return toV8(imp->namedItem(name), args.Holder(), args.GetIsolate());
2557 } 2558 }
2558 2559
2559 static v8::Handle<v8::Value> namedItemMethodCallback(const v8::Arguments& args) 2560 static v8::Handle<v8::Value> namedItemMethodCallback(const v8::Arguments& args)
2560 { 2561 {
2561 return TestObjV8Internal::namedItemMethod(args); 2562 return TestObjV8Internal::namedItemMethod(args);
2562 } 2563 }
2563 2564
2564 static v8::Handle<v8::Value> methodWithExceptionMethod(const v8::Arguments& args ) 2565 static v8::Handle<v8::Value> methodWithExceptionMethod(const v8::Arguments& args )
2565 { 2566 {
2566 TestObj* imp = V8TestObject::toNative(args.Holder()); 2567 TestObj* imp = V8TestObject::toNative(args.Holder());
(...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after
4294 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) 4295 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
4295 return args.Holder(); 4296 return args.Holder();
4296 4297
4297 return TestObjV8Internal::constructor(args); 4298 return TestObjV8Internal::constructor(args);
4298 } 4299 }
4299 4300
4300 v8::Handle<v8::Value> V8TestObject::indexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info) 4301 v8::Handle<v8::Value> V8TestObject::indexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info)
4301 { 4302 {
4302 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); 4303 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder()));
4303 TestObj* collection = toNative(info.Holder()); 4304 TestObj* collection = toNative(info.Holder());
4304 RefPtr<Node> element = collection->item(index); 4305 WTF::UnionType2<NodeList, Node> element = collection->item(index);
4305 if (!element) 4306 if (element.isNull())
4306 return v8Undefined(); 4307 return v8Undefined();
4307 return toV8Fast(element.release(), info, collection); 4308
4309 v8::Handle<v8::Value> jsValue;
4310 if (element.isValue0Enabled())
4311 jsValue = toV8Fast(element.getValue0(), info, collection);
4312 if (element.isValue1Enabled())
4313 jsValue = toV8Fast(element.getValue1(), info, collection);
4314
4315 return jsValue;
4308 } 4316 }
4309 4317
4310 v8::Handle<v8::Value> V8TestObject::namedPropertyGetter(v8::Local<v8::String> na me, const v8::AccessorInfo& info) 4318 v8::Handle<v8::Value> V8TestObject::namedPropertyGetter(v8::Local<v8::String> na me, const v8::AccessorInfo& info)
4311 { 4319 {
4312 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) 4320 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
4313 return v8Undefined(); 4321 return v8Undefined();
4314 if (info.Holder()->HasRealNamedCallbackProperty(name)) 4322 if (info.Holder()->HasRealNamedCallbackProperty(name))
4315 return v8Undefined(); 4323 return v8Undefined();
4316 4324
4317 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); 4325 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder()));
4318 TestObj* collection = toNative(info.Holder()); 4326 TestObj* collection = toNative(info.Holder());
4319 AtomicString propertyName = toWebCoreAtomicString(name); 4327 AtomicString propertyName = toWebCoreAtomicString(name);
4320 String element = collection->namedItem(propertyName); 4328 RefPtr<Node> element = collection->namedItem(propertyName);
4321 if (element.isNull()) 4329 if (!element)
4322 return v8Undefined(); 4330 return v8Undefined();
4323 return v8String(element, info.GetIsolate()); 4331
4332 v8::Handle<v8::Value> jsValue;
4333 jsValue = toV8Fast(element.release(), info, collection);
4334 return jsValue;
4324 } 4335 }
4325 4336
4326 static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjectTemplate(v8::Pe rsistent<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType curr entWorldType) 4337 static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjectTemplate(v8::Pe rsistent<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType curr entWorldType)
4327 { 4338 {
4328 desc->ReadOnlyPrototype(); 4339 desc->ReadOnlyPrototype();
4329 4340
4330 v8::Local<v8::Signature> defaultSignature; 4341 v8::Local<v8::Signature> defaultSignature;
4331 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestObject", v8::Persistent<v8::FunctionTemplate>(), V8TestObject::internalFieldCount, 4342 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestObject", v8::Persistent<v8::FunctionTemplate>(), V8TestObject::internalFieldCount,
4332 V8TestObjectAttrs, WTF_ARRAY_LENGTH(V8TestObjectAttrs), 4343 V8TestObjectAttrs, WTF_ARRAY_LENGTH(V8TestObjectAttrs),
4333 V8TestObjectMethods, WTF_ARRAY_LENGTH(V8TestObjectMethods), isolate, cur rentWorldType); 4344 V8TestObjectMethods, WTF_ARRAY_LENGTH(V8TestObjectMethods), isolate, cur rentWorldType);
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
4505 installPerContextProperties(wrapper, impl.get(), isolate); 4516 installPerContextProperties(wrapper, impl.get(), isolate);
4506 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, hasD ependentLifetime ? WrapperConfiguration::Dependent : WrapperConfiguration::Indep endent); 4517 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, hasD ependentLifetime ? WrapperConfiguration::Dependent : WrapperConfiguration::Indep endent);
4507 return wrapper; 4518 return wrapper;
4508 } 4519 }
4509 void V8TestObject::derefObject(void* object) 4520 void V8TestObject::derefObject(void* object)
4510 { 4521 {
4511 static_cast<TestObj*>(object)->deref(); 4522 static_cast<TestObj*>(object)->deref();
4512 } 4523 }
4513 4524
4514 } // namespace WebCore 4525 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698