Index: mojo/public/cpp/bindings/interface_ptr.h |
diff --git a/mojo/public/cpp/bindings/interface_ptr.h b/mojo/public/cpp/bindings/interface_ptr.h |
index e427dc4668d2a273b85f3cb4706f7db781f8daa1..041c24264147084046654e4a41905f9b95d7a537 100644 |
--- a/mojo/public/cpp/bindings/interface_ptr.h |
+++ b/mojo/public/cpp/bindings/interface_ptr.h |
@@ -183,6 +183,15 @@ class InterfacePtr { |
return internal_state_.associated_group(); |
} |
+ bool Equals(const InterfacePtr& other) const { |
+ if (this == &other) |
+ return true; |
+ |
+ // Now that the two refer to different objects, they are equivalent if |
+ // and only if they are both null. |
+ return !(*this) && !other; |
+ } |
+ |
// DO NOT USE. Exposed only for internal use and for testing. |
internal::InterfacePtrState<Interface, Interface::PassesAssociatedKinds_>* |
internal_state() { |