| Index: remoting/protocol/channel_multiplexer.cc
|
| diff --git a/remoting/protocol/channel_multiplexer.cc b/remoting/protocol/channel_multiplexer.cc
|
| index 8cdbf0d60af091469c6acb327211529f2e8f2444..c5cf9c5062cce33865411c9320ccd5d6572550d5 100644
|
| --- a/remoting/protocol/channel_multiplexer.cc
|
| +++ b/remoting/protocol/channel_multiplexer.cc
|
| @@ -14,8 +14,8 @@
|
| #include "base/stl_util.h"
|
| #include "base/thread_task_runner_handle.h"
|
| #include "net/base/net_errors.h"
|
| -#include "net/socket/stream_socket.h"
|
| #include "remoting/protocol/message_serialization.h"
|
| +#include "remoting/protocol/p2p_socket.h"
|
|
|
| namespace remoting {
|
| namespace protocol {
|
| @@ -77,7 +77,7 @@ class ChannelMultiplexer::MuxChannel {
|
| void set_receive_id(int id) { receive_id_ = id; }
|
|
|
| // Called by ChannelMultiplexer.
|
| - scoped_ptr<net::StreamSocket> CreateSocket();
|
| + scoped_ptr<P2PStreamSocket> CreateSocket();
|
| void OnIncomingPacket(scoped_ptr<MultiplexPacket> packet,
|
| const base::Closure& done_task);
|
| void OnBaseChannelError(int error);
|
| @@ -100,7 +100,7 @@ class ChannelMultiplexer::MuxChannel {
|
| DISALLOW_COPY_AND_ASSIGN(MuxChannel);
|
| };
|
|
|
| -class ChannelMultiplexer::MuxSocket : public net::StreamSocket,
|
| +class ChannelMultiplexer::MuxSocket : public P2PStreamSocket,
|
| public base::NonThreadSafe,
|
| public base::SupportsWeakPtr<MuxSocket> {
|
| public:
|
| @@ -111,7 +111,7 @@ class ChannelMultiplexer::MuxSocket : public net::StreamSocket,
|
| void OnBaseChannelError(int error);
|
| void OnPacketReceived();
|
|
|
| - // net::StreamSocket interface.
|
| + // P2PStreamSocket interface.
|
| int Read(net::IOBuffer* buffer,
|
| int buffer_len,
|
| const net::CompletionCallback& callback) override;
|
| @@ -128,50 +128,6 @@ class ChannelMultiplexer::MuxSocket : public net::StreamSocket,
|
| return net::ERR_NOT_IMPLEMENTED;
|
| }
|
|
|
| - int Connect(const net::CompletionCallback& callback) override {
|
| - NOTIMPLEMENTED();
|
| - return net::ERR_NOT_IMPLEMENTED;
|
| - }
|
| - void Disconnect() override { NOTIMPLEMENTED(); }
|
| - bool IsConnected() const override {
|
| - NOTIMPLEMENTED();
|
| - return true;
|
| - }
|
| - bool IsConnectedAndIdle() const override {
|
| - NOTIMPLEMENTED();
|
| - return false;
|
| - }
|
| - int GetPeerAddress(net::IPEndPoint* address) const override {
|
| - NOTIMPLEMENTED();
|
| - return net::ERR_NOT_IMPLEMENTED;
|
| - }
|
| - int GetLocalAddress(net::IPEndPoint* address) const override {
|
| - NOTIMPLEMENTED();
|
| - return net::ERR_NOT_IMPLEMENTED;
|
| - }
|
| - const net::BoundNetLog& NetLog() const override {
|
| - NOTIMPLEMENTED();
|
| - return net_log_;
|
| - }
|
| - void SetSubresourceSpeculation() override { NOTIMPLEMENTED(); }
|
| - void SetOmniboxSpeculation() override { NOTIMPLEMENTED(); }
|
| - bool WasEverUsed() const override { return true; }
|
| - bool UsingTCPFastOpen() const override { return false; }
|
| - bool WasNpnNegotiated() const override { return false; }
|
| - net::NextProto GetNegotiatedProtocol() const override {
|
| - return net::kProtoUnknown;
|
| - }
|
| - bool GetSSLInfo(net::SSLInfo* ssl_info) override {
|
| - NOTIMPLEMENTED();
|
| - return false;
|
| - }
|
| - void GetConnectionAttempts(net::ConnectionAttempts* out) const override {
|
| - out->clear();
|
| - }
|
| - void ClearConnectionAttempts() override {}
|
| - void AddConnectionAttempts(const net::ConnectionAttempts& attempts) override {
|
| - }
|
| -
|
| private:
|
| MuxChannel* channel_;
|
|
|
| @@ -185,8 +141,6 @@ class ChannelMultiplexer::MuxSocket : public net::StreamSocket,
|
| int write_result_;
|
| net::CompletionCallback write_callback_;
|
|
|
| - net::BoundNetLog net_log_;
|
| -
|
| DISALLOW_COPY_AND_ASSIGN(MuxSocket);
|
| };
|
|
|
| @@ -209,7 +163,7 @@ ChannelMultiplexer::MuxChannel::~MuxChannel() {
|
| STLDeleteElements(&pending_packets_);
|
| }
|
|
|
| -scoped_ptr<net::StreamSocket> ChannelMultiplexer::MuxChannel::CreateSocket() {
|
| +scoped_ptr<P2PStreamSocket> ChannelMultiplexer::MuxChannel::CreateSocket() {
|
| DCHECK(!socket_); // Can't create more than one socket per channel.
|
| scoped_ptr<MuxSocket> result(new MuxSocket(this));
|
| socket_ = result.get();
|
| @@ -420,7 +374,7 @@ void ChannelMultiplexer::CancelChannelCreation(const std::string& name) {
|
| }
|
|
|
| void ChannelMultiplexer::OnBaseChannelReady(
|
| - scoped_ptr<net::StreamSocket> socket) {
|
| + scoped_ptr<P2PStreamSocket> socket) {
|
| base_channel_factory_ = nullptr;
|
| base_channel_ = socket.Pass();
|
|
|
| @@ -451,7 +405,7 @@ void ChannelMultiplexer::DoCreatePendingChannels() {
|
|
|
| PendingChannel c = pending_channels_.front();
|
| pending_channels_.erase(pending_channels_.begin());
|
| - scoped_ptr<net::StreamSocket> socket;
|
| + scoped_ptr<P2PStreamSocket> socket;
|
| if (base_channel_.get())
|
| socket = GetOrCreateChannel(c.name)->CreateSocket();
|
| c.callback.Run(socket.Pass());
|
|
|