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

Unified Diff: mojo/public/cpp/bindings/lib/bindings_internal.h

Issue 1682113003: Mojo C++ bindings: Generate InterfaceHandle<> instead of InterfacePtr<>. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase ontop of master, address trung's comments Created 4 years, 10 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
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 17fc0121acd8801bce81ccc37b9d70755d2f8740..bef3d7e8169af0e9168b97d8b5c7b753bd1a1618 100644
--- a/mojo/public/cpp/bindings/lib/bindings_internal.h
+++ b/mojo/public/cpp/bindings/lib/bindings_internal.h
@@ -18,7 +18,7 @@ template <typename T>
class Array;
template <typename Interface>
-class InterfacePtr;
+class InterfaceHandle;
template <typename Interface>
class InterfaceRequest;
@@ -212,7 +212,7 @@ struct WrapperTraits<InterfaceRequest<I>, true, false> {
using DataType = MessagePipeHandle;
};
template <typename Interface>
-struct WrapperTraits<InterfacePtr<Interface>, true, false> {
+struct WrapperTraits<InterfaceHandle<Interface>, true, false> {
using DataType = Interface_Data;
};
// Unions.
@@ -253,12 +253,12 @@ struct ValueTraits<ScopedHandleBase<T>> {
}
};
-// |InterfacePtr|s hold message pipes uniquely, so they can only be equal if
+// |InterfaceHandle|s hold message pipes uniquely, so they can only be equal if
// they're the same object or are both "invalid".
template <typename I>
-struct ValueTraits<InterfacePtr<I>> {
- static bool Equals(const InterfacePtr<I>& a, const InterfacePtr<I>& b) {
- return (&a == &b) || (!a.is_bound() && !b.is_bound());
+struct ValueTraits<InterfaceHandle<I>> {
+ static bool Equals(const InterfaceHandle<I>& a, const InterfaceHandle<I>& b) {
+ return (&a == &b) || (!a.is_valid() && !b.is_valid());
}
};
« no previous file with comments | « mojo/public/cpp/bindings/lib/array_serialization.h ('k') | mojo/public/cpp/bindings/lib/bindings_serialization.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698