OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef REMOTING_PROTOCOL_PSEUDOTCP_CHANNEL_FACTORY_H_ | |
6 #define REMOTING_PROTOCOL_PSEUDOTCP_CHANNEL_FACTORY_H_ | |
7 | |
8 #include <map> | |
9 | |
10 #include "base/basictypes.h" | |
11 #include "remoting/protocol/channel_factory.h" | |
12 | |
13 namespace remoting { | |
14 namespace protocol { | |
15 | |
16 class DatagramChannelFactory; | |
17 | |
18 // ChannelFactory that creates PseudoTCP-based stream channels that run on top | |
19 // of datagram channels created using specified |datagram_channel_factory|. | |
20 class PseudoTcpChannelFactory : public ChannelFactory { | |
21 public: | |
22 explicit PseudoTcpChannelFactory( | |
23 DatagramChannelFactory* datagram_channel_factory); | |
Wez
2014/09/10 02:29:27
nit: Comment on lifetime of this?
Sergey Ulanov
2014/09/10 21:50:59
Done.
| |
24 virtual ~PseudoTcpChannelFactory(); | |
25 | |
26 // ChannelFactory interface. | |
27 virtual void CreateChannel(const std::string& name, | |
28 const ChannelCreatedCallback& callback) OVERRIDE; | |
29 virtual void CancelChannelCreation(const std::string& name) OVERRIDE; | |
30 | |
31 private: | |
32 void OnDatagramChannelCreated(const std::string& name, | |
33 const ChannelCreatedCallback& callback, | |
34 scoped_ptr<net::Socket> socket); | |
35 void OnPseudoTcpConnected(const std::string& name, | |
36 const ChannelCreatedCallback& callback, | |
37 int result); | |
38 | |
39 DatagramChannelFactory* datagram_channel_factory_; | |
40 | |
41 typedef std::map<std::string, net::StreamSocket*> PendingSocketsMap; | |
Wez
2014/09/10 02:29:27
nit: Move this to the top of private section.
Sergey Ulanov
2014/09/10 21:50:59
Done.
| |
42 PendingSocketsMap pending_sockets_; | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(PseudoTcpChannelFactory); | |
45 }; | |
46 | |
47 } // namespace protocol | |
48 } // namespace remoting | |
49 | |
50 #endif // REMOTING_PROTOCOL_PSEUDOTCP_CHANNEL_FACTORY_H_ | |
OLD | NEW |