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

Unified Diff: remoting/protocol/session.h

Issue 10830046: Implement ChannelMultiplexer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
Index: remoting/protocol/session.h
diff --git a/remoting/protocol/session.h b/remoting/protocol/session.h
index 91483187d341faa7cabbb1c5056c4f6ede429fb1..91861e61c429b16e9e958a7c1c95bba259fb51ec 100644
--- a/remoting/protocol/session.h
+++ b/remoting/protocol/session.h
@@ -7,16 +7,12 @@
#include <string>
-#include "base/callback.h"
-#include "base/threading/non_thread_safe.h"
-#include "remoting/protocol/buffered_socket_writer.h"
+#include "remoting/protocol/channel_factory.h"
#include "remoting/protocol/errors.h"
#include "remoting/protocol/session_config.h"
namespace net {
class IPEndPoint;
-class Socket;
-class StreamSocket;
} // namespace net
namespace remoting {
@@ -27,7 +23,7 @@ struct TransportRoute;
// Generic interface for Chromotocol connection used by both client and host.
// Provides access to the connection channels, but doesn't depend on the
// protocol used for each channel.
-class Session : public base::NonThreadSafe {
+class Session : public ChannelFactory {
public:
enum State {
// Created, but not connecting yet.
@@ -74,12 +70,6 @@ class Session : public base::NonThreadSafe {
bool ready) {}
};
- // TODO(sergeyu): Specify connection error code when channel
- // connection fails.
- typedef base::Callback<void(scoped_ptr<net::StreamSocket>)>
- StreamChannelCallback;
- typedef base::Callback<void(scoped_ptr<net::Socket>)>
- DatagramChannelCallback;
Session() {}
virtual ~Session() {}
@@ -91,17 +81,6 @@ class Session : public base::NonThreadSafe {
// Returns error code for a failed session.
virtual ErrorCode error() = 0;
- // Creates new channels for this connection. The specified callback
- // is called when then new channel is created and connected. The
- // callback is called with NULL if connection failed for any reason.
- // All channels must be destroyed before the session is
- // destroyed. Can be called only when in CONNECTING, CONNECTED or
- // AUTHENTICATED states.
- virtual void CreateStreamChannel(
- const std::string& name, const StreamChannelCallback& callback) = 0;
- virtual void CreateDatagramChannel(
- const std::string& name, const DatagramChannelCallback& callback) = 0;
-
// Cancels a pending CreateStreamChannel() or CreateDatagramChannel()
// operation for the named channel. If the channel creation already
// completed then cancelling it has no effect. When shutting down

Powered by Google App Engine
This is Rietveld 408576698