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

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

Issue 1966933002: Mojo C++ bindings: switch the existing usage of StructTraits to use the new data view interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@26_reader
Patch Set: typeid() is not allowed :/ Created 4 years, 7 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/array_serialization.h
diff --git a/mojo/public/cpp/bindings/lib/array_serialization.h b/mojo/public/cpp/bindings/lib/array_serialization.h
index 7cf2945fbf7e2b1db6ebd6a550a21bb3aa3419d7..3b4033b4fdfa47cb6bd14af92f131f041cfb89e6 100644
--- a/mojo/public/cpp/bindings/lib/array_serialization.h
+++ b/mojo/public/cpp/bindings/lib/array_serialization.h
@@ -390,10 +390,9 @@ struct Serializer<Array<Element>, MaybeConstUserType> {
static bool Deserialize(Data* input,
UserType* output,
SerializationContext* context) {
- if (input)
- return Impl::DeserializeElements(input, output, context);
- Traits::SetToNull(*output);
- return true;
+ if (!input)
+ return CallSetToNullIfExists<Traits>(output);
+ return Impl::DeserializeElements(input, output, context);
}
};

Powered by Google App Engine
This is Rietveld 408576698