Index: mojo/public/cpp/bindings/array.h |
diff --git a/mojo/public/cpp/bindings/array.h b/mojo/public/cpp/bindings/array.h |
index 966cf313d1cbd2afd2f8013d7fd91b7cca9c284b..2544abb04dadf76c001a0d186c8d6d7e79de5af9 100644 |
--- a/mojo/public/cpp/bindings/array.h |
+++ b/mojo/public/cpp/bindings/array.h |
@@ -12,6 +12,7 @@ |
#include <vector> |
#include "mojo/public/cpp/bindings/lib/array_internal.h" |
+#include "mojo/public/cpp/bindings/lib/bindings_internal.h" |
#include "mojo/public/cpp/bindings/lib/template_util.h" |
#include "mojo/public/cpp/bindings/type_converter.h" |
@@ -107,6 +108,18 @@ class Array { |
return result.Pass(); |
} |
+ bool Equals(const Array& other) const { |
+ if (is_null() != other.is_null()) |
+ return false; |
+ if (size() != other.size()) |
+ return false; |
+ for (size_t i = 0; i < size(); ++i) { |
+ if (!internal::ValueTraits<T>::Equals(at(i), other.at(i))) |
+ return false; |
+ } |
+ return true; |
+ } |
+ |
private: |
typedef std::vector<StorageType> Array::*Testable; |