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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.cpp

Issue 2742213002: bindings: Make v8_union iterate through its members by type name (Closed)
Patch Set: Created 3 years, 9 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: third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.cpp b/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.cpp
index 8dd9929a5fa6eca6b3381dc6857a8aae84882cda..af1125c47aa5598f3874c79ebf9c567aafa16e08 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.cpp
@@ -25,37 +25,37 @@ namespace blink {
TestInterfaceOrLong::TestInterfaceOrLong() : m_type(SpecificTypeNone) {}
-TestInterfaceImplementation* TestInterfaceOrLong::getAsTestInterface() const {
- DCHECK(isTestInterface());
- return m_testInterface;
+int32_t TestInterfaceOrLong::getAsLong() const {
+ DCHECK(isLong());
+ return m_long;
}
-void TestInterfaceOrLong::setTestInterface(TestInterfaceImplementation* value) {
+void TestInterfaceOrLong::setLong(int32_t value) {
DCHECK(isNull());
- m_testInterface = value;
- m_type = SpecificTypeTestInterface;
+ m_long = value;
+ m_type = SpecificTypeLong;
}
-TestInterfaceOrLong TestInterfaceOrLong::fromTestInterface(TestInterfaceImplementation* value) {
+TestInterfaceOrLong TestInterfaceOrLong::fromLong(int32_t value) {
TestInterfaceOrLong container;
- container.setTestInterface(value);
+ container.setLong(value);
return container;
}
-int32_t TestInterfaceOrLong::getAsLong() const {
- DCHECK(isLong());
- return m_long;
+TestInterfaceImplementation* TestInterfaceOrLong::getAsTestInterface() const {
+ DCHECK(isTestInterface());
+ return m_testInterface;
}
-void TestInterfaceOrLong::setLong(int32_t value) {
+void TestInterfaceOrLong::setTestInterface(TestInterfaceImplementation* value) {
DCHECK(isNull());
- m_long = value;
- m_type = SpecificTypeLong;
+ m_testInterface = value;
+ m_type = SpecificTypeTestInterface;
}
-TestInterfaceOrLong TestInterfaceOrLong::fromLong(int32_t value) {
+TestInterfaceOrLong TestInterfaceOrLong::fromTestInterface(TestInterfaceImplementation* value) {
TestInterfaceOrLong container;
- container.setLong(value);
+ container.setTestInterface(value);
return container;
}
@@ -101,10 +101,10 @@ v8::Local<v8::Value> ToV8(const TestInterfaceOrLong& impl, v8::Local<v8::Object>
switch (impl.m_type) {
case TestInterfaceOrLong::SpecificTypeNone:
return v8::Null(isolate);
- case TestInterfaceOrLong::SpecificTypeTestInterface:
- return ToV8(impl.getAsTestInterface(), creationContext, isolate);
case TestInterfaceOrLong::SpecificTypeLong:
return v8::Integer::New(isolate, impl.getAsLong());
+ case TestInterfaceOrLong::SpecificTypeTestInterface:
+ return ToV8(impl.getAsTestInterface(), creationContext, isolate);
default:
NOTREACHED();
}

Powered by Google App Engine
This is Rietveld 408576698