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

Unified Diff: remoting/protocol/channel_dispatcher_base.h

Issue 1649063003: Add MessagePipe interface. Use it in ChannelDispatcherBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simple_parser
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/audio_writer.cc ('k') | remoting/protocol/channel_dispatcher_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/channel_dispatcher_base.h
diff --git a/remoting/protocol/channel_dispatcher_base.h b/remoting/protocol/channel_dispatcher_base.h
index eca2d12d9892e4962e7b059cf857ddcf2481479c..2e940c664498e7bc1cb20de8e5629898519f0aba 100644
--- a/remoting/protocol/channel_dispatcher_base.h
+++ b/remoting/protocol/channel_dispatcher_base.h
@@ -12,11 +12,15 @@
#include "base/memory/scoped_ptr.h"
#include "remoting/base/buffered_socket_writer.h"
#include "remoting/protocol/errors.h"
-#include "remoting/protocol/message_reader.h"
namespace remoting {
+
+class CompoundBuffer;
+
namespace protocol {
+class MessagePipe;
+class P2PStreamSocket;
class StreamChannelFactory;
// Base class for channel message dispatchers. It's responsible for
@@ -49,27 +53,25 @@ 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; }
protected:
explicit ChannelDispatcherBase(const char* channel_name);
- BufferedSocketWriter* writer() { return &writer_; }
+ MessagePipe* message_pipe() { return message_pipe_.get(); }
// Child classes must override this method to handle incoming messages.
virtual void OnIncomingMessage(scoped_ptr<CompoundBuffer> message) = 0;
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_;
+ scoped_ptr<MessagePipe> message_pipe_;
DISALLOW_COPY_AND_ASSIGN(ChannelDispatcherBase);
};
« no previous file with comments | « remoting/protocol/audio_writer.cc ('k') | remoting/protocol/channel_dispatcher_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698