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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.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
« no previous file with comments | « third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.cpp b/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.cpp
index c11c3db3602da25c25785178f7561a3e8ecac27a..421329cdb6062299976e063224eba28457ee1213 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.cpp
@@ -19,37 +19,37 @@ namespace blink {
UnrestrictedDoubleOrString::UnrestrictedDoubleOrString() : m_type(SpecificTypeNone) {}
-double UnrestrictedDoubleOrString::getAsUnrestrictedDouble() const {
- DCHECK(isUnrestrictedDouble());
- return m_unrestrictedDouble;
+String UnrestrictedDoubleOrString::getAsString() const {
+ DCHECK(isString());
+ return m_string;
}
-void UnrestrictedDoubleOrString::setUnrestrictedDouble(double value) {
+void UnrestrictedDoubleOrString::setString(String value) {
DCHECK(isNull());
- m_unrestrictedDouble = value;
- m_type = SpecificTypeUnrestrictedDouble;
+ m_string = value;
+ m_type = SpecificTypeString;
}
-UnrestrictedDoubleOrString UnrestrictedDoubleOrString::fromUnrestrictedDouble(double value) {
+UnrestrictedDoubleOrString UnrestrictedDoubleOrString::fromString(String value) {
UnrestrictedDoubleOrString container;
- container.setUnrestrictedDouble(value);
+ container.setString(value);
return container;
}
-String UnrestrictedDoubleOrString::getAsString() const {
- DCHECK(isString());
- return m_string;
+double UnrestrictedDoubleOrString::getAsUnrestrictedDouble() const {
+ DCHECK(isUnrestrictedDouble());
+ return m_unrestrictedDouble;
}
-void UnrestrictedDoubleOrString::setString(String value) {
+void UnrestrictedDoubleOrString::setUnrestrictedDouble(double value) {
DCHECK(isNull());
- m_string = value;
- m_type = SpecificTypeString;
+ m_unrestrictedDouble = value;
+ m_type = SpecificTypeUnrestrictedDouble;
}
-UnrestrictedDoubleOrString UnrestrictedDoubleOrString::fromString(String value) {
+UnrestrictedDoubleOrString UnrestrictedDoubleOrString::fromUnrestrictedDouble(double value) {
UnrestrictedDoubleOrString container;
- container.setString(value);
+ container.setUnrestrictedDouble(value);
return container;
}
@@ -88,10 +88,10 @@ v8::Local<v8::Value> ToV8(const UnrestrictedDoubleOrString& impl, v8::Local<v8::
switch (impl.m_type) {
case UnrestrictedDoubleOrString::SpecificTypeNone:
return v8::Null(isolate);
- case UnrestrictedDoubleOrString::SpecificTypeUnrestrictedDouble:
- return v8::Number::New(isolate, impl.getAsUnrestrictedDouble());
case UnrestrictedDoubleOrString::SpecificTypeString:
return v8String(isolate, impl.getAsString());
+ case UnrestrictedDoubleOrString::SpecificTypeUnrestrictedDouble:
+ return v8::Number::New(isolate, impl.getAsUnrestrictedDouble());
default:
NOTREACHED();
}
« no previous file with comments | « third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698