Chromium Code Reviews

Unified Diff: Source/bindings/core/v8/Nullable.h

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.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_interface.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/Nullable.h
diff --git a/Source/bindings/core/v8/Nullable.h b/Source/bindings/core/v8/Nullable.h
index 6d3cb441a790f2c515ad27c55221c621e7d0c893..f019f7f53a9874a7fd856209a4837308ff41b54c 100644
--- a/Source/bindings/core/v8/Nullable.h
+++ b/Source/bindings/core/v8/Nullable.h
@@ -33,7 +33,13 @@ public:
return *this;
}
+ void set(const T& value)
+ {
+ m_value = value;
+ m_isNull = false;
+ }
const T& get() const { ASSERT(!m_isNull); return m_value; }
+ T& get() { ASSERT(!m_isNull); return m_value; }
bool isNull() const { return m_isNull; }
operator bool() const { return !m_isNull && m_value; }
haraken 2014/08/13 13:07:10 In order to allow implicit conversion to bool but
bashi 2014/08/13 13:45:56 Will do.
bashi 2014/08/15 02:43:53 It turns out we need a meta-function or need to re
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_interface.py » ('j') | no next file with comments »

Powered by Google App Engine