| 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_EDK_SYSTEM_CHANNEL_MANAGER_H_ | 5 #ifndef MOJO_EDK_SYSTEM_CHANNEL_MANAGER_H_ |
| 6 #define MOJO_EDK_SYSTEM_CHANNEL_MANAGER_H_ | 6 #define MOJO_EDK_SYSTEM_CHANNEL_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 namespace system { | 28 namespace system { |
| 29 | 29 |
| 30 class Channel; | 30 class Channel; |
| 31 class ChannelEndpoint; | 31 class ChannelEndpoint; |
| 32 class ConnectionManager; | 32 class ConnectionManager; |
| 33 class MessagePipeDispatcher; | 33 class MessagePipeDispatcher; |
| 34 | 34 |
| 35 // IDs for |Channel|s managed by a |ChannelManager|. (IDs should be thought of | 35 // IDs for |Channel|s managed by a |ChannelManager|. (IDs should be thought of |
| 36 // as specific to a given |ChannelManager|.) 0 is never a valid ID. | 36 // as specific to a given |ChannelManager|.) 0 is never a valid ID. |
| 37 typedef uint64_t ChannelId; | 37 using ChannelId = uint64_t; |
| 38 | 38 |
| 39 const ChannelId kInvalidChannelId = 0; | 39 const ChannelId kInvalidChannelId = 0; |
| 40 | 40 |
| 41 // This class manages and "owns" |Channel|s (which typically connect to other | 41 // This class manages and "owns" |Channel|s (which typically connect to other |
| 42 // processes) for a given process. This class is thread-safe, except as | 42 // processes) for a given process. This class is thread-safe, except as |
| 43 // specifically noted. | 43 // specifically noted. |
| 44 class MOJO_SYSTEM_IMPL_EXPORT ChannelManager { | 44 class MOJO_SYSTEM_IMPL_EXPORT ChannelManager { |
| 45 public: | 45 public: |
| 46 // |io_thread_task_runner| should be the |TaskRunner| for the I/O thread, on | 46 // |io_thread_task_runner| should be the |TaskRunner| for the I/O thread, on |
| 47 // which this channel manager will create all channels. Connection manager is | 47 // which this channel manager will create all channels. Connection manager is |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // get rid of |ChannelInfo| (and just have ref pointers to |Channel|s). | 155 // get rid of |ChannelInfo| (and just have ref pointers to |Channel|s). |
| 156 base::hash_map<ChannelId, ChannelInfo> channel_infos_; | 156 base::hash_map<ChannelId, ChannelInfo> channel_infos_; |
| 157 | 157 |
| 158 DISALLOW_COPY_AND_ASSIGN(ChannelManager); | 158 DISALLOW_COPY_AND_ASSIGN(ChannelManager); |
| 159 }; | 159 }; |
| 160 | 160 |
| 161 } // namespace system | 161 } // namespace system |
| 162 } // namespace mojo | 162 } // namespace mojo |
| 163 | 163 |
| 164 #endif // MOJO_EDK_SYSTEM_CHANNEL_MANAGER_H_ | 164 #endif // MOJO_EDK_SYSTEM_CHANNEL_MANAGER_H_ |
| OLD | NEW |