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

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

Issue 486313004: Mojo cpp bindings: More clear checks for array num_bytes and num_elements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
« no previous file with comments | « mojo/public/cpp/bindings/lib/array_internal.h ('k') | mojo/public/cpp/bindings/lib/string_serialization.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 df53cd0db3b9ad6034bf9da34a0701dfc40e8a68..492de788b4530f4997101b8772cd864958e1845b 100644
--- a/mojo/public/cpp/bindings/lib/array_serialization.h
+++ b/mojo/public/cpp/bindings/lib/array_serialization.h
@@ -227,10 +227,12 @@ inline void SerializeArray_(Array<E> input, internal::Buffer* buf,
internal::Array_Data<F>* result =
internal::Array_Data<F>::New(input.size(), buf);
- internal::ArraySerializer<E, F>::template SerializeElements<
- ValidateParams::element_is_nullable,
- typename ValidateParams::ElementValidateParams>(
- internal::Forward(input), buf, result);
+ if (result) {
+ internal::ArraySerializer<E, F>::template SerializeElements<
+ ValidateParams::element_is_nullable,
+ typename ValidateParams::ElementValidateParams>(
+ internal::Forward(input), buf, result);
+ }
*output = result;
} else {
*output = NULL;
« no previous file with comments | « mojo/public/cpp/bindings/lib/array_internal.h ('k') | mojo/public/cpp/bindings/lib/string_serialization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698