Index: mojo/public/cpp/bindings/struct_ptr.h |
diff --git a/mojo/public/cpp/bindings/struct_ptr.h b/mojo/public/cpp/bindings/struct_ptr.h |
index 5d0836489aadfda523cae11266bbb0793057d270..efcf255e3ae7d454067758d30aab592b33ffc9df 100644 |
--- a/mojo/public/cpp/bindings/struct_ptr.h |
+++ b/mojo/public/cpp/bindings/struct_ptr.h |
@@ -71,6 +71,12 @@ class StructPtr { |
// that it contains Mojo handles). |
StructPtr Clone() const { return is_null() ? StructPtr() : ptr_->Clone(); } |
+ bool Equals(const StructPtr& other) const { |
+ if (is_null() || other.is_null()) |
+ return is_null() && other.is_null(); |
+ return ptr_->Equals(*other.ptr_); |
+ } |
+ |
private: |
typedef Struct* StructPtr::*Testable; |
@@ -139,6 +145,11 @@ class InlinedStructPtr { |
InlinedStructPtr Clone() const { |
return is_null() ? InlinedStructPtr() : value_.Clone(); |
} |
+ bool Equals(const InlinedStructPtr& other) const { |
+ if (is_null() || other.is_null()) |
+ return is_null() && other.is_null(); |
+ return value_.Equals(other.value_); |
+ } |
private: |
typedef Struct InlinedStructPtr::*Testable; |