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

Unified Diff: Source/wtf/UnionType.h

Issue 15076011: Support union return type for anonymous named/indexed getter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 7 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/wtf/UnionType.h
diff --git a/Source/wtf/UnionType.h b/Source/wtf/UnionType.h
new file mode 100644
index 0000000000000000000000000000000000000000..dd13f20d65a4a77ceb45723009f03925115f02cc
--- /dev/null
+++ b/Source/wtf/UnionType.h
@@ -0,0 +1,48 @@
+#ifndef UnionType_h
kojih 2013/05/15 09:28:26 I don't confident where to place this file. Do you
+#define UnionType_h
+
+namespace WTF {
+
+template<typename Type0, typename Type1>
+class UnionType2 {
+public:
+ UnionType2()
+ {
+ }
+ UnionType2(PassRefPtr<Type0> value)
+ {
+ value0 = value;
+ }
+ UnionType2(PassRefPtr<Type1> value)
+ {
+ value1 = value;
+ }
+ bool isNull() const
+ {
+ return !value0 && !value1;
+ }
+ bool isValue0Enabled() const
+ {
+ return !value0;
+ }
+ PassRefPtr<Type0> getValue0() const
+ {
+ return value0;
+ }
+ bool isValue1Enabled() const
+ {
+ return !value1;
+ }
+ PassRefPtr<Type1> getValue1() const
+ {
+ return value1;
+ }
+private:
+ RefPtr<Type0> value0;
+ RefPtr<Type1> value1;
+};
+
+
+} // namespace WTF
+
+#endif // UnionType_h
« Source/bindings/scripts/CodeGeneratorV8.pm ('K') | « Source/core/html/HTMLFormControlsCollection.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698