| 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_MULTIPLEX_ROUTER_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_MULTIPLEX_ROUTER_H_ |
| 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_MULTIPLEX_ROUTER_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_MULTIPLEX_ROUTER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // In testing mode, the object doesn't disconnect the underlying message pipe | 131 // In testing mode, the object doesn't disconnect the underlying message pipe |
| 132 // when it receives unexpected or invalid messages. | 132 // when it receives unexpected or invalid messages. |
| 133 void EnableTestingMode(); | 133 void EnableTestingMode(); |
| 134 | 134 |
| 135 // Is the router bound to a message pipe handle? | 135 // Is the router bound to a message pipe handle? |
| 136 bool is_valid() const { | 136 bool is_valid() const { |
| 137 DCHECK(thread_checker_.CalledOnValidThread()); | 137 DCHECK(thread_checker_.CalledOnValidThread()); |
| 138 return connector_.is_valid(); | 138 return connector_.is_valid(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 // TODO(yzshen): consider removing this getter. |
| 142 MessagePipeHandle handle() const { |
| 143 DCHECK(thread_checker_.CalledOnValidThread()); |
| 144 return connector_.handle(); |
| 145 } |
| 146 |
| 141 private: | 147 private: |
| 142 friend class base::RefCountedDeleteOnMessageLoop<MultiplexRouter>; | 148 friend class base::RefCountedDeleteOnMessageLoop<MultiplexRouter>; |
| 143 friend class base::DeleteHelper<MultiplexRouter>; | 149 friend class base::DeleteHelper<MultiplexRouter>; |
| 144 | 150 |
| 145 class InterfaceEndpoint; | 151 class InterfaceEndpoint; |
| 146 struct Task; | 152 struct Task; |
| 147 | 153 |
| 148 ~MultiplexRouter() override; | 154 ~MultiplexRouter() override; |
| 149 | 155 |
| 150 // MessageReceiver implementation: | 156 // MessageReceiver implementation: |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 | 211 |
| 206 bool testing_mode_; | 212 bool testing_mode_; |
| 207 | 213 |
| 208 DISALLOW_COPY_AND_ASSIGN(MultiplexRouter); | 214 DISALLOW_COPY_AND_ASSIGN(MultiplexRouter); |
| 209 }; | 215 }; |
| 210 | 216 |
| 211 } // namespace internal | 217 } // namespace internal |
| 212 } // namespace mojo | 218 } // namespace mojo |
| 213 | 219 |
| 214 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MULTIPLEX_ROUTER_H_ | 220 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MULTIPLEX_ROUTER_H_ |
| OLD | NEW |