Index: mojo/public/cpp/bindings/lib/bindings_internal.h |
diff --git a/mojo/public/cpp/bindings/lib/bindings_internal.h b/mojo/public/cpp/bindings/lib/bindings_internal.h |
index df3c620f084d2d1558e263b271b16f99a28cc635..ec70d37716e05005da7d3f0fb9ada1b2d10cb052 100644 |
--- a/mojo/public/cpp/bindings/lib/bindings_internal.h |
+++ b/mojo/public/cpp/bindings/lib/bindings_internal.h |
@@ -12,6 +12,12 @@ |
namespace mojo { |
class String; |
+template <typename T> |
+class Array; |
+ |
+template <typename K, typename V> |
+class Map; |
+ |
namespace internal { |
template <typename T> |
class Array_Data; |
@@ -94,6 +100,29 @@ struct WrapperTraits<S, true> { |
typedef typename S::Data_* DataType; |
}; |
+template <typename T, typename Enable = void> |
+struct ValueTraits { |
+ static bool Equals(const T& a, const T& b) { return a == b; } |
+}; |
+ |
+template <typename T> |
+struct ValueTraits< |
+ T, |
+ typename EnableIf<IsSpecializationOf<Array, T>::value || |
+ IsSpecializationOf<Map, T>::value || |
+ IsSpecializationOf<StructPtr, T>::value || |
+ IsSpecializationOf<InlinedStructPtr, T>::value>::type> { |
+ static bool Equals(const T& a, const T& b) { return a.Equals(b); } |
+}; |
+ |
+template <typename T> |
+struct ValueTraits<ScopedHandleBase<T>> { |
+ static bool Equals(const ScopedHandleBase<T>& a, |
+ const ScopedHandleBase<T>& b) { |
+ return a.get().value() == b.get().value(); |
+ } |
+}; |
+ |
} // namespace internal |
} // namespace mojo |