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

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

Issue 1509703002: Mojo C++ bindings: Fix bug: array<>, map<> should only initialize elements if they're not null when… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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 d202868d3517265ba84bb594c8f6514fcb0d3ad7..17fc0121acd8801bce81ccc37b9d70755d2f8740 100644
--- a/mojo/public/cpp/bindings/lib/bindings_internal.h
+++ b/mojo/public/cpp/bindings/lib/bindings_internal.h
@@ -198,6 +198,7 @@ template <typename T,
IsUnionWrapperType<typename RemoveStructPtr<T>::type>::value>
struct WrapperTraits;
+// Catch-all for all mojom types not specialized below.
template <typename T>
struct WrapperTraits<T, false, false> {
using DataType = T;
@@ -214,6 +215,7 @@ template <typename Interface>
struct WrapperTraits<InterfacePtr<Interface>, true, false> {
using DataType = Interface_Data;
};
+// Unions.
template <typename U>
struct WrapperTraits<StructPtr<U>, true, true> {
using DataType = typename U::Data_;
@@ -222,6 +224,7 @@ template <typename U>
struct WrapperTraits<InlinedStructPtr<U>, true, true> {
using DataType = typename U::Data_;
};
+// Catch-all for other pointer types: arrays, maps.
template <typename S>
struct WrapperTraits<S, true, false> {
using DataType = typename S::Data_*;

Powered by Google App Engine
This is Rietveld 408576698