summaryrefslogtreecommitdiffstats
path: root/remoting/protocol
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-09 01:01:44 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-09 01:01:44 +0000
commitc16b615976eb1244c292dac1836fe08d4c9c79ce (patch)
tree25472b71680a3942065c015bfdc816883c370996 /remoting/protocol
parent69c38d397d1e3c988dd87f4d92661a74bf376156 (diff)
downloadchromium_src-c16b615976eb1244c292dac1836fe08d4c9c79ce.zip
chromium_src-c16b615976eb1244c292dac1836fe08d4c9c79ce.tar.gz
chromium_src-c16b615976eb1244c292dac1836fe08d4c9c79ce.tar.bz2
Revert 121094 - Add abstract interfaces for the transport layer.
Renamed PepperChannel to Transport and added TransportFactory. The new interfaces abstract transport layer for the signaling layer. BUG=110485,109630 Review URL: http://codereview.chromium.org/9325036 TBR=sergeyu@chromium.org Review URL: https://chromiumcodereview.appspot.com/9373011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121126 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol')
-rw-r--r--remoting/protocol/connection_to_host.cc6
-rw-r--r--remoting/protocol/pepper_session.cc63
-rw-r--r--remoting/protocol/pepper_session.h17
-rw-r--r--remoting/protocol/pepper_session_manager.cc5
-rw-r--r--remoting/protocol/pepper_session_manager.h7
-rw-r--r--remoting/protocol/pepper_session_unittest.cc3
-rw-r--r--remoting/protocol/pepper_stream_channel.cc (renamed from remoting/protocol/pepper_transport_factory.cc)154
-rw-r--r--remoting/protocol/pepper_transport_factory.h34
-rw-r--r--remoting/protocol/transport.h130
9 files changed, 77 insertions, 342 deletions
diff --git a/remoting/protocol/connection_to_host.cc b/remoting/protocol/connection_to_host.cc
index 9352712..0bdc5c3 100644
--- a/remoting/protocol/connection_to_host.cc
+++ b/remoting/protocol/connection_to_host.cc
@@ -16,8 +16,8 @@
#include "remoting/protocol/client_control_dispatcher.h"
#include "remoting/protocol/client_event_dispatcher.h"
#include "remoting/protocol/client_stub.h"
+#include "remoting/protocol/jingle_session_manager.h"
#include "remoting/protocol/pepper_session_manager.h"
-#include "remoting/protocol/pepper_transport_factory.h"
#include "remoting/protocol/video_reader.h"
#include "remoting/protocol/video_stub.h"
#include "remoting/protocol/util.h"
@@ -70,9 +70,7 @@ void ConnectionToHost::Connect(scoped_refptr<XmppProxy> xmpp_proxy,
signal_strategy_->AddListener(this);
signal_strategy_->Connect();
- scoped_ptr<TransportFactory> transport_factory(
- new PepperTransportFactory(pp_instance_));
- session_manager_.reset(new PepperSessionManager(transport_factory.Pass()));
+ session_manager_.reset(new PepperSessionManager(pp_instance_));
session_manager_->Init(signal_strategy_.get(), this,
NetworkSettings(allow_nat_traversal_));
}
diff --git a/remoting/protocol/pepper_session.cc b/remoting/protocol/pepper_session.cc
index 2ac5c15..614e9c6 100644
--- a/remoting/protocol/pepper_session.cc
+++ b/remoting/protocol/pepper_session.cc
@@ -11,10 +11,10 @@
#include "remoting/base/constants.h"
#include "remoting/jingle_glue/iq_sender.h"
#include "remoting/protocol/authenticator.h"
-#include "remoting/protocol/channel_authenticator.h"
#include "remoting/protocol/content_description.h"
#include "remoting/protocol/jingle_messages.h"
#include "remoting/protocol/pepper_session_manager.h"
+#include "remoting/protocol/pepper_stream_channel.h"
#include "third_party/libjingle/source/talk/p2p/base/candidate.h"
#include "third_party/libjingle/source/talk/xmllite/xmlelement.h"
@@ -121,27 +121,19 @@ void PepperSession::CreateStreamChannel(
scoped_ptr<ChannelAuthenticator> channel_authenticator =
authenticator_->CreateChannelAuthenticator();
- scoped_ptr<StreamTransport> channel =
- session_manager_->transport_factory_->CreateStreamTransport();
- channel->Initialize(name, session_manager_->transport_config_,
- this, channel_authenticator.Pass());
- channel->Connect(callback);
- channels_[name] = channel.release();
+ PepperStreamChannel* channel = new PepperStreamChannel(
+ this, name, callback);
+ channels_[name] = channel;
+ channel->Connect(session_manager_->pp_instance_,
+ session_manager_->transport_config_,
+ channel_authenticator.Pass());
}
void PepperSession::CreateDatagramChannel(
const std::string& name,
const DatagramChannelCallback& callback) {
- DCHECK(!channels_[name]);
-
- scoped_ptr<ChannelAuthenticator> channel_authenticator =
- authenticator_->CreateChannelAuthenticator();
- scoped_ptr<DatagramTransport> channel =
- session_manager_->transport_factory_->CreateDatagramTransport();
- channel->Initialize(name, session_manager_->transport_config_,
- this, channel_authenticator.Pass());
- channel->Connect(callback);
- channels_[name] = channel.release();
+ // TODO(sergeyu): Implement datagram channel support.
+ NOTREACHED();
}
void PepperSession::CancelChannelCreation(const std::string& name) {
@@ -188,25 +180,6 @@ void PepperSession::Close() {
CloseInternal(false);
}
-void PepperSession::OnTransportCandidate(Transport* transport,
- const cricket::Candidate& candidate) {
- pending_candidates_.push_back(candidate);
-
- if (!transport_infos_timer_.IsRunning()) {
- // Delay sending the new candidates in case we get more candidates
- // that we can send in one message.
- transport_infos_timer_.Start(
- FROM_HERE, base::TimeDelta::FromMilliseconds(kTransportInfoSendDelayMs),
- this, &PepperSession::SendTransportInfo);
- }
-}
-
-void PepperSession::OnTransportDeleted(Transport* transport) {
- ChannelsMap::iterator it = channels_.find(transport->name());
- DCHECK_EQ(it->second, transport);
- channels_.erase(it);
-}
-
void PepperSession::OnIncomingMessage(const JingleMessage& message,
JingleMessageReply* reply) {
DCHECK(CalledOnValidThread());
@@ -401,6 +374,18 @@ void PepperSession::OnSessionInfoResponse(const buzz::XmlElement* response) {
}
}
+void PepperSession::AddLocalCandidate(const cricket::Candidate& candidate) {
+ pending_candidates_.push_back(candidate);
+
+ if (!transport_infos_timer_.IsRunning()) {
+ // Delay sending the new candidates in case we get more candidates
+ // that we can send in one message.
+ transport_infos_timer_.Start(
+ FROM_HERE, base::TimeDelta::FromMilliseconds(kTransportInfoSendDelayMs),
+ this, &PepperSession::SendTransportInfo);
+ }
+}
+
void PepperSession::OnTransportInfoResponse(const buzz::XmlElement* response) {
const std::string& type = response->Attr(buzz::QName("", "type"));
if (type != "result") {
@@ -417,6 +402,12 @@ void PepperSession::OnTransportInfoResponse(const buzz::XmlElement* response) {
}
}
+void PepperSession::OnDeleteChannel(PepperChannel* channel) {
+ ChannelsMap::iterator it = channels_.find(channel->name());
+ DCHECK_EQ(it->second, channel);
+ channels_.erase(it);
+}
+
void PepperSession::SendTransportInfo() {
JingleMessage message(peer_jid_, JingleMessage::TRANSPORT_INFO, session_id_);
message.candidates.swap(pending_candidates_);
diff --git a/remoting/protocol/pepper_session.h b/remoting/protocol/pepper_session.h
index c8c87e7..391e808 100644
--- a/remoting/protocol/pepper_session.h
+++ b/remoting/protocol/pepper_session.h
@@ -16,7 +16,6 @@
#include "remoting/protocol/jingle_messages.h"
#include "remoting/protocol/session.h"
#include "remoting/protocol/session_config.h"
-#include "remoting/protocol/transport.h"
namespace net {
class Socket;
@@ -30,13 +29,13 @@ class IqRequest;
namespace protocol {
class Authenticator;
+class PepperChannel;
class PepperSessionManager;
// Implements the protocol::Session interface using the Pepper P2P
// Transport API. Created by PepperSessionManager for incoming and
// outgoing connections.
-class PepperSession : public Session,
- public Transport::EventHandler {
+class PepperSession : public Session {
public:
virtual ~PepperSession();
@@ -59,17 +58,11 @@ class PepperSession : public Session,
virtual void set_config(const SessionConfig& config) OVERRIDE;
virtual void Close() OVERRIDE;
- // Transport::EventHandler interface.
- virtual void OnTransportCandidate(
- Transport* transport,
- const cricket::Candidate& candidate) OVERRIDE;
- virtual void OnTransportDeleted(Transport* transport) OVERRIDE;
-
private:
friend class PepperSessionManager;
friend class PepperStreamChannel;
- typedef std::map<std::string, Transport*> ChannelsMap;
+ typedef std::map<std::string, PepperChannel*> ChannelsMap;
explicit PepperSession(PepperSessionManager* session_manager);
@@ -102,6 +95,10 @@ class PepperSession : public Session,
void ProcessAuthenticationStep();
void OnSessionInfoResponse(const buzz::XmlElement* response);
+ // Called by PepperChannel.
+ void AddLocalCandidate(const cricket::Candidate& candidate);
+ void OnDeleteChannel(PepperChannel* channel);
+
void SendTransportInfo();
void OnTransportInfoResponse(const buzz::XmlElement* response);
diff --git a/remoting/protocol/pepper_session_manager.cc b/remoting/protocol/pepper_session_manager.cc
index c8a67c6..b45a315 100644
--- a/remoting/protocol/pepper_session_manager.cc
+++ b/remoting/protocol/pepper_session_manager.cc
@@ -19,9 +19,8 @@ using buzz::QName;
namespace remoting {
namespace protocol {
-PepperSessionManager::PepperSessionManager(
- scoped_ptr<TransportFactory> transport_factory)
- : transport_factory_(transport_factory.Pass()),
+PepperSessionManager::PepperSessionManager(pp::Instance* pp_instance)
+ : pp_instance_(pp_instance),
signal_strategy_(NULL),
listener_(NULL),
ready_(false) {
diff --git a/remoting/protocol/pepper_session_manager.h b/remoting/protocol/pepper_session_manager.h
index 0e9a41f..508c161 100644
--- a/remoting/protocol/pepper_session_manager.h
+++ b/remoting/protocol/pepper_session_manager.h
@@ -12,8 +12,8 @@
#include "base/memory/ref_counted.h"
#include "net/base/x509_certificate.h"
#include "remoting/jingle_glue/signal_strategy.h"
+#include "remoting/protocol/pepper_channel.h"
#include "remoting/protocol/session_manager.h"
-#include "remoting/protocol/transport.h"
#include "remoting/protocol/transport_config.h"
namespace pp {
@@ -44,8 +44,7 @@ class PepperSession;
class PepperSessionManager : public SessionManager,
public SignalStrategy::Listener {
public:
- explicit PepperSessionManager(
- scoped_ptr<TransportFactory> transport_factory);
+ explicit PepperSessionManager(pp::Instance* pp_instance);
virtual ~PepperSessionManager();
// SessionManager interface.
@@ -84,7 +83,7 @@ class PepperSessionManager : public SessionManager,
// Called by PepperSession when it is being destroyed.
void SessionDestroyed(PepperSession* session);
- scoped_ptr<TransportFactory> transport_factory_;
+ pp::Instance* pp_instance_;
SignalStrategy* signal_strategy_;
scoped_ptr<AuthenticatorFactory> authenticator_factory_;
diff --git a/remoting/protocol/pepper_session_unittest.cc b/remoting/protocol/pepper_session_unittest.cc
index 0f14b3e..134f28f 100644
--- a/remoting/protocol/pepper_session_unittest.cc
+++ b/remoting/protocol/pepper_session_unittest.cc
@@ -107,8 +107,7 @@ class PepperSessionTest : public testing::Test {
EXPECT_CALL(client_server_listener_, OnSessionManagerReady())
.Times(1);
- client_server_.reset(new PepperSessionManager(
- scoped_ptr<TransportFactory>(NULL)));
+ client_server_.reset(new PepperSessionManager(NULL));
client_server_->Init(client_signal_strategy_.get(),
&client_server_listener_, NetworkSettings());
}
diff --git a/remoting/protocol/pepper_transport_factory.cc b/remoting/protocol/pepper_stream_channel.cc
index 4b4b978..98fd3aa 100644
--- a/remoting/protocol/pepper_transport_factory.cc
+++ b/remoting/protocol/pepper_stream_channel.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/protocol/pepper_transport_factory.h"
+#include "remoting/protocol/pepper_stream_channel.h"
#include "base/bind.h"
#include "crypto/hmac.h"
@@ -17,7 +17,7 @@
#include "ppapi/cpp/dev/transport_dev.h"
#include "ppapi/cpp/var.h"
#include "remoting/protocol/channel_authenticator.h"
-#include "remoting/protocol/pepper_transport_socket_adapter.h"
+#include "remoting/protocol/pepper_session.h"
#include "remoting/protocol/transport_config.h"
#include "third_party/libjingle/source/talk/p2p/base/candidate.h"
@@ -35,97 +35,35 @@ const int kTcpAckDelayMilliseconds = 10;
const int kTcpReceiveBufferSize = 256 * 1024;
const int kTcpSendBufferSize = kTcpReceiveBufferSize + 30 * 1024;
-class PepperStreamTransport : public StreamTransport,
- public PepperTransportSocketAdapter::Observer {
- public:
- PepperStreamTransport(pp::Instance* pp_instance);
- virtual ~PepperStreamTransport();
-
- // StreamTransport interface.
- virtual void Initialize(
- const std::string& name,
- const TransportConfig& config,
- Transport::EventHandler* event_handler,
- scoped_ptr<ChannelAuthenticator> authenticator) OVERRIDE;
- virtual void Connect(
- const StreamTransport::ConnectedCallback& callback) OVERRIDE;
- virtual void AddRemoteCandidate(const cricket::Candidate& candidate) OVERRIDE;
- virtual const std::string& name() const OVERRIDE;
- virtual bool is_connected() const OVERRIDE;
-
- // PepperTransportSocketAdapter::Observer interface.
- virtual void OnChannelDeleted() OVERRIDE;
- virtual void OnChannelNewLocalCandidate(
- const std::string& candidate) OVERRIDE;
-
- private:
- void OnP2PConnect(int result);
- void OnAuthenticationDone(net::Error error,
- scoped_ptr<net::StreamSocket> socket);
-
- void NotifyConnected(scoped_ptr<net::StreamSocket> socket);
- void NotifyConnectFailed();
-
- pp::Instance* pp_instance_;
- std::string name_;
- TransportConfig config_;
- EventHandler* event_handler_;
- StreamTransport::ConnectedCallback callback_;
- scoped_ptr<ChannelAuthenticator> authenticator_;
-
- // We own |channel_| until it is connected. After that
- // |authenticator_| owns it.
- scoped_ptr<PepperTransportSocketAdapter> owned_channel_;
- PepperTransportSocketAdapter* channel_;
-
- // Indicates that we've finished connecting.
- bool connected_;
-
- DISALLOW_COPY_AND_ASSIGN(PepperStreamTransport);
-};
-
-PepperStreamTransport::PepperStreamTransport(pp::Instance* pp_instance)
- : pp_instance_(pp_instance),
- event_handler_(NULL),
+} // namespace
+
+PepperStreamChannel::PepperStreamChannel(
+ PepperSession* session,
+ const std::string& name,
+ const Session::StreamChannelCallback& callback)
+ : session_(session),
+ name_(name),
+ callback_(callback),
channel_(NULL),
connected_(false) {
}
-PepperStreamTransport::~PepperStreamTransport() {
- DCHECK(event_handler_);
- event_handler_->OnTransportDeleted(this);
+PepperStreamChannel::~PepperStreamChannel() {
+ session_->OnDeleteChannel(this);
// Channel should be already destroyed if we were connected.
DCHECK(!connected_ || channel_ == NULL);
}
-void PepperStreamTransport::Initialize(
- const std::string& name,
- const TransportConfig& config,
- Transport::EventHandler* event_handler,
+void PepperStreamChannel::Connect(
+ pp::Instance* pp_instance,
+ const TransportConfig& transport_config,
scoped_ptr<ChannelAuthenticator> authenticator) {
DCHECK(CalledOnValidThread());
- DCHECK(!name.empty());
- DCHECK(event_handler);
-
- // Can be initialized only once.
- DCHECK(name_.empty());
-
- name_ = name;
- config_ = config;
- event_handler_ = event_handler;
authenticator_ = authenticator.Pass();
-}
-
-void PepperStreamTransport::Connect(
- const StreamTransport::ConnectedCallback& callback) {
- DCHECK(CalledOnValidThread());
-
- // Initialize() must be called first.
- DCHECK(!name_.empty());
pp::Transport_Dev* transport =
- new pp::Transport_Dev(pp_instance_, name_.c_str(),
+ new pp::Transport_Dev(pp_instance, name_.c_str(),
PP_TRANSPORTTYPE_STREAM);
if (transport->SetProperty(PP_TRANSPORTPROPERTY_TCP_RECEIVE_WINDOW,
@@ -147,22 +85,22 @@ void PepperStreamTransport::Connect(
LOG(ERROR) << "Failed to set TCP ACK delay.";
}
- if (config_.nat_traversal) {
+ if (transport_config.nat_traversal) {
if (transport->SetProperty(
PP_TRANSPORTPROPERTY_STUN_SERVER,
- pp::Var(config_.stun_server)) != PP_OK) {
+ pp::Var(transport_config.stun_server)) != PP_OK) {
LOG(ERROR) << "Failed to set STUN server.";
}
if (transport->SetProperty(
PP_TRANSPORTPROPERTY_RELAY_SERVER,
- pp::Var(config_.relay_server)) != PP_OK) {
+ pp::Var(transport_config.relay_server)) != PP_OK) {
LOG(ERROR) << "Failed to set relay server.";
}
if (transport->SetProperty(
PP_TRANSPORTPROPERTY_RELAY_PASSWORD,
- pp::Var(config_.relay_token)) != PP_OK) {
+ pp::Var(transport_config.relay_token)) != PP_OK) {
LOG(ERROR) << "Failed to set relay token.";
}
@@ -181,30 +119,30 @@ void PepperStreamTransport::Connect(
channel_ = new PepperTransportSocketAdapter(transport, name_, this);
owned_channel_.reset(channel_);
- int result = channel_->Connect(
- base::Bind(&PepperStreamTransport::OnP2PConnect, base::Unretained(this)));
+ int result = channel_->Connect(base::Bind(&PepperStreamChannel::OnP2PConnect,
+ base::Unretained(this)));
if (result != net::ERR_IO_PENDING)
OnP2PConnect(result);
}
-void PepperStreamTransport::AddRemoteCandidate(
+void PepperStreamChannel::AddRemoteCandidate(
const cricket::Candidate& candidate) {
DCHECK(CalledOnValidThread());
if (channel_)
channel_->AddRemoteCandidate(jingle_glue::SerializeP2PCandidate(candidate));
}
-const std::string& PepperStreamTransport::name() const {
+const std::string& PepperStreamChannel::name() const {
DCHECK(CalledOnValidThread());
return name_;
}
-bool PepperStreamTransport::is_connected() const {
+bool PepperStreamChannel::is_connected() const {
DCHECK(CalledOnValidThread());
return connected_;
}
-void PepperStreamTransport::OnChannelDeleted() {
+void PepperStreamChannel::OnChannelDeleted() {
if (connected_) {
channel_ = NULL;
// The PepperTransportSocketAdapter is being deleted, so delete
@@ -213,7 +151,7 @@ void PepperStreamTransport::OnChannelDeleted() {
}
}
-void PepperStreamTransport::OnChannelNewLocalCandidate(
+void PepperStreamChannel::OnChannelNewLocalCandidate(
const std::string& candidate) {
DCHECK(CalledOnValidThread());
@@ -221,25 +159,23 @@ void PepperStreamTransport::OnChannelNewLocalCandidate(
if (!jingle_glue::DeserializeP2PCandidate(candidate, &candidate_value)) {
LOG(ERROR) << "Failed to parse candidate " << candidate;
}
- event_handler_->OnTransportCandidate(this, candidate_value);
+ session_->AddLocalCandidate(candidate_value);
}
-void PepperStreamTransport::OnP2PConnect(int result) {
+void PepperStreamChannel::OnP2PConnect(int result) {
DCHECK(CalledOnValidThread());
- if (result != net::OK) {
+ if (result != net::OK)
NotifyConnectFailed();
- return;
- }
authenticator_->SecureAndAuthenticate(
owned_channel_.PassAs<net::StreamSocket>(),
- base::Bind(&PepperStreamTransport::OnAuthenticationDone,
+ base::Bind(&PepperStreamChannel::OnAuthenticationDone,
base::Unretained(this)));
}
-void PepperStreamTransport::OnAuthenticationDone(
+void PepperStreamChannel::OnAuthenticationDone(
net::Error error, scoped_ptr<net::StreamSocket> socket) {
DCHECK(CalledOnValidThread());
if (error != net::OK) {
@@ -250,14 +186,14 @@ void PepperStreamTransport::OnAuthenticationDone(
NotifyConnected(socket.Pass());
}
-void PepperStreamTransport::NotifyConnected(
+void PepperStreamChannel::NotifyConnected(
scoped_ptr<net::StreamSocket> socket) {
DCHECK(!connected_);
callback_.Run(socket.Pass());
connected_ = true;
}
-void PepperStreamTransport::NotifyConnectFailed() {
+void PepperStreamChannel::NotifyConnectFailed() {
channel_ = NULL;
owned_channel_.reset();
authenticator_.reset();
@@ -265,25 +201,5 @@ void PepperStreamTransport::NotifyConnectFailed() {
NotifyConnected(scoped_ptr<net::StreamSocket>(NULL));
}
-} // namespace
-
-PepperTransportFactory::PepperTransportFactory(
- pp::Instance* pp_instance)
- : pp_instance_(pp_instance) {
-}
-
-PepperTransportFactory::~PepperTransportFactory() {
-}
-
-scoped_ptr<StreamTransport> PepperTransportFactory::CreateStreamTransport() {
- return scoped_ptr<StreamTransport>(new PepperStreamTransport(pp_instance_));
-}
-
-scoped_ptr<DatagramTransport>
-PepperTransportFactory::CreateDatagramTransport() {
- NOTIMPLEMENTED();
- return scoped_ptr<DatagramTransport>(NULL);
-}
-
} // namespace protocol
} // namespace remoting
diff --git a/remoting/protocol/pepper_transport_factory.h b/remoting/protocol/pepper_transport_factory.h
deleted file mode 100644
index 94e7bbe..0000000
--- a/remoting/protocol/pepper_transport_factory.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef REMOTING_PROTOCOL_PEPPER_TRANSPORT_FACTORY_H_
-#define REMOTING_PROTOCOL_PEPPER_TRANSPORT_FACTORY_H_
-
-#include "remoting/protocol/transport.h"
-
-namespace pp {
-class Instance;
-} // namespace pp
-
-namespace remoting {
-namespace protocol {
-
-class PepperTransportFactory : public TransportFactory {
- public:
- PepperTransportFactory(pp::Instance* pp_instance);
- virtual ~PepperTransportFactory();
-
- virtual scoped_ptr<StreamTransport> CreateStreamTransport() OVERRIDE;
- virtual scoped_ptr<DatagramTransport> CreateDatagramTransport() OVERRIDE;
-
- private:
- pp::Instance* pp_instance_;
-
- DISALLOW_COPY_AND_ASSIGN(PepperTransportFactory);
-};
-
-} // namespace protocol
-} // namespace remoting
-
-#endif // REMOTING_PROTOCOL_PEPPER_TRANSPORT_FACTORY_H_
diff --git a/remoting/protocol/transport.h b/remoting/protocol/transport.h
deleted file mode 100644
index 3b4bc2a..0000000
--- a/remoting/protocol/transport.h
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// This file defines the interface for peer-to-peer transport. There
-// are two types of transport: StreamTransport and DatagramTransport.
-// They must both be created using TransportFactory instances and they
-// provide the same interface, except that one should be used for
-// reliable stream connection and the other one for unreliable
-// datagram connection. The Transport interface itself doesn't provide
-// methods to send/receive data. Instead it creates an instance of
-// net::Socket or net::SocketStream which provides access to the data
-// channel. After a new transport is Initialize()'ed the Connect()
-// method must be called. Connect() starts asynchronous creation and
-// initialization of the connection socket that can be used later to
-// send and receive data. The socket is passed to the callback
-// specified in the Connect() call. The Transport object must exist
-// during the whole lifetime of the connection socket. Later deletion
-// of the connection socket causes teardown of the corresponding
-// Transport object.
-
-#ifndef REMOTING_PROTOCOL_TRANSPORT_H_
-#define REMOTING_PROTOCOL_TRANSPORT_H_
-
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/callback_forward.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/threading/non_thread_safe.h"
-
-namespace cricket {
-class Candidate;
-} // namespace cricket
-
-namespace net {
-class Socket;
-class StreamSocket;
-} // namespace net
-
-namespace remoting {
-namespace protocol {
-
-class ChannelAuthenticator;
-struct TransportConfig;
-
-class Transport : public base::NonThreadSafe {
- public:
- class EventHandler {
- public:
- EventHandler() {};
- virtual ~EventHandler() {};
-
- // Called when the transport generates a new candidate that needs
- // to be passed to the AddRemoteCandidate() method on the remote
- // end of the connection.
- virtual void OnTransportCandidate(Transport* transport,
- const cricket::Candidate& candidate) = 0;
-
- // Called when the transport is about to be deleted.
- virtual void OnTransportDeleted(Transport* transport) = 0;
- };
-
- Transport() {}
- virtual ~Transport() {}
-
- // Intialize the transport with the specified parameters.
- // |authenticator| is used to secure and authenticate the connection.
- virtual void Initialize(const std::string& name,
- const TransportConfig& config,
- Transport::EventHandler* event_handler,
- scoped_ptr<ChannelAuthenticator> authenticator) = 0;
-
- // Adds |candidate| received from the peer.
- virtual void AddRemoteCandidate(const cricket::Candidate& candidate) = 0;
-
- // Name of the channel. It is used to identify the channel and
- // disambiguate candidates it generates from candidates generated by
- // parallel connections.
- virtual const std::string& name() const = 0;
-
- // Returns true if the channel is already connected.
- virtual bool is_connected() const = 0;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(Transport);
-};
-
-class StreamTransport : public Transport {
- public:
- typedef base::Callback<void(scoped_ptr<net::StreamSocket>)> ConnectedCallback;
-
- StreamTransport() { }
- virtual ~StreamTransport() { }
-
- virtual void Connect(const ConnectedCallback& callback) = 0;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(StreamTransport);
-};
-
-class DatagramTransport : public Transport {
- public:
- typedef base::Callback<void(scoped_ptr<net::Socket>)> ConnectedCallback;
-
- DatagramTransport() { }
- virtual ~DatagramTransport() { }
-
- virtual void Connect(const ConnectedCallback& callback) = 0;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DatagramTransport);
-};
-
-class TransportFactory {
- public:
- TransportFactory() { }
- virtual ~TransportFactory() { }
-
- virtual scoped_ptr<StreamTransport> CreateStreamTransport() = 0;
- virtual scoped_ptr<DatagramTransport> CreateDatagramTransport() = 0;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TransportFactory);
-};
-
-} // namespace protocol
-} // namespace remoting
-
-#endif // REMOTING_PROTOCOL_TRANSPORT_H_