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

Unified Diff: Source/bindings/tests/results/core/V8TestSpecialOperations.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/V8TestSpecialOperations.cpp
diff --git a/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp b/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
index 55f9547da03efb469f420bdd6ae0a8ede2ac1746..03e04acc3794cc10c09bfc72aae6ee618c68870b 100644
--- a/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
+++ b/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
@@ -8,6 +8,7 @@
#include "V8TestSpecialOperations.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/V8Node.h"
@@ -46,18 +47,9 @@ static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TOSTRING_VOID_INTERNAL(name, info[0]);
}
- RefPtrWillBeRawPtr<Node> result0 = nullptr;
- RefPtrWillBeRawPtr<NodeList> result1 = nullptr;
- impl->getItem(name, result0, result1);
- if (result0) {
- v8SetReturnValue(info, result0.release());
- return;
- }
- if (result1) {
- v8SetReturnValue(info, result1.release());
- return;
- }
- v8SetReturnValueNull(info);
+ NodeOrNodeList result;
+ impl->getItem(name, result);
+ v8SetReturnValue(info, result);
}
static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -71,20 +63,11 @@ static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
{
TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder());
AtomicString propertyName = toCoreAtomicString(name);
- RefPtrWillBeRawPtr<Node> result0 = nullptr;
- RefPtrWillBeRawPtr<NodeList> result1 = nullptr;
- impl->getItem(propertyName, result0, result1);
- if (!(result0 || result1))
+ NodeOrNodeList result;
+ impl->getItem(propertyName, result);
+ if (result.isNull())
return;
- if (result0) {
- v8SetReturnValue(info, result0.release());
- return;
- }
- if (result1) {
- v8SetReturnValue(info, result1.release());
- return;
- }
- ASSERT_NOT_REACHED();
+ v8SetReturnValue(info, result);
}
static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)

Powered by Google App Engine
This is Rietveld 408576698