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

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
« no previous file with comments | « Source/bindings/tests/idls/TestTypedefs.idl ('k') | Source/bindings/tests/results/V8TestTypedefs.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a24ea47ed7bad5ad38641f07a24c7d8314a64271 100644
--- a/Source/bindings/tests/results/V8TestSpecialOperations.cpp
+++ b/Source/bindings/tests/results/V8TestSpecialOperations.cpp
@@ -59,16 +59,14 @@ 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) {
+ impl->getItem(name, result0, result1);
+ if (result0) {
v8SetReturnValue(info, result0.release());
return;
}
- if (result1Enabled) {
+ if (result1) {
v8SetReturnValue(info, result1.release());
return;
}
@@ -86,22 +84,20 @@ 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)
+ impl->getItem(propertyName, result0, result1);
+ if (!(result0 || result1))
return;
- if (result0Enabled) {
- v8SetReturnValueFast(info, WTF::getPtr(result0.release()), impl);
+ if (result0) {
+ v8SetReturnValue(info, result0.release());
return;
}
- if (result1Enabled) {
- v8SetReturnValueFast(info, WTF::getPtr(result1.release()), impl);
+ if (result1) {
+ v8SetReturnValue(info, result1.release());
return;
}
- v8SetReturnValueNull(info);
+ ASSERT_NOT_REACHED();
}
static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
« no previous file with comments | « Source/bindings/tests/idls/TestTypedefs.idl ('k') | Source/bindings/tests/results/V8TestTypedefs.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698