summaryrefslogtreecommitdiffstats
path: root/jingle/glue
diff options
context:
space:
mode:
authormallinath@chromium.org <mallinath@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-15 06:09:52 +0000
committermallinath@chromium.org <mallinath@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-15 06:09:52 +0000
commite6b239a0ac21b91422689f4e97910810e2884a09 (patch)
tree963835b5faf2768f0c6e4d6877d0396ba8bc458c /jingle/glue
parent178277c96c4dc1ab93e3be2adf73bc91256ba453 (diff)
downloadchromium_src-e6b239a0ac21b91422689f4e97910810e2884a09.zip
chromium_src-e6b239a0ac21b91422689f4e97910810e2884a09.tar.gz
chromium_src-e6b239a0ac21b91422689f4e97910810e2884a09.tar.bz2
Roll webrtc to r5549. Major change in this revision is addition of PacketOptions structure to every packet sent over network in AsyncPacketSocket::Send methods.
This structure has information about parameters required for packet authentication outside libsrtp. R=ronghuawu@chromium.org, sergeyu@chromium.org Review URL: https://codereview.chromium.org/167893002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251548 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle/glue')
-rw-r--r--jingle/glue/channel_socket_adapter.cc7
-rw-r--r--jingle/glue/channel_socket_adapter_unittest.cc8
-rw-r--r--jingle/glue/fake_socket_factory.cc6
-rw-r--r--jingle/glue/fake_socket_factory.h4
4 files changed, 12 insertions, 13 deletions
diff --git a/jingle/glue/channel_socket_adapter.cc b/jingle/glue/channel_socket_adapter.cc
index c9cfff1..40ed12c 100644
--- a/jingle/glue/channel_socket_adapter.cc
+++ b/jingle/glue/channel_socket_adapter.cc
@@ -76,9 +76,9 @@ int TransportChannelSocketAdapter::Write(
}
int result;
+ talk_base::PacketOptions options;
if (channel_->writable()) {
- result = channel_->SendPacket(buffer->data(), buffer_size,
- talk_base::DSCP_NO_CHANGE);
+ result = channel_->SendPacket(buffer->data(), buffer_size, options);
if (result < 0) {
result = net::MapSystemError(channel_->GetError());
@@ -172,9 +172,10 @@ void TransportChannelSocketAdapter::OnWritableState(
DCHECK_EQ(base::MessageLoop::current(), message_loop_);
// Try to send the packet if there is a pending write.
if (!write_callback_.is_null()) {
+ talk_base::PacketOptions options;
int result = channel_->SendPacket(write_buffer_->data(),
write_buffer_size_,
- talk_base::DSCP_NO_CHANGE);
+ options);
if (result < 0)
result = net::MapSystemError(channel_->GetError());
diff --git a/jingle/glue/channel_socket_adapter_unittest.cc b/jingle/glue/channel_socket_adapter_unittest.cc
index 7fcb5d1..436f8f7 100644
--- a/jingle/glue/channel_socket_adapter_unittest.cc
+++ b/jingle/glue/channel_socket_adapter_unittest.cc
@@ -36,7 +36,7 @@ class MockTransportChannel : public cricket::TransportChannel {
MOCK_METHOD4(SendPacket, int(const char* data,
size_t len,
- talk_base::DiffServCodePoint dscp,
+ const talk_base::PacketOptions& options,
int flags));
MOCK_METHOD2(SetOption, int(talk_base::Socket::Option opt, int value));
MOCK_METHOD0(GetError, int());
@@ -111,8 +111,7 @@ TEST_F(TransportChannelSocketAdapterTest, ReadClose) {
TEST_F(TransportChannelSocketAdapterTest, Write) {
scoped_refptr<IOBuffer> buffer(new IOBuffer(kTestDataSize));
- EXPECT_CALL(channel_, SendPacket(buffer->data(), kTestDataSize,
- talk_base::DSCP_NO_CHANGE, 0))
+ EXPECT_CALL(channel_, SendPacket(buffer->data(), kTestDataSize, _, 0))
.WillOnce(Return(kTestDataSize));
int result = target_->Write(buffer.get(), kTestDataSize, callback_);
@@ -124,8 +123,7 @@ TEST_F(TransportChannelSocketAdapterTest, Write) {
TEST_F(TransportChannelSocketAdapterTest, WritePending) {
scoped_refptr<IOBuffer> buffer(new IOBuffer(kTestDataSize));
- EXPECT_CALL(channel_, SendPacket(buffer->data(), kTestDataSize,
- talk_base::DSCP_NO_CHANGE, 0))
+ EXPECT_CALL(channel_, SendPacket(buffer->data(), kTestDataSize, _, 0))
.Times(1)
.WillOnce(Return(SOCKET_ERROR));
diff --git a/jingle/glue/fake_socket_factory.cc b/jingle/glue/fake_socket_factory.cc
index 38472c6..570c22f 100644
--- a/jingle/glue/fake_socket_factory.cc
+++ b/jingle/glue/fake_socket_factory.cc
@@ -35,14 +35,14 @@ talk_base::SocketAddress FakeUDPPacketSocket::GetRemoteAddress() const {
}
int FakeUDPPacketSocket::Send(const void *data, size_t data_size,
- talk_base::DiffServCodePoint dscp) {
+ const talk_base::PacketOptions& options) {
DCHECK(CalledOnValidThread());
- return SendTo(data, data_size, remote_address_, dscp);
+ return SendTo(data, data_size, remote_address_, options);
}
int FakeUDPPacketSocket::SendTo(const void *data, size_t data_size,
const talk_base::SocketAddress& address,
- talk_base::DiffServCodePoint dscp) {
+ const talk_base::PacketOptions& options) {
DCHECK(CalledOnValidThread());
if (state_ == IS_CLOSED) {
diff --git a/jingle/glue/fake_socket_factory.h b/jingle/glue/fake_socket_factory.h
index e9af78d..b46cdc6 100644
--- a/jingle/glue/fake_socket_factory.h
+++ b/jingle/glue/fake_socket_factory.h
@@ -39,10 +39,10 @@ class FakeUDPPacketSocket : public talk_base::AsyncPacketSocket,
virtual talk_base::SocketAddress GetLocalAddress() const OVERRIDE;
virtual talk_base::SocketAddress GetRemoteAddress() const OVERRIDE;
virtual int Send(const void *pv, size_t cb,
- talk_base::DiffServCodePoint dscp) OVERRIDE;
+ const talk_base::PacketOptions& options) OVERRIDE;
virtual int SendTo(const void *pv, size_t cb,
const talk_base::SocketAddress& addr,
- talk_base::DiffServCodePoint dscp) OVERRIDE;
+ const talk_base::PacketOptions& options) OVERRIDE;
virtual int Close() OVERRIDE;
virtual State GetState() const OVERRIDE;
virtual int GetOption(talk_base::Socket::Option opt, int* value) OVERRIDE;