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

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

Issue 1833033003: C++ Bindings: Remove 'inline' arg from generated union serialization functions. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 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/map_serialization.h
diff --git a/mojo/public/cpp/bindings/lib/map_serialization.h b/mojo/public/cpp/bindings/lib/map_serialization.h
index d691cf88fbdb1d50f59fe12a6507c40e2f8f7b63..8605cb75c9c1ae6ffb3e29d083bc6d08cdbf0881 100644
--- a/mojo/public/cpp/bindings/lib/map_serialization.h
+++ b/mojo/public/cpp/bindings/lib/map_serialization.h
@@ -75,11 +75,11 @@ struct MapSerializer<
template <typename U, typename U_Data>
struct MapSerializer<U, U_Data, true, true> {
static size_t GetBaseArraySize(size_t count) {
- return count * sizeof(U_Data);
- }
- static size_t GetItemSize(const U& item) {
- return GetSerializedSize_(item, true);
+ // GetSerializedSize_ (called in GetItemSize()) will account for
+ // sizeof(U_Data), so prevent double counting by having this count be 0.
+ return 0;
}
+ static size_t GetItemSize(const U& item) { return GetSerializedSize_(item); }
};
template <>
« no previous file with comments | « mojo/public/cpp/bindings/lib/array_serialization.h ('k') | mojo/public/cpp/bindings/tests/union_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698