Index: remoting/protocol/channel_dispatcher_base.h |
diff --git a/remoting/protocol/channel_dispatcher_base.h b/remoting/protocol/channel_dispatcher_base.h |
index c8eedebfa9901f61584dadc068f31ed25f0715d2..c09f97e9043e379e694f346ad96b153d6b356fad 100644 |
--- a/remoting/protocol/channel_dispatcher_base.h |
+++ b/remoting/protocol/channel_dispatcher_base.h |
@@ -12,7 +12,7 @@ |
#include "base/memory/scoped_ptr.h" |
#include "remoting/base/buffered_socket_writer.h" |
#include "remoting/protocol/errors.h" |
-#include "remoting/protocol/message_reader.h" |
+#include "remoting/protocol/stream_message_pipe_adapter.h" |
namespace remoting { |
namespace protocol { |
@@ -49,27 +49,24 @@ class ChannelDispatcherBase { |
const std::string& channel_name() { return channel_name_; } |
// Returns true if the channel is currently connected. |
- bool is_connected() { return channel_ != nullptr; } |
+ bool is_connected() { return message_pipe() != nullptr; } |
Jamie
2016/02/01 22:48:20
message_pipe() can never return null with this imp
Sergey Ulanov
2016/02/02 21:16:42
Replaced message_pipe_ with a scoped_ptr.
|
protected: |
explicit ChannelDispatcherBase(const char* channel_name); |
- BufferedSocketWriter* writer() { return &writer_; } |
+ MessagePipe* message_pipe() { return &message_pipe_; } |
- // Should be overridden in child classes to handle incoming messages. |
virtual void OnIncomingMessage(scoped_ptr<CompoundBuffer> message); |
private: |
void OnChannelReady(scoped_ptr<P2PStreamSocket> socket); |
- void OnReadWriteFailed(int error); |
+ void OnPipeError(int error); |
std::string channel_name_; |
StreamChannelFactory* channel_factory_; |
EventHandler* event_handler_; |
- scoped_ptr<P2PStreamSocket> channel_; |
- BufferedSocketWriter writer_; |
- MessageReader reader_; |
+ StreamMessagePipeAdapter message_pipe_; |
DISALLOW_COPY_AND_ASSIGN(ChannelDispatcherBase); |
}; |