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

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

Issue 2076313002: Mojo C++ bindings: expose serialization public API for mojo structs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/struct_ptr.h
diff --git a/mojo/public/cpp/bindings/struct_ptr.h b/mojo/public/cpp/bindings/struct_ptr.h
index ab5d57034559c65dc7de1c6fbac630f88f6d1e46..92f2728a3a08470541c0985e5d12e713e7363dbb 100644
--- a/mojo/public/cpp/bindings/struct_ptr.h
+++ b/mojo/public/cpp/bindings/struct_ptr.h
@@ -26,9 +26,10 @@ class StructHelper {
} // namespace internal
// Smart pointer wrapping a mojom structure with move-only semantics.
-template <typename Struct>
+template <typename S>
class StructPtr {
public:
+ using Struct = S;
StructPtr() : ptr_(nullptr) {}
StructPtr(decltype(nullptr)) : ptr_(nullptr) {}
@@ -116,9 +117,10 @@ class StructPtr {
};
// Designed to be used when Struct is small and copyable.
-template <typename Struct>
+template <typename S>
class InlinedStructPtr {
public:
+ using Struct = S;
InlinedStructPtr() : is_null_(true) {}
InlinedStructPtr(decltype(nullptr)) : is_null_(true) {}
« no previous file with comments | « mojo/public/cpp/bindings/lib/serialization.h ('k') | mojo/public/cpp/bindings/tests/struct_traits_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698