Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(989)

Side by Side Diff: remoting/protocol/channel_multiplexer.h

Issue 841773005: Cleanup channel dispatchers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/protocol/channel_dispatcher_base.cc ('k') | remoting/protocol/channel_multiplexer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "remoting/proto/mux.pb.h" 9 #include "remoting/proto/mux.pb.h"
10 #include "remoting/protocol/buffered_socket_writer.h" 10 #include "remoting/protocol/buffered_socket_writer.h"
11 #include "remoting/protocol/message_reader.h" 11 #include "remoting/protocol/message_reader.h"
12 #include "remoting/protocol/protobuf_message_parser.h"
12 #include "remoting/protocol/stream_channel_factory.h" 13 #include "remoting/protocol/stream_channel_factory.h"
13 14
14 namespace remoting { 15 namespace remoting {
15 namespace protocol { 16 namespace protocol {
16 17
17 class ChannelMultiplexer : public StreamChannelFactory { 18 class ChannelMultiplexer : public StreamChannelFactory {
18 public: 19 public:
19 static const char kMuxChannelName[]; 20 static const char kMuxChannelName[];
20 21
21 // |factory| is used to create the channel upon which to multiplex. 22 // |factory| is used to create the channel upon which to multiplex.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 std::list<PendingChannel> pending_channels_; 72 std::list<PendingChannel> pending_channels_;
72 73
73 int next_channel_id_; 74 int next_channel_id_;
74 std::map<std::string, MuxChannel*> channels_; 75 std::map<std::string, MuxChannel*> channels_;
75 76
76 // Channels are added to |channels_by_receive_id_| only after we receive 77 // Channels are added to |channels_by_receive_id_| only after we receive
77 // receive_id from the remote peer. 78 // receive_id from the remote peer.
78 std::map<int, MuxChannel*> channels_by_receive_id_; 79 std::map<int, MuxChannel*> channels_by_receive_id_;
79 80
80 BufferedSocketWriter writer_; 81 BufferedSocketWriter writer_;
81 ProtobufMessageReader<MultiplexPacket> reader_; 82 MessageReader reader_;
83 ProtobufMessageParser<MultiplexPacket> parser_;
82 84
83 base::WeakPtrFactory<ChannelMultiplexer> weak_factory_; 85 base::WeakPtrFactory<ChannelMultiplexer> weak_factory_;
84 86
85 DISALLOW_COPY_AND_ASSIGN(ChannelMultiplexer); 87 DISALLOW_COPY_AND_ASSIGN(ChannelMultiplexer);
86 }; 88 };
87 89
88 } // namespace protocol 90 } // namespace protocol
89 } // namespace remoting 91 } // namespace remoting
90 92
91 93
92 #endif // REMOTING_PROTOCOL_CHANNEL_MULTIPLEXER_H_ 94 #endif // REMOTING_PROTOCOL_CHANNEL_MULTIPLEXER_H_
OLDNEW
« no previous file with comments | « remoting/protocol/channel_dispatcher_base.cc ('k') | remoting/protocol/channel_multiplexer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698