| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 Bind(ptr, waiter); | 56 Bind(ptr, waiter); |
| 57 } | 57 } |
| 58 | 58 |
| 59 Binding(Interface* impl, | 59 Binding(Interface* impl, |
| 60 InterfaceRequest<Interface> request, | 60 InterfaceRequest<Interface> request, |
| 61 const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) | 61 const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) |
| 62 : Binding(impl) { | 62 : Binding(impl) { |
| 63 Bind(request.PassMessagePipe(), waiter); | 63 Bind(request.PassMessagePipe(), waiter); |
| 64 } | 64 } |
| 65 | 65 |
| 66 virtual ~Binding() { | 66 ~Binding() override { |
| 67 delete proxy_; | 67 delete proxy_; |
| 68 if (internal_router_) { | 68 if (internal_router_) { |
| 69 internal_router_->set_error_handler(nullptr); | 69 internal_router_->set_error_handler(nullptr); |
| 70 delete internal_router_; | 70 delete internal_router_; |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 void Bind( | 74 void Bind( |
| 75 ScopedMessagePipeHandle handle, | 75 ScopedMessagePipeHandle handle, |
| 76 const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) { | 76 const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 typename Interface::Stub_ stub_; | 127 typename Interface::Stub_ stub_; |
| 128 Interface* impl_; | 128 Interface* impl_; |
| 129 ErrorHandler* error_handler_ = nullptr; | 129 ErrorHandler* error_handler_ = nullptr; |
| 130 | 130 |
| 131 MOJO_DISALLOW_COPY_AND_ASSIGN(Binding); | 131 MOJO_DISALLOW_COPY_AND_ASSIGN(Binding); |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 } // namespace mojo | 134 } // namespace mojo |
| 135 | 135 |
| 136 #endif // MOJO_PUBLIC_CPP_BINDINGS_BINDING_H_ | 136 #endif // MOJO_PUBLIC_CPP_BINDINGS_BINDING_H_ |
| OLD | NEW |