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

Unified Diff: mojo/public/cpp/bindings/lib/map_serialization.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/map_serialization.h
diff --git a/mojo/public/cpp/bindings/lib/map_serialization.h b/mojo/public/cpp/bindings/lib/map_serialization.h
index f5939184b3eb9c958d240c3c71d6e7575ffcc452..98b5ff5972691fcfdf70631ecb8beb4324475cd0 100644
--- a/mojo/public/cpp/bindings/lib/map_serialization.h
+++ b/mojo/public/cpp/bindings/lib/map_serialization.h
@@ -68,7 +68,9 @@ struct MapSerializer<
return count * sizeof(StructPointer<S_Data>);
}
static size_t GetItemSize(const S& item) {
- return GetSerializedSize_(*UnwrapConstStructPtr<S>::value(item));
+ return !item.is_null()
viettrungluu 2015/12/07 22:03:51 nit: Is S not testable? (I.e., would |return item
vardhan 2015/12/07 22:48:31 Done. It's testable. I was trying to be more expl
+ ? GetSerializedSize_(*UnwrapConstStructPtr<S>::value(item))
+ : 0;
}
};

Powered by Google App Engine
This is Rietveld 408576698