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

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

Issue 1475813002: Mojo C++ bindings: support passing associated interface pointers/requests in method parameter lists… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@25_use_multiplex_router
Patch Set: Created 5 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_SERIALIZATION_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_SERIALIZATION_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_SERIALIZATION_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_SERIALIZATION_H_
7 7
8 #include "mojo/public/cpp/bindings/lib/array_internal.h" 8 #include "mojo/public/cpp/bindings/lib/array_internal.h"
9 #include "mojo/public/cpp/bindings/lib/map_data_internal.h" 9 #include "mojo/public/cpp/bindings/lib/map_data_internal.h"
10 #include "mojo/public/cpp/bindings/lib/map_internal.h" 10 #include "mojo/public/cpp/bindings/lib/map_internal.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } else { 156 } else {
157 *output = nullptr; 157 *output = nullptr;
158 } 158 }
159 } 159 }
160 160
161 template <typename MapKey, 161 template <typename MapKey,
162 typename MapValue, 162 typename MapValue,
163 typename DataKey, 163 typename DataKey,
164 typename DataValue> 164 typename DataValue>
165 inline void Deserialize_(internal::Map_Data<DataKey, DataValue>* input, 165 inline void Deserialize_(internal::Map_Data<DataKey, DataValue>* input,
166 Map<MapKey, MapValue>* output) { 166 Map<MapKey, MapValue>* output,
167 internal::SerializationContext* context) {
167 if (input) { 168 if (input) {
168 Array<MapKey> keys; 169 Array<MapKey> keys;
169 Array<MapValue> values; 170 Array<MapValue> values;
170 171
171 Deserialize_(input->keys.ptr, &keys); 172 Deserialize_(input->keys.ptr, &keys, context);
172 Deserialize_(input->values.ptr, &values); 173 Deserialize_(input->values.ptr, &values, context);
173 174
174 *output = Map<MapKey, MapValue>(keys.Pass(), values.Pass()); 175 *output = Map<MapKey, MapValue>(keys.Pass(), values.Pass());
175 } else { 176 } else {
176 output->reset(); 177 output->reset();
177 } 178 }
178 } 179 }
179 180
180 } // namespace mojo 181 } // namespace mojo
181 182
182 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_SERIALIZATION_H_ 183 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_SERIALIZATION_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/interface_ptr_state.h ('k') | mojo/public/cpp/bindings/lib/pipe_control_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698