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

Unified Diff: remoting/protocol/channel_dispatcher_base.h

Issue 1662673002: Add MessageChanneFactory interface and use it in ChannelDispatcherBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@framing
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 | « no previous file | 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 2e940c664498e7bc1cb20de8e5629898519f0aba..0a1e29cfbc2833bda73196b33dc63478c3771a94 100644
--- a/remoting/protocol/channel_dispatcher_base.h
+++ b/remoting/protocol/channel_dispatcher_base.h
@@ -10,7 +10,6 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
-#include "remoting/base/buffered_socket_writer.h"
#include "remoting/protocol/errors.h"
namespace remoting {
@@ -19,9 +18,8 @@ class CompoundBuffer;
namespace protocol {
+class MessageChannelFactory;
class MessagePipe;
-class P2PStreamSocket;
-class StreamChannelFactory;
// Base class for channel message dispatchers. It's responsible for
// creating the named channel. Derived dispatchers then dispatch
@@ -36,8 +34,6 @@ class ChannelDispatcherBase {
virtual void OnChannelInitialized(
ChannelDispatcherBase* channel_dispatcher) = 0;
- virtual void OnChannelError(ChannelDispatcherBase* channel_dispatcher,
- ErrorCode error) = 0;
};
// The callback is called when initialization is finished. The
@@ -48,7 +44,8 @@ class ChannelDispatcherBase {
// Creates and connects the channel in the specified
// |session|. Caller retains ownership of the Session.
- void Init(StreamChannelFactory* channel_factory, EventHandler* event_handler);
+ void Init(MessageChannelFactory* channel_factory,
+ EventHandler* event_handler);
const std::string& channel_name() { return channel_name_; }
@@ -64,12 +61,12 @@ class ChannelDispatcherBase {
virtual void OnIncomingMessage(scoped_ptr<CompoundBuffer> message) = 0;
private:
- void OnChannelReady(scoped_ptr<P2PStreamSocket> socket);
+ void OnChannelReady(scoped_ptr<MessagePipe> message_pipe);
void OnPipeError(int error);
std::string channel_name_;
- StreamChannelFactory* channel_factory_;
- EventHandler* event_handler_;
+ MessageChannelFactory* channel_factory_ = nullptr;
+ EventHandler* event_handler_ = nullptr;
scoped_ptr<MessagePipe> message_pipe_;
« no previous file with comments | « no previous file | remoting/protocol/channel_dispatcher_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698