Chromium Code Reviews| 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 "mojo/public/c/environment/async_waiter.h" | 8 #include "mojo/public/c/environment/async_waiter.h" |
| 9 #include "mojo/public/cpp/bindings/error_handler.h" | 9 #include "mojo/public/cpp/bindings/error_handler.h" |
| 10 #include "mojo/public/cpp/bindings/interface_ptr.h" | 10 #include "mojo/public/cpp/bindings/interface_ptr.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 } | 162 } |
| 163 | 163 |
| 164 // Unbinds the underlying pipe from this binding and returns it so it can be | 164 // Unbinds the underlying pipe from this binding and returns it so it can be |
| 165 // used in another context, such as on another thread or with a different | 165 // used in another context, such as on another thread or with a different |
| 166 // implementation. Put this object into a state where it can be rebound to a | 166 // implementation. Put this object into a state where it can be rebound to a |
| 167 // new pipe. | 167 // new pipe. |
| 168 InterfaceRequest<Interface> Unbind() { | 168 InterfaceRequest<Interface> Unbind() { |
| 169 InterfaceRequest<Interface> request = | 169 InterfaceRequest<Interface> request = |
| 170 MakeRequest<Interface>(internal_router_->PassMessagePipe()); | 170 MakeRequest<Interface>(internal_router_->PassMessagePipe()); |
| 171 DestroyRouter(); | 171 DestroyRouter(); |
| 172 return request; | 172 return request.Pass(); |
|
viettrungluu
2015/03/04 02:17:57
Could you please add a TODO with something like "T
Ken Rockot(use gerrit already)
2015/03/04 03:02:13
Done.
| |
| 173 } | 173 } |
| 174 | 174 |
| 175 // Sets an error handler that will be called if a connection error occurs on | 175 // Sets an error handler that will be called if a connection error occurs on |
| 176 // the bound message pipe. | 176 // the bound message pipe. |
| 177 void set_error_handler(ErrorHandler* error_handler) { | 177 void set_error_handler(ErrorHandler* error_handler) { |
| 178 error_handler_ = error_handler; | 178 error_handler_ = error_handler; |
| 179 } | 179 } |
| 180 | 180 |
| 181 // Implements the |Binding|'s response to a connection error. | 181 // Implements the |Binding|'s response to a connection error. |
| 182 void OnConnectionError() override { | 182 void OnConnectionError() override { |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 206 typename Interface::Stub_ stub_; | 206 typename Interface::Stub_ stub_; |
| 207 Interface* impl_; | 207 Interface* impl_; |
| 208 ErrorHandler* error_handler_ = nullptr; | 208 ErrorHandler* error_handler_ = nullptr; |
| 209 | 209 |
| 210 MOJO_DISALLOW_COPY_AND_ASSIGN(Binding); | 210 MOJO_DISALLOW_COPY_AND_ASSIGN(Binding); |
| 211 }; | 211 }; |
| 212 | 212 |
| 213 } // namespace mojo | 213 } // namespace mojo |
| 214 | 214 |
| 215 #endif // MOJO_PUBLIC_CPP_BINDINGS_BINDING_H_ | 215 #endif // MOJO_PUBLIC_CPP_BINDINGS_BINDING_H_ |
| OLD | NEW |