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

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

Issue 1101303002: Update mojo sdk to rev e7270700d671fa8e458b4d8c9e47f7bcfb65da0b (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Actualy provide a default TaskTracker impl Created 5 years, 8 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: third_party/mojo/src/mojo/public/cpp/bindings/lib/map_serialization.h
diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/lib/map_serialization.h b/third_party/mojo/src/mojo/public/cpp/bindings/lib/map_serialization.h
index 21567792cf88e4f0e28edf56a2044c03d92a6163..632da5dd099a301d49ba55a67476c670c49ca511 100644
--- a/third_party/mojo/src/mojo/public/cpp/bindings/lib/map_serialization.h
+++ b/third_party/mojo/src/mojo/public/cpp/bindings/lib/map_serialization.h
@@ -27,11 +27,13 @@ namespace internal {
template <typename MapType,
typename DataType,
- bool kValueIsMoveOnlyType = IsMoveOnlyType<MapType>::value>
+ bool value_is_move_only_type = IsMoveOnlyType<MapType>::value,
+ bool is_union =
+ IsUnionDataType<typename RemovePointer<DataType>::type>::value>
struct MapSerializer;
template <typename MapType, typename DataType>
-struct MapSerializer<MapType, DataType, false> {
+struct MapSerializer<MapType, DataType, false, false> {
static size_t GetBaseArraySize(size_t count) {
return Align(count * sizeof(DataType));
}
@@ -39,7 +41,7 @@ struct MapSerializer<MapType, DataType, false> {
};
template <>
-struct MapSerializer<bool, bool, false> {
+struct MapSerializer<bool, bool, false, false> {
static size_t GetBaseArraySize(size_t count) {
return Align((count + 7) / 8);
}
@@ -47,7 +49,7 @@ struct MapSerializer<bool, bool, false> {
};
template <typename H>
-struct MapSerializer<ScopedHandleBase<H>, H, true> {
+struct MapSerializer<ScopedHandleBase<H>, H, true, false> {
static size_t GetBaseArraySize(size_t count) {
return Align(count * sizeof(H));
}
@@ -61,7 +63,8 @@ struct MapSerializer<
S,
typename EnableIf<IsPointer<typename WrapperTraits<S>::DataType>::value,
typename WrapperTraits<S>::DataType>::type,
- true> {
+ true,
+ false> {
typedef
typename RemovePointer<typename WrapperTraits<S>::DataType>::type S_Data;
static size_t GetBaseArraySize(size_t count) {
@@ -70,8 +73,18 @@ struct MapSerializer<
static size_t GetItemSize(const S& item) { return GetSerializedSize_(item); }
};
+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);
+ }
+};
+
template <>
-struct MapSerializer<String, String_Data*, false> {
+struct MapSerializer<String, String_Data*, false, false> {
static size_t GetBaseArraySize(size_t count) {
return count * sizeof(StringPointer);
}

Powered by Google App Engine
This is Rietveld 408576698