summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-31 00:26:03 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-31 00:26:03 +0000
commitf6da0b2581a106cfb2ad22b1d15993a89dd9a75a (patch)
treeebe1ffc783015bad357a5dfa1e298ef36a6c6061
parent5a1f7e2418011b542e12f324bea55895f4c2cc56 (diff)
downloadchromium_src-f6da0b2581a106cfb2ad22b1d15993a89dd9a75a.zip
chromium_src-f6da0b2581a106cfb2ad22b1d15993a89dd9a75a.tar.gz
chromium_src-f6da0b2581a106cfb2ad22b1d15993a89dd9a75a.tar.bz2
Moved socket adapters from remoting/jingle_glue to jingle/glue.
BUG=None TEST=compiles, unittests Review URL: http://codereview.chromium.org/6776003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79929 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--jingle/glue/channel_socket_adapter.cc (renamed from remoting/jingle_glue/channel_socket_adapter.cc)11
-rw-r--r--jingle/glue/channel_socket_adapter.h (renamed from remoting/jingle_glue/channel_socket_adapter.h)10
-rw-r--r--jingle/glue/channel_socket_adapter_unittest.cc (renamed from remoting/jingle_glue/channel_socket_adapter_unittest.cc)6
-rw-r--r--jingle/glue/jingle_glue_mock_objects.cc (renamed from remoting/jingle_glue/jingle_glue_mock_objects.cc)6
-rw-r--r--jingle/glue/jingle_glue_mock_objects.h (renamed from remoting/jingle_glue/jingle_glue_mock_objects.h)10
-rw-r--r--jingle/glue/stream_socket_adapter.cc (renamed from remoting/jingle_glue/stream_socket_adapter.cc)15
-rw-r--r--jingle/glue/stream_socket_adapter.h (renamed from remoting/jingle_glue/stream_socket_adapter.h)10
-rw-r--r--jingle/glue/stream_socket_adapter_unittest.cc (renamed from remoting/jingle_glue/stream_socket_adapter_unittest.cc)8
-rw-r--r--jingle/jingle.gyp8
-rw-r--r--remoting/jingle_glue/ssl_socket_adapter.cc9
-rw-r--r--remoting/jingle_glue/utils.cc53
-rw-r--r--remoting/jingle_glue/utils.h15
-rw-r--r--remoting/protocol/DEPS3
-rw-r--r--remoting/protocol/jingle_session.cc14
-rw-r--r--remoting/protocol/jingle_session.h18
-rw-r--r--remoting/remoting.gyp11
16 files changed, 69 insertions, 138 deletions
diff --git a/remoting/jingle_glue/channel_socket_adapter.cc b/jingle/glue/channel_socket_adapter.cc
index 583eed1..b6866ca 100644
--- a/remoting/jingle_glue/channel_socket_adapter.cc
+++ b/jingle/glue/channel_socket_adapter.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/jingle_glue/channel_socket_adapter.h"
+#include "jingle/glue/channel_socket_adapter.h"
#include <limits>
@@ -10,10 +10,9 @@
#include "base/message_loop.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
-#include "remoting/jingle_glue/utils.h"
#include "third_party/libjingle/source/talk/p2p/base/transportchannel.h"
-namespace remoting {
+namespace jingle_glue {
TransportChannelSocketAdapter::TransportChannelSocketAdapter(
cricket::TransportChannel* channel)
@@ -67,7 +66,7 @@ int TransportChannelSocketAdapter::Write(
int result = channel_->SendPacket(buffer->data(), buffer_size);
if (result < 0) {
- result = MapPosixToChromeError(channel_->GetError());
+ result = net::MapSystemError(channel_->GetError());
if (result == net::ERR_IO_PENDING) {
write_pending_ = true;
write_callback_ = callback;
@@ -150,7 +149,7 @@ void TransportChannelSocketAdapter::OnWritableState(
int result = channel_->SendPacket(write_buffer_->data(),
write_buffer_size_);
if (result < 0)
- result = MapPosixToChromeError(channel_->GetError());
+ result = net::MapSystemError(channel_->GetError());
if (result != net::ERR_IO_PENDING) {
net::CompletionCallback* callback = write_callback_;
@@ -168,4 +167,4 @@ void TransportChannelSocketAdapter::OnChannelDestroyed(
Close(net::ERR_CONNECTION_ABORTED);
}
-} // namespace remoting
+} // namespace jingle_glue
diff --git a/remoting/jingle_glue/channel_socket_adapter.h b/jingle/glue/channel_socket_adapter.h
index d50c560e..1df852d 100644
--- a/remoting/jingle_glue/channel_socket_adapter.h
+++ b/jingle/glue/channel_socket_adapter.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef REMOTING_JINGLE_GLUE_CHANNEL_SOCKET_ADAPTER_H_
-#define REMOTING_JINGLE_GLUE_CHANNEL_SOCKET_ADAPTER_H_
+#ifndef JINGLE_GLUE_CHANNEL_SOCKET_ADAPTER_H_
+#define JINGLE_GLUE_CHANNEL_SOCKET_ADAPTER_H_
#include "net/socket/socket.h"
#include "third_party/libjingle/source/talk/base/socketaddress.h"
@@ -13,7 +13,7 @@ namespace cricket {
class TransportChannel;
} // namespace cricket
-namespace remoting {
+namespace jingle_glue {
// TransportChannelSocketAdapter implements net::Socket interface on
// top of libjingle's TransportChannel. It is used by
@@ -62,6 +62,6 @@ class TransportChannelSocketAdapter : public net::Socket,
DISALLOW_COPY_AND_ASSIGN(TransportChannelSocketAdapter);
};
-} // namespace remoting
+} // namespace jingle_glue
-#endif // REMOTING_JINGLE_GLUE_CHANNEL_SOCKET_ADAPTER_H_
+#endif // JINGLE_GLUE_CHANNEL_SOCKET_ADAPTER_H_
diff --git a/remoting/jingle_glue/channel_socket_adapter_unittest.cc b/jingle/glue/channel_socket_adapter_unittest.cc
index 885d308..60e60b6 100644
--- a/remoting/jingle_glue/channel_socket_adapter_unittest.cc
+++ b/jingle/glue/channel_socket_adapter_unittest.cc
@@ -5,10 +5,10 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
+#include "jingle/glue/channel_socket_adapter.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/socket/socket.h"
-#include "remoting/jingle_glue/channel_socket_adapter.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/libjingle/source/talk/p2p/base/transportchannel.h"
@@ -18,7 +18,7 @@ using net::IOBuffer;
using testing::_;
using testing::Return;
-namespace remoting {
+namespace jingle_glue {
namespace {
const int kBufferSize = 4096;
@@ -118,4 +118,4 @@ TEST_F(TransportChannelSocketAdapterTest, WritePending) {
EXPECT_EQ(kTestDataSize, callback_result_);
}
-} // namespace remoting
+} // namespace jingle_glue
diff --git a/remoting/jingle_glue/jingle_glue_mock_objects.cc b/jingle/glue/jingle_glue_mock_objects.cc
index 4ec59e7..6cd48ce 100644
--- a/remoting/jingle_glue/jingle_glue_mock_objects.cc
+++ b/jingle/glue/jingle_glue_mock_objects.cc
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/jingle_glue/jingle_glue_mock_objects.h"
+#include "jingle/glue/jingle_glue_mock_objects.h"
-namespace remoting {
+namespace jingle_glue {
MockStream::MockStream() {}
MockStream::~MockStream() {}
-} // namespace remoting
+} // namespace jingle_glue
diff --git a/remoting/jingle_glue/jingle_glue_mock_objects.h b/jingle/glue/jingle_glue_mock_objects.h
index 505e563..e2cd704 100644
--- a/remoting/jingle_glue/jingle_glue_mock_objects.h
+++ b/jingle/glue/jingle_glue_mock_objects.h
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef REMOTING_JINGLE_GLUE_JINGLE_GLUE_MOCK_OBJECTS_H_
-#define REMOTING_JINGLE_GLUE_JINGLE_GLUE_MOCK_OBJECTS_H_
+#ifndef JINGLE_GLUE_JINGLE_GLUE_MOCK_OBJECTS_H_
+#define JINGLE_GLUE_JINGLE_GLUE_MOCK_OBJECTS_H_
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/libjingle/source/talk/base/stream.h"
-namespace remoting {
+namespace jingle_glue {
class MockStream : public talk_base::StreamInterface {
public:
@@ -27,6 +27,6 @@ class MockStream : public talk_base::StreamInterface {
MOCK_METHOD2(PostEvent, void(int, int));
};
-} // namespace remoting
+} // namespace jingle_glue
-#endif // REMOTING_JINGLE_GLUE_JINGLE_GLUE_MOCK_OBJECTS_H_
+#endif // JINGLE_GLUE_JINGLE_GLUE_MOCK_OBJECTS_H_
diff --git a/remoting/jingle_glue/stream_socket_adapter.cc b/jingle/glue/stream_socket_adapter.cc
index 4c5e6cf..0cf45fb 100644
--- a/remoting/jingle_glue/stream_socket_adapter.cc
+++ b/jingle/glue/stream_socket_adapter.cc
@@ -2,17 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/jingle_glue/stream_socket_adapter.h"
+#include "jingle/glue/stream_socket_adapter.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "net/base/address_list.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
-#include "remoting/jingle_glue/utils.h"
#include "third_party/libjingle/source/talk/base/stream.h"
-namespace remoting {
+namespace jingle_glue {
StreamSocketAdapter::StreamSocketAdapter(talk_base::StreamInterface* stream)
: stream_(stream),
@@ -80,7 +79,7 @@ int StreamSocketAdapter::Read(
}
int result = ReadStream(buffer, buffer_size);
- if (result == net::ERR_CONNECTION_CLOSED &&
+ if (result == net::ERR_SOCKET_NOT_CONNECTED &&
stream_->GetState() == talk_base::SS_OPENING)
result = net::ERR_IO_PENDING;
if (result == net::ERR_IO_PENDING) {
@@ -104,7 +103,7 @@ int StreamSocketAdapter::Write(
}
int result = WriteStream(buffer, buffer_size);
- if (result == net::ERR_CONNECTION_CLOSED &&
+ if (result == net::ERR_SOCKET_NOT_CONNECTED &&
stream_->GetState() == talk_base::SS_OPENING)
result = net::ERR_IO_PENDING;
@@ -207,7 +206,7 @@ int StreamSocketAdapter::ReadStream(net::IOBuffer* buffer, int buffer_size) {
return net::ERR_CONNECTION_CLOSED;
case talk_base::SR_ERROR:
- return MapPosixToChromeError(error);
+ return net::MapSystemError(error);
}
NOTREACHED();
return net::ERR_FAILED;
@@ -229,10 +228,10 @@ int StreamSocketAdapter::WriteStream(net::IOBuffer* buffer, int buffer_size) {
return net::ERR_CONNECTION_CLOSED;
case talk_base::SR_ERROR:
- return MapPosixToChromeError(error);
+ return net::MapSystemError(error);
}
NOTREACHED();
return net::ERR_FAILED;
}
-} // namespace remoting
+} // namespace jingle_glue
diff --git a/remoting/jingle_glue/stream_socket_adapter.h b/jingle/glue/stream_socket_adapter.h
index f9b274a..aa5fb5d 100644
--- a/remoting/jingle_glue/stream_socket_adapter.h
+++ b/jingle/glue/stream_socket_adapter.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef REMOTING_JINGLE_GLUE_STREAM_SOCKET_ADAPTER_H_
-#define REMOTING_JINGLE_GLUE_STREAM_SOCKET_ADAPTER_H_
+#ifndef JINGLE_GLUE_STREAM_SOCKET_ADAPTER_H_
+#define JINGLE_GLUE_STREAM_SOCKET_ADAPTER_H_
#include "base/memory/scoped_ptr.h"
#include "net/base/net_log.h"
@@ -14,7 +14,7 @@ namespace talk_base {
class StreamInterface;
} // namespace talk_base
-namespace remoting {
+namespace jingle_glue {
// StreamSocketAdapter implements net::Socket interface on top of
// libjingle's StreamInterface. It is used by JingleChromotocolConnection
@@ -80,6 +80,6 @@ class StreamSocketAdapter : public net::ClientSocket,
DISALLOW_COPY_AND_ASSIGN(StreamSocketAdapter);
};
-} // namespace remoting
+} // namespace jingle_glue
-#endif // REMOTING_JINGLE_GLUE_STREAM_SOCKET_ADAPTER_H_
+#endif // JINGLE_GLUE_STREAM_SOCKET_ADAPTER_H_
diff --git a/remoting/jingle_glue/stream_socket_adapter_unittest.cc b/jingle/glue/stream_socket_adapter_unittest.cc
index 2d228db..bac43e5 100644
--- a/remoting/jingle_glue/stream_socket_adapter_unittest.cc
+++ b/jingle/glue/stream_socket_adapter_unittest.cc
@@ -5,11 +5,11 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
+#include "jingle/glue/stream_socket_adapter.h"
+#include "jingle/glue/jingle_glue_mock_objects.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/socket/socket.h"
-#include "remoting/jingle_glue/stream_socket_adapter.h"
-#include "remoting/jingle_glue/jingle_glue_mock_objects.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/libjingle/source/talk/p2p/base/transportchannel.h"
@@ -20,7 +20,7 @@ using testing::_;
using testing::Return;
using testing::SetArgumentPointee;
-namespace remoting {
+namespace jingle_glue {
namespace {
const int kBufferSize = 4096;
@@ -148,4 +148,4 @@ TEST_F(StreamSocketAdapterTest, WriteClose) {
EXPECT_EQ(kTestError, target_->Write(buffer, kTestError, &callback_));
}
-} // namespace remoting
+} // namespace jingle_glue
diff --git a/jingle/jingle.gyp b/jingle/jingle.gyp
index 1a50938..f7f7f85 100644
--- a/jingle/jingle.gyp
+++ b/jingle/jingle.gyp
@@ -12,6 +12,10 @@
'target_name': 'jingle_glue',
'type': '<(library)',
'sources': [
+ 'glue/channel_socket_adapter.cc',
+ 'glue/channel_socket_adapter.h',
+ 'glue/stream_socket_adapter.cc',
+ 'glue/stream_socket_adapter.h',
'glue/thread_wrapper.cc',
'glue/thread_wrapper.h',
],
@@ -122,6 +126,10 @@
'target_name': 'jingle_unittests',
'type': 'executable',
'sources': [
+ 'glue/channel_socket_adapter_unittest.cc',
+ 'glue/jingle_glue_mock_objects.cc',
+ 'glue/jingle_glue_mock_objects.h',
+ 'glue/stream_socket_adapter_unittest.cc',
'glue/thread_wrapper_unittest.cc',
'notifier/base/chrome_async_socket_unittest.cc',
'notifier/base/fake_ssl_client_socket_unittest.cc',
diff --git a/remoting/jingle_glue/ssl_socket_adapter.cc b/remoting/jingle_glue/ssl_socket_adapter.cc
index ffde85e..251f771 100644
--- a/remoting/jingle_glue/ssl_socket_adapter.cc
+++ b/remoting/jingle_glue/ssl_socket_adapter.cc
@@ -15,7 +15,6 @@
#include "net/base/sys_addrinfo.h"
#include "net/socket/client_socket_factory.h"
#include "net/url_request/url_request_context.h"
-#include "remoting/jingle_glue/utils.h"
namespace remoting {
@@ -306,7 +305,7 @@ int TransportSocket::Read(net::IOBuffer* buf, int buf_len,
DCHECK(!read_buffer_.get());
int result = socket_->Recv(buf->data(), buf_len);
if (result < 0) {
- result = MapPosixToChromeError(socket_->GetError());
+ result = net::MapSystemError(socket_->GetError());
if (result == net::ERR_IO_PENDING) {
read_callback_ = callback;
read_buffer_ = buf;
@@ -325,7 +324,7 @@ int TransportSocket::Write(net::IOBuffer* buf, int buf_len,
DCHECK(!write_buffer_.get());
int result = socket_->Send(buf->data(), buf_len);
if (result < 0) {
- result = MapPosixToChromeError(socket_->GetError());
+ result = net::MapSystemError(socket_->GetError());
if (result == net::ERR_IO_PENDING) {
write_callback_ = callback;
write_buffer_ = buf;
@@ -360,7 +359,7 @@ void TransportSocket::OnReadEvent(talk_base::AsyncSocket* socket) {
int result = socket_->Recv(buffer->data(), buffer_len);
if (result < 0) {
- result = MapPosixToChromeError(socket_->GetError());
+ result = net::MapSystemError(socket_->GetError());
if (result == net::ERR_IO_PENDING) {
read_callback_ = callback;
read_buffer_ = buffer;
@@ -386,7 +385,7 @@ void TransportSocket::OnWriteEvent(talk_base::AsyncSocket* socket) {
int result = socket_->Send(buffer->data(), buffer_len);
if (result < 0) {
- result = MapPosixToChromeError(socket_->GetError());
+ result = net::MapSystemError(socket_->GetError());
if (result == net::ERR_IO_PENDING) {
write_callback_ = callback;
write_buffer_ = buffer;
diff --git a/remoting/jingle_glue/utils.cc b/remoting/jingle_glue/utils.cc
deleted file mode 100644
index b37d734..0000000
--- a/remoting/jingle_glue/utils.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2010 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.
-
-#include "remoting/jingle_glue/utils.h"
-
-#include "base/logging.h"
-#include "net/base/net_errors.h"
-#include "third_party/libjingle/source/talk/base/socket.h"
-
-namespace remoting {
-
-// TODO(sergeyu): This is a clone of MapPosixError() from
-// net/socket/tcp_client_socket_libevent.cc. Move MapPosixError() to
-// net/base/net_errors.cc and use it here.
-
-// Convert values from <errno.h> to values from "net/base/net_errors.h"
-int MapPosixToChromeError(int err) {
- // There are numerous posix error codes, but these are the ones we thus far
- // find interesting.
- switch (err) {
- case EAGAIN:
-#if EWOULDBLOCK != EAGAIN
- case EWOULDBLOCK:
-#endif
- return net::ERR_IO_PENDING;
- case ENETDOWN:
- return net::ERR_INTERNET_DISCONNECTED;
- case ETIMEDOUT:
- return net::ERR_TIMED_OUT;
- case ENOTCONN:
- return net::ERR_CONNECTION_CLOSED;
- case ECONNRESET:
- case ENETRESET: // Related to keep-alive
- return net::ERR_CONNECTION_RESET;
- case ECONNABORTED:
- return net::ERR_CONNECTION_ABORTED;
- case ECONNREFUSED:
- return net::ERR_CONNECTION_REFUSED;
- case EHOSTUNREACH:
- case ENETUNREACH:
- return net::ERR_ADDRESS_UNREACHABLE;
- case EADDRNOTAVAIL:
- return net::ERR_ADDRESS_INVALID;
- case 0:
- return net::OK;
- default:
- LOG(WARNING) << "Unknown error " << err << " mapped to net::ERR_FAILED";
- return net::ERR_FAILED;
- }
-}
-
-} // namespace remoting
diff --git a/remoting/jingle_glue/utils.h b/remoting/jingle_glue/utils.h
deleted file mode 100644
index 044a9ed..0000000
--- a/remoting/jingle_glue/utils.h
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) 2010 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_JINGLE_GLUE_UTILS_H_
-#define REMOTING_JINGLE_GLUE_UTILS_H_
-
-namespace remoting {
-
-// Convert values from <errno.h> to values from "net/base/net_errors.h"
-int MapPosixToChromeError(int err);
-
-} // namespace remoting
-
-#endif // REMOTING_JINGLE_GLUE_UTILS_H_
diff --git a/remoting/protocol/DEPS b/remoting/protocol/DEPS
index 82b462c..b1c16e3 100644
--- a/remoting/protocol/DEPS
+++ b/remoting/protocol/DEPS
@@ -1,6 +1,7 @@
include_rules = [
"+google/protobuf",
- "+remoting/jingle_glue",
+ "+jingle/glue",
"+net",
+ "+remoting/jingle_glue",
"+third_party/protobuf/src",
]
diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc
index c1adf14..8966363 100644
--- a/remoting/protocol/jingle_session.cc
+++ b/remoting/protocol/jingle_session.cc
@@ -6,6 +6,8 @@
#include "base/crypto/rsa_private_key.h"
#include "base/message_loop.h"
+#include "jingle/glue/channel_socket_adapter.h"
+#include "jingle/glue/stream_socket_adapter.h"
#include "net/base/cert_status_flags.h"
#include "net/base/cert_verifier.h"
#include "net/base/host_port_pair.h"
@@ -16,9 +18,7 @@
#include "net/socket/ssl_client_socket.h"
#include "net/socket/ssl_server_socket.h"
#include "remoting/base/constants.h"
-#include "remoting/jingle_glue/channel_socket_adapter.h"
#include "remoting/jingle_glue/jingle_thread.h"
-#include "remoting/jingle_glue/stream_socket_adapter.h"
#include "remoting/protocol/jingle_session_manager.h"
#include "remoting/protocol/socket_wrapper.h"
#include "third_party/libjingle/source/talk/base/thread.h"
@@ -365,9 +365,9 @@ void JingleSession::OnInitiate() {
}
// Create video RTP channels.
- video_rtp_channel_.reset(new TransportChannelSocketAdapter(
+ video_rtp_channel_.reset(new jingle_glue::TransportChannelSocketAdapter(
cricket_session_->CreateChannel(content_name, kVideoRtpChannelName)));
- video_rtcp_channel_.reset(new TransportChannelSocketAdapter(
+ video_rtcp_channel_.reset(new jingle_glue::TransportChannelSocketAdapter(
cricket_session_->CreateChannel(content_name, kVideoRtcpChannelName)));
// Create control channel.
@@ -376,7 +376,7 @@ void JingleSession::OnInitiate() {
control_channel_->Connect(content_name, kControlChannelName);
control_channel_->SetOption(PseudoTcp::OPT_NODELAY, kEnableNoDelay);
control_channel_->SetOption(PseudoTcp::OPT_ACKDELAY, kDelayedAckTimeoutMs);
- control_channel_adapter_.reset(new StreamSocketAdapter(
+ control_channel_adapter_.reset(new jingle_glue::StreamSocketAdapter(
control_channel_->GetStream()));
// Create event channel.
@@ -385,7 +385,7 @@ void JingleSession::OnInitiate() {
event_channel_->Connect(content_name, kEventChannelName);
event_channel_->SetOption(PseudoTcp::OPT_NODELAY, kEnableNoDelay);
event_channel_->SetOption(PseudoTcp::OPT_ACKDELAY, kDelayedAckTimeoutMs);
- event_channel_adapter_.reset(new StreamSocketAdapter(
+ event_channel_adapter_.reset(new jingle_glue::StreamSocketAdapter(
event_channel_->GetStream()));
// Create video channel.
@@ -395,7 +395,7 @@ void JingleSession::OnInitiate() {
video_channel_->Connect(content_name, kVideoChannelName);
video_channel_->SetOption(PseudoTcp::OPT_NODELAY, kEnableNoDelay);
video_channel_->SetOption(PseudoTcp::OPT_ACKDELAY, kDelayedAckTimeoutMs);
- video_channel_adapter_.reset(new StreamSocketAdapter(
+ video_channel_adapter_.reset(new jingle_glue::StreamSocketAdapter(
video_channel_->GetStream()));
if (!cricket_session_->initiator())
diff --git a/remoting/protocol/jingle_session.h b/remoting/protocol/jingle_session.h
index 099dc4f6..74b0efe 100644
--- a/remoting/protocol/jingle_session.h
+++ b/remoting/protocol/jingle_session.h
@@ -16,6 +16,11 @@ namespace cricket {
class PseudoTcpChannel;
} // namespace cricket
+namespace jingle_glue {
+class StreamSocketAdapter;
+class TransportChannelSocketAdapter;
+} // namespace jingle_glue
+
namespace net {
class CertVerifier;
class ClientSocket;
@@ -26,9 +31,6 @@ class X509Certificate;
namespace remoting {
-class StreamSocketAdapter;
-class TransportChannelSocketAdapter;
-
namespace protocol {
class JingleSessionManager;
@@ -155,15 +157,15 @@ class JingleSession : public protocol::Session,
// then there is a SocketWrapper created over net::Socket.
// SSL socket uses SocketWrapper to provide SSL functionality.
cricket::PseudoTcpChannel* control_channel_;
- scoped_ptr<StreamSocketAdapter> control_channel_adapter_;
+ scoped_ptr<jingle_glue::StreamSocketAdapter> control_channel_adapter_;
scoped_ptr<SocketWrapper> control_ssl_socket_;
cricket::PseudoTcpChannel* event_channel_;
- scoped_ptr<StreamSocketAdapter> event_channel_adapter_;
+ scoped_ptr<jingle_glue::StreamSocketAdapter> event_channel_adapter_;
scoped_ptr<SocketWrapper> event_ssl_socket_;
cricket::PseudoTcpChannel* video_channel_;
- scoped_ptr<StreamSocketAdapter> video_channel_adapter_;
+ scoped_ptr<jingle_glue::StreamSocketAdapter> video_channel_adapter_;
scoped_ptr<SocketWrapper> video_ssl_socket_;
// Count the number of SSL connections esblished.
@@ -172,8 +174,8 @@ class JingleSession : public protocol::Session,
// Used to verify the certificate received in SSLClientSocket.
scoped_ptr<net::CertVerifier> cert_verifier_;
- scoped_ptr<TransportChannelSocketAdapter> video_rtp_channel_;
- scoped_ptr<TransportChannelSocketAdapter> video_rtcp_channel_;
+ scoped_ptr<jingle_glue::TransportChannelSocketAdapter> video_rtp_channel_;
+ scoped_ptr<jingle_glue::TransportChannelSocketAdapter> video_rtcp_channel_;
// Callback called by the SSL layer.
scoped_ptr<net::CompletionCallback> connect_callback_;
diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp
index a8edaf5..6f1e88c 100644
--- a/remoting/remoting.gyp
+++ b/remoting/remoting.gyp
@@ -362,8 +362,6 @@
'../third_party/libjingle/libjingle.gyp:libjingle_p2p',
],
'sources': [
- 'jingle_glue/channel_socket_adapter.cc',
- 'jingle_glue/channel_socket_adapter.h',
'jingle_glue/http_port_allocator.cc',
'jingle_glue/http_port_allocator.h',
'jingle_glue/iq_request.cc',
@@ -372,14 +370,10 @@
'jingle_glue/jingle_client.h',
'jingle_glue/jingle_thread.cc',
'jingle_glue/jingle_thread.h',
- 'jingle_glue/stream_socket_adapter.cc',
- 'jingle_glue/stream_socket_adapter.h',
'jingle_glue/ssl_adapter.h',
'jingle_glue/ssl_adapter.cc',
'jingle_glue/ssl_socket_adapter.cc',
'jingle_glue/ssl_socket_adapter.h',
- 'jingle_glue/utils.cc',
- 'jingle_glue/utils.h',
'jingle_glue/xmpp_proxy.h',
'jingle_glue/xmpp_socket_adapter.cc',
'jingle_glue/xmpp_socket_adapter.h',
@@ -392,6 +386,7 @@
'dependencies': [
'chromoting_base',
'chromoting_jingle_glue',
+ '../jingle/jingle.gyp:jingle_glue',
],
'export_dependent_settings': [
'chromoting_jingle_glue',
@@ -560,13 +555,9 @@
'host/json_host_config_unittest.cc',
'host/screen_recorder_unittest.cc',
'host/test_key_pair.h',
- 'jingle_glue/channel_socket_adapter_unittest.cc',
'jingle_glue/iq_request_unittest.cc',
'jingle_glue/jingle_client_unittest.cc',
- 'jingle_glue/jingle_glue_mock_objects.cc',
- 'jingle_glue/jingle_glue_mock_objects.h',
'jingle_glue/jingle_thread_unittest.cc',
- 'jingle_glue/stream_socket_adapter_unittest.cc',
'protocol/connection_to_client_unittest.cc',
'protocol/fake_session.cc',
'protocol/fake_session.h',