OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 REMOTING_PROTOCOL_CHANNEL_MULTIPLEXER_H_ | 5 #ifndef REMOTING_PROTOCOL_CHANNEL_MULTIPLEXER_H_ |
6 #define REMOTING_PROTOCOL_CHANNEL_MULTIPLEXER_H_ | 6 #define REMOTING_PROTOCOL_CHANNEL_MULTIPLEXER_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
10 #include "remoting/base/buffered_socket_writer.h" | 12 #include "remoting/base/buffered_socket_writer.h" |
11 #include "remoting/proto/mux.pb.h" | 13 #include "remoting/proto/mux.pb.h" |
12 #include "remoting/protocol/message_reader.h" | 14 #include "remoting/protocol/message_reader.h" |
13 #include "remoting/protocol/stream_channel_factory.h" | 15 #include "remoting/protocol/stream_channel_factory.h" |
14 | 16 |
15 namespace remoting { | 17 namespace remoting { |
16 namespace protocol { | 18 namespace protocol { |
17 | 19 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // Name of the underlying channel. | 67 // Name of the underlying channel. |
66 std::string base_channel_name_; | 68 std::string base_channel_name_; |
67 | 69 |
68 // The channel over which to multiplex. | 70 // The channel over which to multiplex. |
69 std::unique_ptr<P2PStreamSocket> base_channel_; | 71 std::unique_ptr<P2PStreamSocket> base_channel_; |
70 | 72 |
71 // List of requested channels while we are waiting for |base_channel_|. | 73 // List of requested channels while we are waiting for |base_channel_|. |
72 std::list<PendingChannel> pending_channels_; | 74 std::list<PendingChannel> pending_channels_; |
73 | 75 |
74 int next_channel_id_; | 76 int next_channel_id_; |
75 std::map<std::string, MuxChannel*> channels_; | 77 std::map<std::string, std::unique_ptr<MuxChannel>> channels_; |
76 | 78 |
77 // Channels are added to |channels_by_receive_id_| only after we receive | 79 // Channels are added to |channels_by_receive_id_| only after we receive |
78 // receive_id from the remote peer. | 80 // receive_id from the remote peer. |
79 std::map<int, MuxChannel*> channels_by_receive_id_; | 81 std::map<int, MuxChannel*> channels_by_receive_id_; |
80 | 82 |
81 BufferedSocketWriter writer_; | 83 BufferedSocketWriter writer_; |
82 MessageReader reader_; | 84 MessageReader reader_; |
83 | 85 |
84 base::WeakPtrFactory<ChannelMultiplexer> weak_factory_; | 86 base::WeakPtrFactory<ChannelMultiplexer> weak_factory_; |
85 | 87 |
86 DISALLOW_COPY_AND_ASSIGN(ChannelMultiplexer); | 88 DISALLOW_COPY_AND_ASSIGN(ChannelMultiplexer); |
87 }; | 89 }; |
88 | 90 |
89 } // namespace protocol | 91 } // namespace protocol |
90 } // namespace remoting | 92 } // namespace remoting |
91 | 93 |
92 | 94 |
93 #endif // REMOTING_PROTOCOL_CHANNEL_MULTIPLEXER_H_ | 95 #endif // REMOTING_PROTOCOL_CHANNEL_MULTIPLEXER_H_ |
OLD | NEW |