OLD | NEW |
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_BINDING_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_BINDING_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_BINDING_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_BINDING_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 // Closes the message pipe that was previously bound. Put this object into a | 202 // Closes the message pipe that was previously bound. Put this object into a |
203 // state where it can be rebound to a new pipe. | 203 // state where it can be rebound to a new pipe. |
204 void Close() { internal_state_.Close(); } | 204 void Close() { internal_state_.Close(); } |
205 | 205 |
206 // Similar to the method above, but also specifies a disconnect reason. | 206 // Similar to the method above, but also specifies a disconnect reason. |
207 void CloseWithReason(uint32_t custom_reason, const std::string& description) { | 207 void CloseWithReason(uint32_t custom_reason, const std::string& description) { |
208 internal_state_.CloseWithReason(custom_reason, description); | 208 internal_state_.CloseWithReason(custom_reason, description); |
209 } | 209 } |
210 | 210 |
| 211 void EnableNestedDispatch(bool enabled) { |
| 212 internal_state_.EnableNestedDispatch(enabled); |
| 213 } |
| 214 |
211 // Unbinds the underlying pipe from this binding and returns it so it can be | 215 // Unbinds the underlying pipe from this binding and returns it so it can be |
212 // used in another context, such as on another thread or with a different | 216 // used in another context, such as on another thread or with a different |
213 // implementation. Put this object into a state where it can be rebound to a | 217 // implementation. Put this object into a state where it can be rebound to a |
214 // new pipe. | 218 // new pipe. |
215 // | 219 // |
216 // This method may only be called if the object has been bound to a message | 220 // This method may only be called if the object has been bound to a message |
217 // pipe and there are no associated interfaces running. | 221 // pipe and there are no associated interfaces running. |
218 // | 222 // |
219 // TODO(yzshen): For now, users need to make sure there is no one holding | 223 // TODO(yzshen): For now, users need to make sure there is no one holding |
220 // on to associated interface endpoint handles at both sides of the | 224 // on to associated interface endpoint handles at both sides of the |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 | 271 |
268 private: | 272 private: |
269 internal::BindingState<Interface, ImplRefTraits> internal_state_; | 273 internal::BindingState<Interface, ImplRefTraits> internal_state_; |
270 | 274 |
271 DISALLOW_COPY_AND_ASSIGN(Binding); | 275 DISALLOW_COPY_AND_ASSIGN(Binding); |
272 }; | 276 }; |
273 | 277 |
274 } // namespace mojo | 278 } // namespace mojo |
275 | 279 |
276 #endif // MOJO_PUBLIC_CPP_BINDINGS_BINDING_H_ | 280 #endif // MOJO_PUBLIC_CPP_BINDINGS_BINDING_H_ |
OLD | NEW |