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

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

Issue 1751563002: Mojo C++ bindings: support mapping mojo string to WTF::String. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync & rebase Created 4 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_BINDINGS_SERIALIZATION_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_SERIALIZATION_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_SERIALIZATION_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_SERIALIZATION_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 inline void AssociatedInterfaceDataToPtrInfo( 105 inline void AssociatedInterfaceDataToPtrInfo(
106 AssociatedInterface_Data* input, 106 AssociatedInterface_Data* input,
107 AssociatedInterfacePtrInfo<T>* output, 107 AssociatedInterfacePtrInfo<T>* output,
108 MultiplexRouter* router) { 108 MultiplexRouter* router) {
109 AssociatedInterfacePtrInfoHelper::SetHandle( 109 AssociatedInterfacePtrInfoHelper::SetHandle(
110 output, 110 output,
111 router->CreateLocalEndpointHandle(FetchAndReset(&input->interface_id))); 111 router->CreateLocalEndpointHandle(FetchAndReset(&input->interface_id)));
112 output->set_version(input->version); 112 output->set_version(input->version);
113 } 113 }
114 114
115 class WTFStringContext {
116 public:
117 virtual ~WTFStringContext() {}
118 };
119
115 // Context information for serialization/deserialization routines. 120 // Context information for serialization/deserialization routines.
116 struct SerializationContext { 121 struct SerializationContext {
117 SerializationContext(); 122 SerializationContext();
118 explicit SerializationContext(scoped_refptr<MultiplexRouter> in_router); 123 explicit SerializationContext(scoped_refptr<MultiplexRouter> in_router);
119 124
120 ~SerializationContext(); 125 ~SerializationContext();
121 126
122 // Used to serialize/deserialize associated interface pointers and requests. 127 // Used to serialize/deserialize associated interface pointers and requests.
123 scoped_refptr<MultiplexRouter> router; 128 scoped_refptr<MultiplexRouter> router;
129
130 scoped_ptr<WTFStringContext> wtf_string_context;
124 }; 131 };
125 132
126 } // namespace internal 133 } // namespace internal
127 } // namespace mojo 134 } // namespace mojo
128 135
129 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_SERIALIZATION_H_ 136 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_SERIALIZATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698