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

Unified Diff: mojo/public/cpp/bindings/interface_request.h

Issue 2031823002: Mojo C++ bindings: more consistent Clone() and Equals(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « mojo/public/cpp/bindings/interface_ptr.h ('k') | mojo/public/cpp/bindings/lib/array_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/interface_request.h
diff --git a/mojo/public/cpp/bindings/interface_request.h b/mojo/public/cpp/bindings/interface_request.h
index 3d6b27c0a0ea976a09ca23207235b60911e393cf..26e7b53cdc1e514ec49c47bab4bb356db39e44a8 100644
--- a/mojo/public/cpp/bindings/interface_request.h
+++ b/mojo/public/cpp/bindings/interface_request.h
@@ -55,6 +55,15 @@ class InterfaceRequest {
// Removes the message pipe from the request and returns it.
ScopedMessagePipeHandle PassMessagePipe() { return std::move(handle_); }
+ bool Equals(const InterfaceRequest& 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 invalid.
+ return !is_pending() && !other.is_pending();
+ }
+
private:
ScopedMessagePipeHandle handle_;
};
« no previous file with comments | « mojo/public/cpp/bindings/interface_ptr.h ('k') | mojo/public/cpp/bindings/lib/array_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698