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

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

Issue 466323002: IDL: Use Nullable for union type return value (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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/V8TestTypedefs.cpp
diff --git a/Source/bindings/tests/results/V8TestTypedefs.cpp b/Source/bindings/tests/results/V8TestTypedefs.cpp
index 0ef385bf2d8ae7232f052fb04ec705077fbcff3b..d4c45e6caf36fba9efecf63a0908e351538fe6b2 100644
--- a/Source/bindings/tests/results/V8TestTypedefs.cpp
+++ b/Source/bindings/tests/results/V8TestTypedefs.cpp
@@ -196,17 +196,15 @@ static void uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethodCallback(const
static void testInterfaceOrTestInterfaceEmptyMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder());
- bool result0Enabled = false;
- RefPtr<TestInterfaceImplementation> result0;
- bool result1Enabled = false;
- RefPtr<TestInterfaceEmpty> result1;
- impl->testInterfaceOrTestInterfaceEmptyMethod(result0Enabled, result0, result1Enabled, result1);
- if (result0Enabled) {
- v8SetReturnValue(info, result0.release());
+ Nullable<RefPtr<TestInterfaceImplementation> > result0;
+ Nullable<RefPtr<TestInterfaceEmpty> > result1;
+ impl->testInterfaceOrTestInterfaceEmptyMethod(result0, result1);
+ if (!result0.isNull()) {
+ v8SetReturnValue(info, result0.get().release());
return;
}
- if (result1Enabled) {
- v8SetReturnValue(info, result1.release());
+ if (!result1.isNull()) {
+ v8SetReturnValue(info, result1.get().release());
return;
}
v8SetReturnValueNull(info);

Powered by Google App Engine
This is Rietveld 408576698