| 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_LIB_SCOPED_INTERFACE_ENDPOINT_HANDLE_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_SCOPED_INTERFACE_ENDPOINT_HANDLE_H_ |
| 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_SCOPED_INTERFACE_ENDPOINT_HANDLE_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_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 "base/move.h" |
| 11 #include "mojo/public/cpp/bindings/lib/interface_id.h" | 11 #include "mojo/public/cpp/bindings/lib/interface_id.h" |
| 12 | 12 |
| 13 namespace mojo { | 13 namespace mojo { |
| 14 namespace internal { | 14 namespace internal { |
| 15 | 15 |
| 16 class MultiplexRouter; | 16 class MultiplexRouter; |
| 17 | 17 |
| 18 // ScopedInterfaceEndpointHandle refers to one end of an interface, either the | 18 // ScopedInterfaceEndpointHandle refers to one end of an interface, either the |
| 19 // implementation side or the client side. | 19 // implementation side or the client side. |
| 20 class ScopedInterfaceEndpointHandle { | 20 class ScopedInterfaceEndpointHandle { |
| 21 MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03( | 21 DISALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND(ScopedInterfaceEndpointHandle); |
| 22 ScopedInterfaceEndpointHandle); | |
| 23 | 22 |
| 24 public: | 23 public: |
| 25 // Creates an invalid endpoint handle. | 24 // Creates an invalid endpoint handle. |
| 26 ScopedInterfaceEndpointHandle(); | 25 ScopedInterfaceEndpointHandle(); |
| 27 | 26 |
| 28 // This is supposed to be used by MultiplexRouter only. | 27 // This is supposed to be used by MultiplexRouter only. |
| 29 // |id| is the corresponding interface ID. | 28 // |id| is the corresponding interface ID. |
| 30 // If |is_local| is false, this handle is meant to be passed over |router| to | 29 // If |is_local| is false, this handle is meant to be passed over |router| to |
| 31 // the remote side. | 30 // the remote side. |
| 32 ScopedInterfaceEndpointHandle(InterfaceId id, | 31 ScopedInterfaceEndpointHandle(InterfaceId id, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 55 private: | 54 private: |
| 56 InterfaceId id_; | 55 InterfaceId id_; |
| 57 bool is_local_; | 56 bool is_local_; |
| 58 scoped_refptr<MultiplexRouter> router_; | 57 scoped_refptr<MultiplexRouter> router_; |
| 59 }; | 58 }; |
| 60 | 59 |
| 61 } // namespace internal | 60 } // namespace internal |
| 62 } // namespace mojo | 61 } // namespace mojo |
| 63 | 62 |
| 64 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_SCOPED_INTERFACE_ENDPOINT_HANDLE_H_ | 63 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_SCOPED_INTERFACE_ENDPOINT_HANDLE_H_ |
| OLD | NEW |