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

Unified Diff: sky/engine/bindings-dart/common/Nullable.h

Issue 918273002: Remove bindings-dart (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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: sky/engine/bindings-dart/common/Nullable.h
diff --git a/sky/engine/bindings-dart/common/Nullable.h b/sky/engine/bindings-dart/common/Nullable.h
deleted file mode 100644
index 590c09ad3873a84ddd795586982dc1e10f35792c..0000000000000000000000000000000000000000
--- a/sky/engine/bindings-dart/common/Nullable.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef Nullable_h
-#define Nullable_h
-
-#include "platform/heap/Handle.h"
-#include "wtf/Assertions.h"
-
-namespace blink {
-
-template <typename T>
-class Nullable {
- DISALLOW_ALLOCATION();
-public:
- Nullable()
- : m_value()
- , m_isNull(true) { }
-
- Nullable(const T& value)
- : m_value(value)
- , m_isNull(false) { }
-
- Nullable(const Nullable& other)
- : m_value(other.m_value)
- , m_isNull(other.m_isNull) { }
-
- Nullable& operator=(const Nullable& other)
- {
- m_value = other.m_value;
- m_isNull = other.m_isNull;
- 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; }
-
- // See comment in RefPtr.h about what UnspecifiedBoolType is.
- typedef const T* UnspecifiedBoolType;
- operator UnspecifiedBoolType() const { return m_isNull ? 0 : &m_value; }
-
- bool operator==(const Nullable& other) const
- {
- return (m_isNull && other.m_isNull) || (!m_isNull && !other.m_isNull && m_value == other.m_value);
- }
-
- void trace(Visitor* visitor)
- {
- TraceIfNeeded<T>::trace(visitor, &m_value);
- }
-
-private:
- T m_value;
- bool m_isNull;
-};
-
-} // namespace blink
-
-#endif // Nullable_h
« no previous file with comments | « sky/engine/bindings-dart/common/ExceptionStatePlaceholder.cpp ('k') | sky/engine/bindings-dart/common/ScheduledAction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698