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

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

Issue 2165233003: Mojo C++ bindings: provide data view for all object types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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 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_STRING_SERIALIZATION_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_STRING_SERIALIZATION_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_STRING_SERIALIZATION_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_STRING_SERIALIZATION_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <string.h> 9 #include <string.h>
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 *output = result; 53 *output = result;
54 54
55 CustomContextHelper<Traits>::TearDown(input, custom_context); 55 CustomContextHelper<Traits>::TearDown(input, custom_context);
56 } 56 }
57 57
58 static bool Deserialize(String_Data* input, 58 static bool Deserialize(String_Data* input,
59 UserType* output, 59 UserType* output,
60 SerializationContext* context) { 60 SerializationContext* context) {
61 if (!input) 61 if (!input)
62 return CallSetToNullIfExists<Traits>(output); 62 return CallSetToNullIfExists<Traits>(output);
63 return Traits::Read(StringDataView(input), output); 63 return Traits::Read(StringDataView(input, context), output);
64 } 64 }
65 }; 65 };
66 66
67 } // namespace internal 67 } // namespace internal
68 } // namespace mojo 68 } // namespace mojo
69 69
70 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_STRING_SERIALIZATION_H_ 70 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_STRING_SERIALIZATION_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/bindings_internal.h ('k') | mojo/public/cpp/bindings/map_data_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698