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

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

Issue 1358353002: * Change C++ serialization/deserialization to not be move-only operations (with the except of |Ha… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: (*it).get() to it->, and other formatting Created 5 years, 3 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 bb7347e61571a3694493825735a935bb5906f5f7..e0a3939221fdb76e04484e530eaaffd8860c0d44 100644
--- a/mojo/public/cpp/bindings/lib/bindings_internal.h
+++ b/mojo/public/cpp/bindings/lib/bindings_internal.h
@@ -105,6 +105,42 @@ struct RemoveStructPtr<InlinedStructPtr<T>> {
};
template <typename T>
+struct UnwrapStructPtr {
+ static T* value(T& x) { return &x; }
+};
+
+template <typename T>
+struct UnwrapStructPtr<StructPtr<T>> {
+ static T* value(StructPtr<T>& x) { return x.get(); }
+};
+
+template <typename T>
+struct UnwrapStructPtr<InlinedStructPtr<T>> {
+ static T* value(InlinedStructPtr<T>& x) { return x.get(); }
+};
+
+template <typename T>
+struct UnwrapConstStructPtr {
+ static const T* value(const T& x) { return &x; }
+};
+
+template <typename T>
+struct UnwrapConstStructPtr<StructPtr<T>> {
+ static const T* value(const StructPtr<T>& x) { return x.get(); }
+};
+
+template <typename T>
+struct UnwrapConstStructPtr<InlinedStructPtr<T>> {
+ static const T* value(const InlinedStructPtr<T>& x) { return x.get(); }
+};
+
+template <typename T>
+struct IsStructPtr {
+ static bool const value = IsSpecializationOf<StructPtr, T>::value ||
+ IsSpecializationOf<InlinedStructPtr, T>::value;
+};
+
+template <typename T>
struct IsUnionWrapperType {
template <typename U>
static YesType Test(const typename U::Data_::MojomUnionDataType*);
« no previous file with comments | « mojo/public/cpp/bindings/lib/array_serialization.h ('k') | mojo/public/cpp/bindings/lib/control_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698