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

Unified Diff: Source/bindings/tests/results/V8TestSpecialOperations.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/V8TestSpecialOperations.cpp
diff --git a/Source/bindings/tests/results/V8TestSpecialOperations.cpp b/Source/bindings/tests/results/V8TestSpecialOperations.cpp
index ea80bde709206e9232fb90407160d12b3fd2ccd8..2d7248d78eb830b27a89fcf99d9676d60efb61ba 100644
--- a/Source/bindings/tests/results/V8TestSpecialOperations.cpp
+++ b/Source/bindings/tests/results/V8TestSpecialOperations.cpp
@@ -59,17 +59,15 @@ static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TOSTRING_VOID_INTERNAL(name, info[0]);
}
- bool result0Enabled = false;
- RefPtrWillBeRawPtr<Node> result0;
- bool result1Enabled = false;
- RefPtrWillBeRawPtr<NodeList> result1;
- impl->getItem(name, result0Enabled, result0, result1Enabled, result1);
- if (result0Enabled) {
- v8SetReturnValue(info, result0.release());
+ Nullable<RefPtrWillBeRawPtr<Node> > result0;
+ Nullable<RefPtrWillBeRawPtr<NodeList> > result1;
+ impl->getItem(name, 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);
@@ -86,19 +84,17 @@ static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
{
TestSpecialOperations* impl = V8TestSpecialOperations::toNative(info.Holder());
AtomicString propertyName = toCoreAtomicString(name);
- bool result0Enabled = false;
- RefPtrWillBeRawPtr<Node> result0;
- bool result1Enabled = false;
- RefPtrWillBeRawPtr<NodeList> result1;
- impl->getItem(propertyName, result0Enabled, result0, result1Enabled, result1);
- if (!result0Enabled && !result1Enabled)
+ Nullable<RefPtrWillBeRawPtr<Node> > result0;
+ Nullable<RefPtrWillBeRawPtr<NodeList> > result1;
+ impl->getItem(propertyName, result0, result1);
+ if (result0.isNull() && result1.isNull())
return;
- if (result0Enabled) {
- v8SetReturnValueFast(info, WTF::getPtr(result0.release()), impl);
+ if (!result0.isNull()) {
+ v8SetReturnValueFast(info, WTF::getPtr(result0.get().release()), impl);
return;
}
- if (result1Enabled) {
- v8SetReturnValueFast(info, WTF::getPtr(result1.release()), impl);
+ if (!result1.isNull()) {
+ v8SetReturnValueFast(info, WTF::getPtr(result1.get().release()), impl);
return;
}
v8SetReturnValueNull(info);

Powered by Google App Engine
This is Rietveld 408576698