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

Unified Diff: Source/bindings/tests/results/core/V8TestTypedefs.cpp

Issue 680193003: IDL: Generate union type containers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/tests/results/core/V8TestTypedefs.cpp
diff --git a/Source/bindings/tests/results/core/V8TestTypedefs.cpp b/Source/bindings/tests/results/core/V8TestTypedefs.cpp
index 6bebcf28f30bf125c2dfbac2fb19ee847e66cf96..b770bbde5090790c5483bfe9bdcd2015678f8a89 100644
--- a/Source/bindings/tests/results/core/V8TestTypedefs.cpp
+++ b/Source/bindings/tests/results/core/V8TestTypedefs.cpp
@@ -8,6 +8,7 @@
#include "V8TestTypedefs.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/UnionTypesCore.h"
#include "bindings/core/v8/V8DOMConfiguration.h"
#include "bindings/core/v8/V8HiddenValue.h"
#include "bindings/core/v8/V8ObjectConstructor.h"
@@ -182,18 +183,9 @@ static void uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethodCallback(const
static void testInterfaceOrTestInterfaceEmptyMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
- RefPtr<TestInterfaceImplementation> result0 = nullptr;
- RefPtr<TestInterfaceEmpty> result1 = nullptr;
- impl->testInterfaceOrTestInterfaceEmptyMethod(result0, result1);
- if (result0) {
- v8SetReturnValue(info, result0.release());
- return;
- }
- if (result1) {
- v8SetReturnValue(info, result1.release());
- return;
- }
- v8SetReturnValueNull(info);
+ TestInterfaceOrTestInterfaceEmpty result;
+ impl->testInterfaceOrTestInterfaceEmptyMethod(result);
+ v8SetReturnValue(info, result);
}
static void testInterfaceOrTestInterfaceEmptyMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -206,18 +198,9 @@ static void testInterfaceOrTestInterfaceEmptyMethodMethodCallback(const v8::Func
static void domStringOrDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
- String result0;
- Nullable<double> result1;
- impl->domStringOrDoubleMethod(result0, result1);
- if (!result0.isNull()) {
- v8SetReturnValueString(info, result0, info.GetIsolate());
- return;
- }
- if (result1) {
- v8SetReturnValue(info, result1.get());
- return;
- }
- v8SetReturnValueNull(info);
+ StringOrDouble result;
+ impl->domStringOrDoubleMethod(result);
+ v8SetReturnValue(info, result);
}
static void domStringOrDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)

Powered by Google App Engine
This is Rietveld 408576698