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

Side by Side Diff: mojo/public/cpp/bindings/lib/map_serialization_forward.h

Issue 1387993002: mojo::Serialize*_() calls now propogate/return validation errors. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Cleaned up how serialization errors propagate, and addressed other comments from viettrungluu@ Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Headers such as array_serialization.h can include this file to avoid circular 5 // Headers such as array_serialization.h can include this file to avoid circular
6 // dependencies on map_serialization.h. 6 // dependencies on map_serialization.h.
7 7
8 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_SERIALIZATION_FORWARD_H_ 8 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_SERIALIZATION_FORWARD_H_
9 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_SERIALIZATION_FORWARD_H_ 9 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_SERIALIZATION_FORWARD_H_
10 10
11 namespace mojo { 11 namespace mojo {
12 namespace internal { 12 namespace internal {
13 13
14 class ArrayValidateParams; 14 class ArrayValidateParams;
15 class Buffer; 15 class Buffer;
16 16
17 template <typename Key, typename Value> 17 template <typename Key, typename Value>
18 class Map_Data; 18 class Map_Data;
19 19
20 } // namespace internal 20 } // namespace internal
21 21
22 template <typename Key, typename Value> 22 template <typename Key, typename Value>
23 class Map; 23 class Map;
24 24
25 template <typename MapKey, 25 template <typename MapKey,
26 typename MapValue, 26 typename MapValue,
27 typename DataKey, 27 typename DataKey,
28 typename DataValue> 28 typename DataValue>
29 void SerializeMap_(Map<MapKey, MapValue>* input, 29 internal::ValidationError SerializeMap_(
30 internal::Buffer* buf, 30 Map<MapKey, MapValue>* input,
31 internal::Map_Data<DataKey, DataValue>** output, 31 internal::Buffer* buf,
32 const internal::ArrayValidateParams* value_validate_params); 32 internal::Map_Data<DataKey, DataValue>** output,
33 const internal::ArrayValidateParams* value_validate_params);
33 template <typename MapKey, typename MapValue> 34 template <typename MapKey, typename MapValue>
34 size_t GetSerializedSize_(const Map<MapKey, MapValue>& input); 35 size_t GetSerializedSize_(const Map<MapKey, MapValue>& input);
35 36
36 template <typename MapKey, 37 template <typename MapKey,
37 typename MapValue, 38 typename MapValue,
38 typename DataKey, 39 typename DataKey,
39 typename DataValue> 40 typename DataValue>
40 void Deserialize_(internal::Map_Data<DataKey, DataValue>* input, 41 void Deserialize_(internal::Map_Data<DataKey, DataValue>* input,
41 Map<MapKey, MapValue>* output); 42 Map<MapKey, MapValue>* output);
42 43
43 } // namespace mojo 44 } // namespace mojo
44 45
45 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_SERIALIZATION_FORWARD_H_ 46 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_SERIALIZATION_FORWARD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698