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 "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "remoting/base/buffered_socket_writer.h" | 10 #include "remoting/base/buffered_socket_writer.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 MuxChannel* GetOrCreateChannel(const std::string& name); | 46 MuxChannel* GetOrCreateChannel(const std::string& name); |
47 | 47 |
48 // Error handling callback for |reader_| and |writer_|. | 48 // Error handling callback for |reader_| and |writer_|. |
49 void OnBaseChannelError(int error); | 49 void OnBaseChannelError(int error); |
50 | 50 |
51 // Propagates base channel error to channel |name|, queued asynchronously by | 51 // Propagates base channel error to channel |name|, queued asynchronously by |
52 // OnBaseChannelError(). | 52 // OnBaseChannelError(). |
53 void NotifyBaseChannelError(const std::string& name, int error); | 53 void NotifyBaseChannelError(const std::string& name, int error); |
54 | 54 |
55 // Callback for |reader_; | 55 // Callback for |reader_; |
56 void OnIncomingPacket(scoped_ptr<MultiplexPacket> packet, | 56 void OnIncomingPacket(scoped_ptr<MultiplexPacket> packet); |
57 const base::Closure& done_task); | |
58 | 57 |
59 // Called by MuxChannel. | 58 // Called by MuxChannel. |
60 void DoWrite(scoped_ptr<MultiplexPacket> packet, | 59 void DoWrite(scoped_ptr<MultiplexPacket> packet, |
61 const base::Closure& done_task); | 60 const base::Closure& done_task); |
62 | 61 |
63 // Factory used to create |base_channel_|. Set to nullptr once creation is | 62 // Factory used to create |base_channel_|. Set to nullptr once creation is |
64 // finished or failed. | 63 // finished or failed. |
65 StreamChannelFactory* base_channel_factory_; | 64 StreamChannelFactory* base_channel_factory_; |
66 | 65 |
67 // Name of the underlying channel. | 66 // Name of the underlying channel. |
(...skipping 19 matching lines...) Expand all Loading... |
87 base::WeakPtrFactory<ChannelMultiplexer> weak_factory_; | 86 base::WeakPtrFactory<ChannelMultiplexer> weak_factory_; |
88 | 87 |
89 DISALLOW_COPY_AND_ASSIGN(ChannelMultiplexer); | 88 DISALLOW_COPY_AND_ASSIGN(ChannelMultiplexer); |
90 }; | 89 }; |
91 | 90 |
92 } // namespace protocol | 91 } // namespace protocol |
93 } // namespace remoting | 92 } // namespace remoting |
94 | 93 |
95 | 94 |
96 #endif // REMOTING_PROTOCOL_CHANNEL_MULTIPLEXER_H_ | 95 #endif // REMOTING_PROTOCOL_CHANNEL_MULTIPLEXER_H_ |
OLD | NEW |