| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SCOPED_INTERFACE_ENDPOINT_HANDLE_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_SCOPED_INTERFACE_ENDPOINT_HANDLE_H_ |
| 6 #define MOJO_PUBLIC_CPP_BINDINGS_SCOPED_INTERFACE_ENDPOINT_HANDLE_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_SCOPED_INTERFACE_ENDPOINT_HANDLE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/move.h" |
| 10 #include "mojo/public/cpp/bindings/lib/interface_id.h" | 11 #include "mojo/public/cpp/bindings/lib/interface_id.h" |
| 11 | 12 |
| 12 namespace mojo { | 13 namespace mojo { |
| 13 | 14 |
| 14 namespace internal { | 15 namespace internal { |
| 15 class MultiplexRouter; | 16 class MultiplexRouter; |
| 16 } | 17 } |
| 17 | 18 |
| 18 // ScopedInterfaceEndpointHandle refers to one end of an interface, either the | 19 // ScopedInterfaceEndpointHandle refers to one end of an interface, either the |
| 19 // implementation side or the client side. | 20 // implementation side or the client side. |
| 20 class ScopedInterfaceEndpointHandle { | 21 class ScopedInterfaceEndpointHandle { |
| 22 DISALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND(ScopedInterfaceEndpointHandle); |
| 23 |
| 21 public: | 24 public: |
| 22 // Creates an invalid endpoint handle. | 25 // Creates an invalid endpoint handle. |
| 23 ScopedInterfaceEndpointHandle(); | 26 ScopedInterfaceEndpointHandle(); |
| 24 | 27 |
| 25 ScopedInterfaceEndpointHandle(ScopedInterfaceEndpointHandle&& other); | 28 ScopedInterfaceEndpointHandle(ScopedInterfaceEndpointHandle&& other); |
| 26 | 29 |
| 27 ~ScopedInterfaceEndpointHandle(); | 30 ~ScopedInterfaceEndpointHandle(); |
| 28 | 31 |
| 29 ScopedInterfaceEndpointHandle& operator=( | 32 ScopedInterfaceEndpointHandle& operator=( |
| 30 ScopedInterfaceEndpointHandle&& other); | 33 ScopedInterfaceEndpointHandle&& other); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 53 // If |is_local| is false, this handle is meant to be passed over |router| to | 56 // If |is_local| is false, this handle is meant to be passed over |router| to |
| 54 // the remote side. | 57 // the remote side. |
| 55 ScopedInterfaceEndpointHandle( | 58 ScopedInterfaceEndpointHandle( |
| 56 internal::InterfaceId id, | 59 internal::InterfaceId id, |
| 57 bool is_local, | 60 bool is_local, |
| 58 scoped_refptr<internal::MultiplexRouter> router); | 61 scoped_refptr<internal::MultiplexRouter> router); |
| 59 | 62 |
| 60 internal::InterfaceId id_; | 63 internal::InterfaceId id_; |
| 61 bool is_local_; | 64 bool is_local_; |
| 62 scoped_refptr<internal::MultiplexRouter> router_; | 65 scoped_refptr<internal::MultiplexRouter> router_; |
| 63 | |
| 64 DISALLOW_COPY_AND_ASSIGN(ScopedInterfaceEndpointHandle); | |
| 65 }; | 66 }; |
| 66 | 67 |
| 67 } // namespace mojo | 68 } // namespace mojo |
| 68 | 69 |
| 69 #endif // MOJO_PUBLIC_CPP_BINDINGS_SCOPED_INTERFACE_ENDPOINT_HANDLE_H_ | 70 #endif // MOJO_PUBLIC_CPP_BINDINGS_SCOPED_INTERFACE_ENDPOINT_HANDLE_H_ |
| OLD | NEW |