| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SKY_ENGINE_BINDINGS2_NULLABLE_H_ | 5 #ifndef SKY_ENGINE_BINDINGS_NULLABLE_H_ |
| 6 #define SKY_ENGINE_BINDINGS2_NULLABLE_H_ | 6 #define SKY_ENGINE_BINDINGS_NULLABLE_H_ |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 template <typename T> | 12 template <typename T> |
| 13 class Nullable { | 13 class Nullable { |
| 14 public: | 14 public: |
| 15 Nullable() : value_(), is_null_(true) {} | 15 Nullable() : value_(), is_null_(true) {} |
| 16 Nullable(const T& value) : value_(value), is_null_(false) {} | 16 Nullable(const T& value) : value_(value), is_null_(false) {} |
| (...skipping 27 matching lines...) Expand all Loading... |
| 44 (!is_null_ && !other.is_null_ && value_ == other.value_); | 44 (!is_null_ && !other.is_null_ && value_ == other.value_); |
| 45 } | 45 } |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 T value_; | 48 T value_; |
| 49 bool is_null_; | 49 bool is_null_; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 } // namespace blink | 52 } // namespace blink |
| 53 | 53 |
| 54 #endif // SKY_ENGINE_BINDINGS2_NULLABLE_H_ | 54 #endif // SKY_ENGINE_BINDINGS_NULLABLE_H_ |
| OLD | NEW |