Skip to content

Commit

Permalink
Update webrtc&libjingle 6774:6799.
Browse files Browse the repository at this point in the history
BUG=N/A
R=hellner@chromium.org
TBR=darin@chromium.org, hclam@chromium.org, jochen@chromium.org, palmer@chromium.org, sergeyu@chromium.org, wez@chromium.org


Commit on behalf of hellner@. Original CL tried and approved in https://codereview.chromium.org/429113002/

Review URL: https://codereview.chromium.org/429253003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286902 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
ronghuawu@chromium.org committed Jul 31, 2014
1 parent 00e1d27 commit bf45dff
Show file tree
Hide file tree
Showing 128 changed files with 943 additions and 1,609 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling WebRTC
# and V8 without interference from each other.
"webrtc_revision": "6774",
"webrtc_revision": "6799",
"jsoncpp_revision": "248",
"nss_revision": "277057",
# Three lines of non-changing comments so that
Expand Down
9 changes: 5 additions & 4 deletions content/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,18 @@ config("libjingle_stub_config") {
]

if (is_mac) {
defines += [ "OSX" ]
defines += [ "OSX", "WEBRTC_MAC" ]
} else if (is_linux) {
defines += [ "LINUX" ]
defines += [ "LINUX", "WEBRTC_LINUX" ]
} else if (is_android) {
defines += [ "ANDROID" ]
defines += [ "ANDROID", "WEBRTC_LINUX", "WEBRTC_ANDROID" ]
} else if (is_win) {
libs = [ "secur32.lib", "crypt32.lib", "iphlpapi.lib" ]
defines += [ "WEBRTC_WIN" ]
}

if (is_posix) {
defines += [ "POSIX" ]
defines += [ "POSIX", "WEBRTC_POSIX" ]
}
if (is_chromeos) {
defines += [ "CHROMEOS" ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ void P2PSocketDispatcherHost::OnAcceptIncomingTcpConnection(
void P2PSocketDispatcherHost::OnSend(int socket_id,
const net::IPEndPoint& socket_address,
const std::vector<char>& data,
const talk_base::PacketOptions& options,
const rtc::PacketOptions& options,
uint64 packet_id) {
P2PSocketHost* socket = LookupSocket(socket_id);
if (!socket) {
Expand Down
4 changes: 2 additions & 2 deletions content/browser/renderer_host/p2p/socket_dispatcher_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace net {
class URLRequestContextGetter;
}

namespace talk_base {
namespace rtc {
struct PacketOptions;
}

Expand Down Expand Up @@ -84,7 +84,7 @@ class P2PSocketDispatcherHost
void OnSend(int socket_id,
const net::IPEndPoint& socket_address,
const std::vector<char>& data,
const talk_base::PacketOptions& options,
const rtc::PacketOptions& options,
uint64 packet_id);
void OnSetOption(int socket_id, P2PSocketOption option, int value);
void OnDestroySocket(int socket_id);
Expand Down
26 changes: 13 additions & 13 deletions content/browser/renderer_host/p2p/socket_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/public/browser/browser_thread.h"
#include "crypto/hmac.h"
#include "third_party/libjingle/source/talk/base/asyncpacketsocket.h"
#include "third_party/libjingle/source/talk/base/byteorder.h"
#include "third_party/libjingle/source/talk/base/messagedigest.h"
#include "third_party/libjingle/source/talk/p2p/base/stun.h"
#include "third_party/webrtc/base/asyncpacketsocket.h"
#include "third_party/webrtc/base/byteorder.h"
#include "third_party/webrtc/base/messagedigest.h"

namespace {

Expand Down Expand Up @@ -48,7 +48,7 @@ bool IsRtcpPacket(const char* data) {
}

bool IsTurnSendIndicationPacket(const char* data) {
uint16 type = talk_base::GetBE16(data);
uint16 type = rtc::GetBE16(data);
return (type == cricket::TURN_SEND_INDICATION);
}

Expand Down Expand Up @@ -80,7 +80,7 @@ bool ValidateRtpHeader(const char* rtp, int length, size_t* header_length) {

// Getting extension profile length.
// Length is in 32 bit words.
uint16 extn_length = talk_base::GetBE16(rtp + 2) * 4;
uint16 extn_length = rtc::GetBE16(rtp + 2) * 4;

// Verify input length against total header size.
if (rtp_hdr_len_without_extn + kRtpExtnHdrLen + extn_length > length) {
Expand Down Expand Up @@ -129,7 +129,7 @@ void UpdateAbsSendTimeExtnValue(char* extn_data, int len,
// Assumes |len| is actual packet length + tag length. Updates HMAC at end of
// the RTP packet.
void UpdateRtpAuthTag(char* rtp, int len,
const talk_base::PacketOptions& options) {
const rtc::PacketOptions& options) {
// If there is no key, return.
if (options.packet_time_params.srtp_auth_key.empty())
return;
Expand Down Expand Up @@ -176,7 +176,7 @@ namespace content {
namespace packet_processing_helpers {

bool ApplyPacketOptions(char* data, int length,
const talk_base::PacketOptions& options,
const rtc::PacketOptions& options,
uint32 abs_send_time) {
DCHECK(data != NULL);
DCHECK(length > 0);
Expand Down Expand Up @@ -239,7 +239,7 @@ bool GetRtpPacketStartPositionAndLength(const char* packet,
}

rtp_begin = kTurnChannelHdrLen;
rtp_length = talk_base::GetBE16(&packet[2]);
rtp_length = rtc::GetBE16(&packet[2]);
if (length < rtp_length + kTurnChannelHdrLen) {
return false;
}
Expand All @@ -249,7 +249,7 @@ bool GetRtpPacketStartPositionAndLength(const char* packet,
return false;
}
// Validate STUN message length.
int stun_msg_len = talk_base::GetBE16(&packet[2]);
int stun_msg_len = rtc::GetBE16(&packet[2]);
if (stun_msg_len + P2PSocketHost::kStunHeaderSize != length) {
return false;
}
Expand All @@ -275,8 +275,8 @@ bool GetRtpPacketStartPositionAndLength(const char* packet,
// padding bits are ignored, and may be any value.
uint16 attr_type, attr_length;
// Getting attribute type and length.
attr_type = talk_base::GetBE16(&packet[rtp_begin]);
attr_length = talk_base::GetBE16(
attr_type = rtc::GetBE16(&packet[rtp_begin]);
attr_length = rtc::GetBE16(
&packet[rtp_begin + sizeof(attr_type)]);
// Checking for bogus attribute length.
if (length < attr_length + rtp_begin) {
Expand Down Expand Up @@ -353,9 +353,9 @@ bool UpdateRtpAbsSendTimeExtn(char* rtp, int length,
rtp += rtp_hdr_len_without_extn;

// Getting extension profile ID and length.
uint16 profile_id = talk_base::GetBE16(rtp);
uint16 profile_id = rtc::GetBE16(rtp);
// Length is in 32 bit words.
uint16 extn_length = talk_base::GetBE16(rtp + 2) * 4;
uint16 extn_length = rtc::GetBE16(rtp + 2) * 4;

rtp += kRtpExtnHdrLen; // Moving past extn header.

Expand Down
6 changes: 3 additions & 3 deletions content/browser/renderer_host/p2p/socket_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace net {
class URLRequestContextGetter;
}

namespace talk_base {
namespace rtc {
struct PacketOptions;
}

Expand All @@ -34,7 +34,7 @@ namespace packet_processing_helpers {
// if present with current time and 2. update HMAC in RTP packet.
// If abs_send_time is 0, ApplyPacketOption will get current time from system.
CONTENT_EXPORT bool ApplyPacketOptions(char* data, int length,
const talk_base::PacketOptions& options,
const rtc::PacketOptions& options,
uint32 abs_send_time);

// Helper method which finds RTP ofset and length if the packet is encapsulated
Expand Down Expand Up @@ -70,7 +70,7 @@ class CONTENT_EXPORT P2PSocketHost {
// Sends |data| on the socket to |to|.
virtual void Send(const net::IPEndPoint& to,
const std::vector<char>& data,
const talk_base::PacketOptions& options,
const rtc::PacketOptions& options,
uint64 packet_id) = 0;

virtual P2PSocketHost* AcceptIncomingTcpConnection(
Expand Down
8 changes: 4 additions & 4 deletions content/browser/renderer_host/p2p/socket_host_tcp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "net/socket/tcp_client_socket.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
#include "third_party/libjingle/source/talk/base/asyncpacketsocket.h"
#include "third_party/webrtc/base/asyncpacketsocket.h"

namespace {

Expand Down Expand Up @@ -323,7 +323,7 @@ void P2PSocketHostTcpBase::OnPacket(const std::vector<char>& data) {
// but may be honored in the future.
void P2PSocketHostTcpBase::Send(const net::IPEndPoint& to,
const std::vector<char>& data,
const talk_base::PacketOptions& options,
const rtc::PacketOptions& options,
uint64 packet_id) {
if (!socket_) {
// The Send message may be sent after the an OnError message was
Expand Down Expand Up @@ -483,7 +483,7 @@ int P2PSocketHostTcp::ProcessInput(char* input, int input_len) {

void P2PSocketHostTcp::DoSend(const net::IPEndPoint& to,
const std::vector<char>& data,
const talk_base::PacketOptions& options) {
const rtc::PacketOptions& options) {
int size = kPacketHeaderSize + data.size();
scoped_refptr<net::DrainableIOBuffer> buffer =
new net::DrainableIOBuffer(new net::IOBuffer(size), size);
Expand Down Expand Up @@ -536,7 +536,7 @@ int P2PSocketHostStunTcp::ProcessInput(char* input, int input_len) {

void P2PSocketHostStunTcp::DoSend(const net::IPEndPoint& to,
const std::vector<char>& data,
const talk_base::PacketOptions& options) {
const rtc::PacketOptions& options) {
// Each packet is expected to have header (STUN/TURN ChannelData), where
// header contains message type and and length of message.
if (data.size() < kPacketHeaderSize + kPacketLengthOffset) {
Expand Down
8 changes: 4 additions & 4 deletions content/browser/renderer_host/p2p/socket_host_tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CONTENT_EXPORT P2PSocketHostTcpBase : public P2PSocketHost {
const P2PHostAndIPEndPoint& remote_address) OVERRIDE;
virtual void Send(const net::IPEndPoint& to,
const std::vector<char>& data,
const talk_base::PacketOptions& options,
const rtc::PacketOptions& options,
uint64 packet_id) OVERRIDE;
virtual P2PSocketHost* AcceptIncomingTcpConnection(
const net::IPEndPoint& remote_address, int id) OVERRIDE;
Expand All @@ -53,7 +53,7 @@ class CONTENT_EXPORT P2PSocketHostTcpBase : public P2PSocketHost {
virtual int ProcessInput(char* input, int input_len) = 0;
virtual void DoSend(const net::IPEndPoint& to,
const std::vector<char>& data,
const talk_base::PacketOptions& options) = 0;
const rtc::PacketOptions& options) = 0;

void WriteOrQueue(scoped_refptr<net::DrainableIOBuffer>& buffer);
void OnPacket(const std::vector<char>& data);
Expand Down Expand Up @@ -110,7 +110,7 @@ class CONTENT_EXPORT P2PSocketHostTcp : public P2PSocketHostTcpBase {
virtual int ProcessInput(char* input, int input_len) OVERRIDE;
virtual void DoSend(const net::IPEndPoint& to,
const std::vector<char>& data,
const talk_base::PacketOptions& options) OVERRIDE;
const rtc::PacketOptions& options) OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(P2PSocketHostTcp);
};
Expand All @@ -132,7 +132,7 @@ class CONTENT_EXPORT P2PSocketHostStunTcp : public P2PSocketHostTcpBase {
virtual int ProcessInput(char* input, int input_len) OVERRIDE;
virtual void DoSend(const net::IPEndPoint& to,
const std::vector<char>& data,
const talk_base::PacketOptions& options) OVERRIDE;
const rtc::PacketOptions& options) OVERRIDE;
private:
int GetExpectedPacketSize(const char* data, int len, int* pad_bytes);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void P2PSocketHostTcpServer::OnAccepted(int result) {

void P2PSocketHostTcpServer::Send(const net::IPEndPoint& to,
const std::vector<char>& data,
const talk_base::PacketOptions& options,
const rtc::PacketOptions& options,
uint64 packet_id) {
NOTREACHED();
OnError();
Expand Down
2 changes: 1 addition & 1 deletion content/browser/renderer_host/p2p/socket_host_tcp_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CONTENT_EXPORT P2PSocketHostTcpServer : public P2PSocketHost {
const P2PHostAndIPEndPoint& remote_address) OVERRIDE;
virtual void Send(const net::IPEndPoint& to,
const std::vector<char>& data,
const talk_base::PacketOptions& options,
const rtc::PacketOptions& options,
uint64 packet_id) OVERRIDE;
virtual P2PSocketHost* AcceptIncomingTcpConnection(
const net::IPEndPoint& remote_address, int id) OVERRIDE;
Expand Down
20 changes: 10 additions & 10 deletions content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ TEST_F(P2PSocketHostTcpTest, SendStunNoAuth) {
.Times(3)
.WillRepeatedly(DoAll(DeleteArg<0>(), Return(true)));

talk_base::PacketOptions options;
rtc::PacketOptions options;
std::vector<char> packet1;
CreateStunRequest(&packet1);
socket_host_->Send(dest_.ip_address, packet1, options, 0);
Expand Down Expand Up @@ -121,7 +121,7 @@ TEST_F(P2PSocketHostTcpTest, ReceiveStun) {
.Times(3)
.WillRepeatedly(DoAll(DeleteArg<0>(), Return(true)));

talk_base::PacketOptions options;
rtc::PacketOptions options;
std::vector<char> packet1;
CreateStunRequest(&packet1);
socket_host_->Send(dest_.ip_address, packet1, options, 0);
Expand Down Expand Up @@ -168,7 +168,7 @@ TEST_F(P2PSocketHostTcpTest, SendDataNoAuth) {
MatchMessage(static_cast<uint32>(P2PMsg_OnError::ID))))
.WillOnce(DoAll(DeleteArg<0>(), Return(true)));

talk_base::PacketOptions options;
rtc::PacketOptions options;
std::vector<char> packet;
CreateRandomPacket(&packet);
socket_host_->Send(dest_.ip_address, packet, options, 0);
Expand All @@ -194,7 +194,7 @@ TEST_F(P2PSocketHostTcpTest, SendAfterStunRequest) {
.WillOnce(DoAll(DeleteArg<0>(), Return(true)));
socket_->AppendInputData(&received_data[0], received_data.size());

talk_base::PacketOptions options;
rtc::PacketOptions options;
// Now we should be able to send any data to |dest_|.
std::vector<char> packet;
CreateRandomPacket(&packet);
Expand All @@ -218,7 +218,7 @@ TEST_F(P2PSocketHostTcpTest, AsyncWrites) {
.Times(2)
.WillRepeatedly(DoAll(DeleteArg<0>(), Return(true)));

talk_base::PacketOptions options;
rtc::PacketOptions options;
std::vector<char> packet1;
CreateStunRequest(&packet1);

Expand Down Expand Up @@ -254,7 +254,7 @@ TEST_F(P2PSocketHostTcpTest, SendDataWithPacketOptions) {
.WillOnce(DoAll(DeleteArg<0>(), Return(true)));
socket_->AppendInputData(&received_data[0], received_data.size());

talk_base::PacketOptions options;
rtc::PacketOptions options;
options.packet_time_params.rtp_sendtime_extension_id = 3;
// Now we should be able to send any data to |dest_|.
std::vector<char> packet;
Expand All @@ -278,7 +278,7 @@ TEST_F(P2PSocketHostStunTcpTest, SendStunNoAuth) {
.Times(3)
.WillRepeatedly(DoAll(DeleteArg<0>(), Return(true)));

talk_base::PacketOptions options;
rtc::PacketOptions options;
std::vector<char> packet1;
CreateStunRequest(&packet1);
socket_host_->Send(dest_.ip_address, packet1, options, 0);
Expand Down Expand Up @@ -307,7 +307,7 @@ TEST_F(P2PSocketHostStunTcpTest, ReceiveStun) {
.Times(3)
.WillRepeatedly(DoAll(DeleteArg<0>(), Return(true)));

talk_base::PacketOptions options;
rtc::PacketOptions options;
std::vector<char> packet1;
CreateStunRequest(&packet1);
socket_host_->Send(dest_.ip_address, packet1, options, 0);
Expand Down Expand Up @@ -351,7 +351,7 @@ TEST_F(P2PSocketHostStunTcpTest, SendDataNoAuth) {
MatchMessage(static_cast<uint32>(P2PMsg_OnError::ID))))
.WillOnce(DoAll(DeleteArg<0>(), Return(true)));

talk_base::PacketOptions options;
rtc::PacketOptions options;
std::vector<char> packet;
CreateRandomPacket(&packet);
socket_host_->Send(dest_.ip_address, packet, options, 0);
Expand All @@ -370,7 +370,7 @@ TEST_F(P2PSocketHostStunTcpTest, AsyncWrites) {
.Times(2)
.WillRepeatedly(DoAll(DeleteArg<0>(), Return(true)));

talk_base::PacketOptions options;
rtc::PacketOptions options;
std::vector<char> packet1;
CreateStunRequest(&packet1);
socket_host_->Send(dest_.ip_address, packet1, options, 0);
Expand Down
12 changes: 6 additions & 6 deletions content/browser/renderer_host/p2p/socket_host_throttler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// found in the LICENSE file.

#include "content/browser/renderer_host/p2p/socket_host_throttler.h"
#include "third_party/libjingle/source/talk/base/ratelimiter.h"
#include "third_party/libjingle/source/talk/base/timing.h"
#include "third_party/webrtc/base/ratelimiter.h"
#include "third_party/webrtc/base/timing.h"

namespace content {

Expand All @@ -16,19 +16,19 @@ const int kMaxIceMessageBandwidth = 256 * 1024;


P2PMessageThrottler::P2PMessageThrottler()
: timing_(new talk_base::Timing()),
rate_limiter_(new talk_base::RateLimiter(kMaxIceMessageBandwidth, 1.0)) {
: timing_(new rtc::Timing()),
rate_limiter_(new rtc::RateLimiter(kMaxIceMessageBandwidth, 1.0)) {
}

P2PMessageThrottler::~P2PMessageThrottler() {
}

void P2PMessageThrottler::SetTiming(scoped_ptr<talk_base::Timing> timing) {
void P2PMessageThrottler::SetTiming(scoped_ptr<rtc::Timing> timing) {
timing_ = timing.Pass();
}

void P2PMessageThrottler::SetSendIceBandwidth(int bandwidth_kbps) {
rate_limiter_.reset(new talk_base::RateLimiter(bandwidth_kbps, 1.0));
rate_limiter_.reset(new rtc::RateLimiter(bandwidth_kbps, 1.0));
}

bool P2PMessageThrottler::DropNextPacket(size_t packet_len) {
Expand Down
Loading

0 comments on commit bf45dff

Please sign in to comment.