diff options
author | ronghuawu@chromium.org <ronghuawu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-06 16:48:16 +0000 |
---|---|---|
committer | ronghuawu@chromium.org <ronghuawu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-06 16:48:16 +0000 |
commit | e758d4cabf8a5ba6b1cc7a5c50ba332dd22cd55b (patch) | |
tree | 795415902e6998ef5ee9797a06801c6fd1c8e055 | |
parent | ae2dfa8a611aa8d7301fcc3765c24b1f5fa8c9c5 (diff) | |
download | chromium_src-e758d4cabf8a5ba6b1cc7a5c50ba332dd22cd55b.zip chromium_src-e758d4cabf8a5ba6b1cc7a5c50ba332dd22cd55b.tar.gz chromium_src-e758d4cabf8a5ba6b1cc7a5c50ba332dd22cd55b.tar.bz2 |
Update webrtc&libjingle 6774:6825.
BUG=N/A
R=hellner@chromium.org
TBR=darin@chromium.org, hclam@chromium.org, jochen@chromium.org, palmer@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/450463002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287788 0039d316-1c4b-4281-b951-d872f2087c98
128 files changed, 943 insertions, 1609 deletions
@@ -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": "6825", "jsoncpp_revision": "248", "nss_revision": "287121", # Three lines of non-changing comments so that diff --git a/content/BUILD.gn b/content/BUILD.gn index a49a887..a2bd489 100644 --- a/content/BUILD.gn +++ b/content/BUILD.gn @@ -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" ] diff --git a/content/browser/renderer_host/p2p/socket_dispatcher_host.cc b/content/browser/renderer_host/p2p/socket_dispatcher_host.cc index bb8c1fb..8bab6af 100644 --- a/content/browser/renderer_host/p2p/socket_dispatcher_host.cc +++ b/content/browser/renderer_host/p2p/socket_dispatcher_host.cc @@ -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) { diff --git a/content/browser/renderer_host/p2p/socket_dispatcher_host.h b/content/browser/renderer_host/p2p/socket_dispatcher_host.h index 21376bd..11045f56 100644 --- a/content/browser/renderer_host/p2p/socket_dispatcher_host.h +++ b/content/browser/renderer_host/p2p/socket_dispatcher_host.h @@ -22,7 +22,7 @@ namespace net { class URLRequestContextGetter; } -namespace talk_base { +namespace rtc { struct PacketOptions; } @@ -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); diff --git a/content/browser/renderer_host/p2p/socket_host.cc b/content/browser/renderer_host/p2p/socket_host.cc index 5fc3818..fd26298 100644 --- a/content/browser/renderer_host/p2p/socket_host.cc +++ b/content/browser/renderer_host/p2p/socket_host.cc @@ -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 { @@ -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); } @@ -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) { @@ -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; @@ -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); @@ -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; } @@ -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; } @@ -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) { @@ -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. diff --git a/content/browser/renderer_host/p2p/socket_host.h b/content/browser/renderer_host/p2p/socket_host.h index bfcbbd2..86eff5d 100644 --- a/content/browser/renderer_host/p2p/socket_host.h +++ b/content/browser/renderer_host/p2p/socket_host.h @@ -20,7 +20,7 @@ namespace net { class URLRequestContextGetter; } -namespace talk_base { +namespace rtc { struct PacketOptions; } @@ -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 @@ -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( diff --git a/content/browser/renderer_host/p2p/socket_host_tcp.cc b/content/browser/renderer_host/p2p/socket_host_tcp.cc index a5aac2f..2955b61 100644 --- a/content/browser/renderer_host/p2p/socket_host_tcp.cc +++ b/content/browser/renderer_host/p2p/socket_host_tcp.cc @@ -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 { @@ -330,7 +330,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 @@ -490,7 +490,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); @@ -543,7 +543,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) { diff --git a/content/browser/renderer_host/p2p/socket_host_tcp.h b/content/browser/renderer_host/p2p/socket_host_tcp.h index f5ff8633..005bebb 100644 --- a/content/browser/renderer_host/p2p/socket_host_tcp.h +++ b/content/browser/renderer_host/p2p/socket_host_tcp.h @@ -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; @@ -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); @@ -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); }; @@ -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); diff --git a/content/browser/renderer_host/p2p/socket_host_tcp_server.cc b/content/browser/renderer_host/p2p/socket_host_tcp_server.cc index f3c4290..1017828 100644 --- a/content/browser/renderer_host/p2p/socket_host_tcp_server.cc +++ b/content/browser/renderer_host/p2p/socket_host_tcp_server.cc @@ -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(); diff --git a/content/browser/renderer_host/p2p/socket_host_tcp_server.h b/content/browser/renderer_host/p2p/socket_host_tcp_server.h index e050b00..72ce6443 100644 --- a/content/browser/renderer_host/p2p/socket_host_tcp_server.h +++ b/content/browser/renderer_host/p2p/socket_host_tcp_server.h @@ -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; diff --git a/content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc b/content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc index 24b77c3..f2d6146 100644 --- a/content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc +++ b/content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc @@ -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); @@ -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); @@ -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); @@ -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); @@ -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); @@ -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; @@ -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); @@ -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); @@ -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); @@ -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); diff --git a/content/browser/renderer_host/p2p/socket_host_throttler.cc b/content/browser/renderer_host/p2p/socket_host_throttler.cc index 50a4dd0..0ef92eb 100644 --- a/content/browser/renderer_host/p2p/socket_host_throttler.cc +++ b/content/browser/renderer_host/p2p/socket_host_throttler.cc @@ -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 { @@ -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) { diff --git a/content/browser/renderer_host/p2p/socket_host_throttler.h b/content/browser/renderer_host/p2p/socket_host_throttler.h index 166d300..a28a588 100644 --- a/content/browser/renderer_host/p2p/socket_host_throttler.h +++ b/content/browser/renderer_host/p2p/socket_host_throttler.h @@ -8,7 +8,7 @@ #include "base/memory/scoped_ptr.h" #include "content/common/content_export.h" -namespace talk_base { +namespace rtc { class RateLimiter; class Timing; } @@ -24,13 +24,13 @@ class CONTENT_EXPORT P2PMessageThrottler { P2PMessageThrottler(); virtual ~P2PMessageThrottler(); - void SetTiming(scoped_ptr<talk_base::Timing> timing); + void SetTiming(scoped_ptr<rtc::Timing> timing); bool DropNextPacket(size_t packet_len); void SetSendIceBandwidth(int bandwith_kbps); private: - scoped_ptr<talk_base::Timing> timing_; - scoped_ptr<talk_base::RateLimiter> rate_limiter_; + scoped_ptr<rtc::Timing> timing_; + scoped_ptr<rtc::RateLimiter> rate_limiter_; DISALLOW_COPY_AND_ASSIGN(P2PMessageThrottler); }; diff --git a/content/browser/renderer_host/p2p/socket_host_udp.cc b/content/browser/renderer_host/p2p/socket_host_udp.cc index 2af80aa..3833b62 100644 --- a/content/browser/renderer_host/p2p/socket_host_udp.cc +++ b/content/browser/renderer_host/p2p/socket_host_udp.cc @@ -15,7 +15,7 @@ #include "net/base/io_buffer.h" #include "net/base/net_errors.h" #include "net/base/net_util.h" -#include "third_party/libjingle/source/talk/base/asyncpacketsocket.h" +#include "third_party/webrtc/base/asyncpacketsocket.h" namespace { @@ -52,7 +52,7 @@ namespace content { P2PSocketHostUdp::PendingPacket::PendingPacket( const net::IPEndPoint& to, const std::vector<char>& content, - const talk_base::PacketOptions& options, + const rtc::PacketOptions& options, uint64 id) : to(to), data(new net::IOBuffer(content.size())), @@ -186,7 +186,7 @@ void P2PSocketHostUdp::HandleReadResult(int result) { void P2PSocketHostUdp::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 diff --git a/content/browser/renderer_host/p2p/socket_host_udp.h b/content/browser/renderer_host/p2p/socket_host_udp.h index b22795c..761ef1e 100644 --- a/content/browser/renderer_host/p2p/socket_host_udp.h +++ b/content/browser/renderer_host/p2p/socket_host_udp.h @@ -18,7 +18,7 @@ #include "content/common/p2p_socket_type.h" #include "net/base/ip_endpoint.h" #include "net/udp/udp_server_socket.h" -#include "third_party/libjingle/source/talk/base/asyncpacketsocket.h" +#include "third_party/webrtc/base/asyncpacketsocket.h" namespace content { @@ -36,7 +36,7 @@ class CONTENT_EXPORT P2PSocketHostUdp : 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; @@ -50,13 +50,13 @@ class CONTENT_EXPORT P2PSocketHostUdp : public P2PSocketHost { struct PendingPacket { PendingPacket(const net::IPEndPoint& to, const std::vector<char>& content, - const talk_base::PacketOptions& options, + const rtc::PacketOptions& options, uint64 id); ~PendingPacket(); net::IPEndPoint to; scoped_refptr<net::IOBuffer> data; int size; - talk_base::PacketOptions packet_options; + rtc::PacketOptions packet_options; uint64 id; }; diff --git a/content/browser/renderer_host/p2p/socket_host_udp_unittest.cc b/content/browser/renderer_host/p2p/socket_host_udp_unittest.cc index 6235cb0..2220471 100644 --- a/content/browser/renderer_host/p2p/socket_host_udp_unittest.cc +++ b/content/browser/renderer_host/p2p/socket_host_udp_unittest.cc @@ -17,7 +17,7 @@ #include "net/udp/datagram_server_socket.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/libjingle/source/talk/base/timing.h" +#include "third_party/webrtc/base/timing.h" using ::testing::_; using ::testing::DeleteArg; @@ -26,7 +26,7 @@ using ::testing::Return; namespace { -class FakeTiming : public talk_base::Timing { +class FakeTiming : public rtc::Timing { public: FakeTiming() : now_(0.0) {} virtual double TimerNow() OVERRIDE { return now_; } @@ -197,7 +197,7 @@ class P2PSocketHostUdpTest : public testing::Test { dest1_ = ParseAddress(kTestIpAddress1, kTestPort1); dest2_ = ParseAddress(kTestIpAddress2, kTestPort2); - scoped_ptr<talk_base::Timing> timing(new FakeTiming()); + scoped_ptr<rtc::Timing> timing(new FakeTiming()); throttler_.SetTiming(timing.Pass()); } @@ -221,7 +221,7 @@ TEST_F(P2PSocketHostUdpTest, 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(dest1_, packet1, options, 0); @@ -247,7 +247,7 @@ TEST_F(P2PSocketHostUdpTest, 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(dest1_, packet, options, 0); @@ -271,7 +271,7 @@ TEST_F(P2PSocketHostUdpTest, SendAfterStunRequest) { MatchMessage(static_cast<uint32>(P2PMsg_OnSendComplete::ID)))) .WillOnce(DoAll(DeleteArg<0>(), Return(true))); - talk_base::PacketOptions options; + rtc::PacketOptions options; std::vector<char> packet; CreateRandomPacket(&packet); socket_host_->Send(dest1_, packet, options, 0); @@ -296,7 +296,7 @@ TEST_F(P2PSocketHostUdpTest, SendAfterStunResponse) { MatchMessage(static_cast<uint32>(P2PMsg_OnSendComplete::ID)))) .WillOnce(DoAll(DeleteArg<0>(), Return(true))); - talk_base::PacketOptions options; + rtc::PacketOptions options; std::vector<char> packet; CreateRandomPacket(&packet); socket_host_->Send(dest1_, packet, options, 0); @@ -317,7 +317,7 @@ TEST_F(P2PSocketHostUdpTest, SendAfterStunResponseDifferentHost) { socket_->ReceivePacket(dest1_, request_packet); // Should fail when trying to send the same packet to |dest2_|. - talk_base::PacketOptions options; + rtc::PacketOptions options; std::vector<char> packet; CreateRandomPacket(&packet); EXPECT_CALL(sender_, Send( @@ -334,7 +334,7 @@ TEST_F(P2PSocketHostUdpTest, ThrottleAfterLimit) { .Times(2) .WillRepeatedly(DoAll(DeleteArg<0>(), Return(true))); - talk_base::PacketOptions options; + rtc::PacketOptions options; std::vector<char> packet1; CreateStunRequest(&packet1); throttler_.SetSendIceBandwidth(packet1.size() * 2); @@ -363,7 +363,7 @@ TEST_F(P2PSocketHostUdpTest, ThrottleAfterLimitAfterReceive) { .Times(4) .WillRepeatedly(DoAll(DeleteArg<0>(), Return(true))); - talk_base::PacketOptions options; + rtc::PacketOptions options; std::vector<char> packet1; CreateStunRequest(&packet1); throttler_.SetSendIceBandwidth(packet1.size()); diff --git a/content/browser/renderer_host/p2p/socket_host_unittest.cc b/content/browser/renderer_host/p2p/socket_host_unittest.cc index 1404ced..fc96e4a 100644 --- a/content/browser/renderer_host/p2p/socket_host_unittest.cc +++ b/content/browser/renderer_host/p2p/socket_host_unittest.cc @@ -297,7 +297,7 @@ TEST(P2PSocketHostTest, TestUpdateAbsSendTimeExtensionInTurnSendIndication) { // without HMAC value in the packet. TEST(P2PSocketHostTest, TestApplyPacketOptionsWithDefaultValues) { unsigned char fake_tag[4] = { 0xba, 0xdd, 0xba, 0xdd }; - talk_base::PacketOptions options; + rtc::PacketOptions options; std::vector<char> rtp_packet; rtp_packet.resize(sizeof(kRtpMsgWithAbsSendTimeExtension) + 4); // tag length memcpy(&rtp_packet[0], kRtpMsgWithAbsSendTimeExtension, @@ -317,7 +317,7 @@ TEST(P2PSocketHostTest, TestApplyPacketOptionsWithDefaultValues) { // Veirfy HMAC is updated when packet option parameters are set. TEST(P2PSocketHostTest, TestApplyPacketOptionsWithAuthParams) { - talk_base::PacketOptions options; + rtc::PacketOptions options; options.packet_time_params.srtp_auth_key.resize(20); options.packet_time_params.srtp_auth_key.assign( kTestKey, kTestKey + sizeof(kTestKey)); @@ -348,7 +348,7 @@ TEST(P2PSocketHostTest, TestUpdateAbsSendTimeExtensionInRtpPacket) { // Verify we update both AbsSendTime extension header and HMAC. TEST(P2PSocketHostTest, TestApplyPacketOptionsWithAuthParamsAndAbsSendTime) { - talk_base::PacketOptions options; + rtc::PacketOptions options; options.packet_time_params.srtp_auth_key.resize(20); options.packet_time_params.srtp_auth_key.assign( kTestKey, kTestKey + sizeof(kTestKey)); diff --git a/content/common/p2p_messages.h b/content/common/p2p_messages.h index 26846dd..d01807f 100644 --- a/content/common/p2p_messages.h +++ b/content/common/p2p_messages.h @@ -10,7 +10,7 @@ #include "content/common/p2p_socket_type.h" #include "ipc/ipc_message_macros.h" #include "net/base/net_util.h" -#include "third_party/libjingle/source/talk/base/asyncpacketsocket.h" +#include "third_party/webrtc/base/asyncpacketsocket.h" #undef IPC_MESSAGE_EXPORT #define IPC_MESSAGE_EXPORT CONTENT_EXPORT @@ -20,9 +20,9 @@ IPC_ENUM_TRAITS_MAX_VALUE(content::P2PSocketType, content::P2P_SOCKET_TYPE_LAST) IPC_ENUM_TRAITS_MAX_VALUE(content::P2PSocketOption, content::P2P_SOCKET_OPT_MAX - 1) -IPC_ENUM_TRAITS_MIN_MAX_VALUE(talk_base::DiffServCodePoint, - talk_base::DSCP_NO_CHANGE, - talk_base::DSCP_CS7) +IPC_ENUM_TRAITS_MIN_MAX_VALUE(rtc::DiffServCodePoint, + rtc::DSCP_NO_CHANGE, + rtc::DSCP_CS7) IPC_STRUCT_TRAITS_BEGIN(net::NetworkInterface) IPC_STRUCT_TRAITS_MEMBER(name) @@ -30,14 +30,14 @@ IPC_STRUCT_TRAITS_BEGIN(net::NetworkInterface) IPC_STRUCT_TRAITS_MEMBER(address) IPC_STRUCT_TRAITS_END() -IPC_STRUCT_TRAITS_BEGIN(talk_base::PacketTimeUpdateParams) +IPC_STRUCT_TRAITS_BEGIN(rtc::PacketTimeUpdateParams) IPC_STRUCT_TRAITS_MEMBER(rtp_sendtime_extension_id) IPC_STRUCT_TRAITS_MEMBER(srtp_auth_key) IPC_STRUCT_TRAITS_MEMBER(srtp_auth_tag_len) IPC_STRUCT_TRAITS_MEMBER(srtp_packet_index) IPC_STRUCT_TRAITS_END() -IPC_STRUCT_TRAITS_BEGIN(talk_base::PacketOptions) +IPC_STRUCT_TRAITS_BEGIN(rtc::PacketOptions) IPC_STRUCT_TRAITS_MEMBER(dscp) IPC_STRUCT_TRAITS_MEMBER(packet_time_params) IPC_STRUCT_TRAITS_END() @@ -104,7 +104,7 @@ IPC_MESSAGE_CONTROL5(P2PHostMsg_Send, int /* socket_id */, net::IPEndPoint /* socket_address */, std::vector<char> /* data */, - talk_base::PacketOptions /* packet options */, + rtc::PacketOptions /* packet options */, uint64 /* packet_id */) IPC_MESSAGE_CONTROL1(P2PHostMsg_DestroySocket, diff --git a/content/renderer/media/media_stream_audio_processor_unittest.cc b/content/renderer/media/media_stream_audio_processor_unittest.cc index 267d1d2..867d48a 100644 --- a/content/renderer/media/media_stream_audio_processor_unittest.cc +++ b/content/renderer/media/media_stream_audio_processor_unittest.cc @@ -162,7 +162,7 @@ TEST_F(MediaStreamAudioProcessorTest, WithoutAudioProcessing) { scoped_refptr<WebRtcAudioDeviceImpl> webrtc_audio_device( new WebRtcAudioDeviceImpl()); scoped_refptr<MediaStreamAudioProcessor> audio_processor( - new talk_base::RefCountedObject<MediaStreamAudioProcessor>( + new rtc::RefCountedObject<MediaStreamAudioProcessor>( constraint_factory.CreateWebMediaConstraints(), 0, webrtc_audio_device.get())); EXPECT_FALSE(audio_processor->has_audio_processing()); @@ -182,7 +182,7 @@ TEST_F(MediaStreamAudioProcessorTest, WithAudioProcessing) { scoped_refptr<WebRtcAudioDeviceImpl> webrtc_audio_device( new WebRtcAudioDeviceImpl()); scoped_refptr<MediaStreamAudioProcessor> audio_processor( - new talk_base::RefCountedObject<MediaStreamAudioProcessor>( + new rtc::RefCountedObject<MediaStreamAudioProcessor>( constraint_factory.CreateWebMediaConstraints(), 0, webrtc_audio_device.get())); EXPECT_TRUE(audio_processor->has_audio_processing()); @@ -207,7 +207,7 @@ TEST_F(MediaStreamAudioProcessorTest, VerifyTabCaptureWithoutAudioProcessing) { tab_constraint_factory.AddMandatory(kMediaStreamSource, tab_string); scoped_refptr<MediaStreamAudioProcessor> audio_processor( - new talk_base::RefCountedObject<MediaStreamAudioProcessor>( + new rtc::RefCountedObject<MediaStreamAudioProcessor>( tab_constraint_factory.CreateWebMediaConstraints(), 0, webrtc_audio_device.get())); EXPECT_FALSE(audio_processor->has_audio_processing()); @@ -224,7 +224,7 @@ TEST_F(MediaStreamAudioProcessorTest, VerifyTabCaptureWithoutAudioProcessing) { const std::string system_string = kMediaStreamSourceSystem; system_constraint_factory.AddMandatory(kMediaStreamSource, system_string); - audio_processor = new talk_base::RefCountedObject<MediaStreamAudioProcessor>( + audio_processor = new rtc::RefCountedObject<MediaStreamAudioProcessor>( system_constraint_factory.CreateWebMediaConstraints(), 0, webrtc_audio_device.get()); EXPECT_FALSE(audio_processor->has_audio_processing()); @@ -241,7 +241,7 @@ TEST_F(MediaStreamAudioProcessorTest, TurnOffDefaultConstraints) { scoped_refptr<WebRtcAudioDeviceImpl> webrtc_audio_device( new WebRtcAudioDeviceImpl()); scoped_refptr<MediaStreamAudioProcessor> audio_processor( - new talk_base::RefCountedObject<MediaStreamAudioProcessor>( + new rtc::RefCountedObject<MediaStreamAudioProcessor>( constraint_factory.CreateWebMediaConstraints(), 0, webrtc_audio_device.get())); EXPECT_FALSE(audio_processor->has_audio_processing()); @@ -357,7 +357,7 @@ TEST_F(MediaStreamAudioProcessorTest, TestAllSampleRates) { scoped_refptr<WebRtcAudioDeviceImpl> webrtc_audio_device( new WebRtcAudioDeviceImpl()); scoped_refptr<MediaStreamAudioProcessor> audio_processor( - new talk_base::RefCountedObject<MediaStreamAudioProcessor>( + new rtc::RefCountedObject<MediaStreamAudioProcessor>( constraint_factory.CreateWebMediaConstraints(), 0, webrtc_audio_device.get())); EXPECT_TRUE(audio_processor->has_audio_processing()); @@ -398,7 +398,7 @@ TEST_F(MediaStreamAudioProcessorTest, GetAecDumpMessageFilter) { scoped_refptr<WebRtcAudioDeviceImpl> webrtc_audio_device( new WebRtcAudioDeviceImpl()); scoped_refptr<MediaStreamAudioProcessor> audio_processor( - new talk_base::RefCountedObject<MediaStreamAudioProcessor>( + new rtc::RefCountedObject<MediaStreamAudioProcessor>( constraint_factory.CreateWebMediaConstraints(), 0, webrtc_audio_device.get())); @@ -418,7 +418,7 @@ TEST_F(MediaStreamAudioProcessorTest, TestStereoAudio) { scoped_refptr<WebRtcAudioDeviceImpl> webrtc_audio_device( new WebRtcAudioDeviceImpl()); scoped_refptr<MediaStreamAudioProcessor> audio_processor( - new talk_base::RefCountedObject<MediaStreamAudioProcessor>( + new rtc::RefCountedObject<MediaStreamAudioProcessor>( constraint_factory.CreateWebMediaConstraints(), 0, webrtc_audio_device.get())); EXPECT_FALSE(audio_processor->has_audio_processing()); diff --git a/content/renderer/media/mock_peer_connection_impl.cc b/content/renderer/media/mock_peer_connection_impl.cc index 7a09ea3..831571b 100644 --- a/content/renderer/media/mock_peer_connection_impl.cc +++ b/content/renderer/media/mock_peer_connection_impl.cc @@ -75,7 +75,7 @@ class MockStreamCollection : public webrtc::StreamCollectionInterface { virtual ~MockStreamCollection() {} private: - typedef std::vector<talk_base::scoped_refptr<MediaStreamInterface> > + typedef std::vector<rtc::scoped_refptr<MediaStreamInterface> > StreamVector; StreamVector streams_; }; @@ -194,7 +194,7 @@ class MockDtmfSender : public DtmfSenderInterface { virtual ~MockDtmfSender() {} private: - talk_base::scoped_refptr<AudioTrackInterface> track_; + rtc::scoped_refptr<AudioTrackInterface> track_; DtmfSenderObserverInterface* observer_; std::string tones_; int duration_; @@ -207,8 +207,8 @@ const char MockPeerConnectionImpl::kDummyAnswer[] = "dummy answer"; MockPeerConnectionImpl::MockPeerConnectionImpl( MockPeerConnectionDependencyFactory* factory) : dependency_factory_(factory), - local_streams_(new talk_base::RefCountedObject<MockStreamCollection>), - remote_streams_(new talk_base::RefCountedObject<MockStreamCollection>), + local_streams_(new rtc::RefCountedObject<MockStreamCollection>), + remote_streams_(new rtc::RefCountedObject<MockStreamCollection>), hint_audio_(false), hint_video_(false), getstats_result_(true), @@ -221,12 +221,12 @@ MockPeerConnectionImpl::MockPeerConnectionImpl( MockPeerConnectionImpl::~MockPeerConnectionImpl() {} -talk_base::scoped_refptr<webrtc::StreamCollectionInterface> +rtc::scoped_refptr<webrtc::StreamCollectionInterface> MockPeerConnectionImpl::local_streams() { return local_streams_; } -talk_base::scoped_refptr<webrtc::StreamCollectionInterface> +rtc::scoped_refptr<webrtc::StreamCollectionInterface> MockPeerConnectionImpl::remote_streams() { return remote_streams_; } @@ -247,18 +247,18 @@ void MockPeerConnectionImpl::RemoveStream( local_streams_->RemoveStream(local_stream); } -talk_base::scoped_refptr<DtmfSenderInterface> +rtc::scoped_refptr<DtmfSenderInterface> MockPeerConnectionImpl::CreateDtmfSender(AudioTrackInterface* track) { if (!track) { return NULL; } - return new talk_base::RefCountedObject<MockDtmfSender>(track); + return new rtc::RefCountedObject<MockDtmfSender>(track); } -talk_base::scoped_refptr<webrtc::DataChannelInterface> +rtc::scoped_refptr<webrtc::DataChannelInterface> MockPeerConnectionImpl::CreateDataChannel(const std::string& label, const webrtc::DataChannelInit* config) { - return new talk_base::RefCountedObject<MockDataChannel>(label, config); + return new rtc::RefCountedObject<MockDataChannel>(label, config); } bool MockPeerConnectionImpl::GetStats( diff --git a/content/renderer/media/mock_peer_connection_impl.h b/content/renderer/media/mock_peer_connection_impl.h index d563746..0d7a847 100644 --- a/content/renderer/media/mock_peer_connection_impl.h +++ b/content/renderer/media/mock_peer_connection_impl.h @@ -24,18 +24,18 @@ class MockPeerConnectionImpl : public webrtc::PeerConnectionInterface { explicit MockPeerConnectionImpl(MockPeerConnectionDependencyFactory* factory); // PeerConnectionInterface implementation. - virtual talk_base::scoped_refptr<webrtc::StreamCollectionInterface> + virtual rtc::scoped_refptr<webrtc::StreamCollectionInterface> local_streams() OVERRIDE; - virtual talk_base::scoped_refptr<webrtc::StreamCollectionInterface> + virtual rtc::scoped_refptr<webrtc::StreamCollectionInterface> remote_streams() OVERRIDE; virtual bool AddStream( webrtc::MediaStreamInterface* local_stream, const webrtc::MediaConstraintsInterface* constraints) OVERRIDE; virtual void RemoveStream( webrtc::MediaStreamInterface* local_stream) OVERRIDE; - virtual talk_base::scoped_refptr<webrtc::DtmfSenderInterface> + virtual rtc::scoped_refptr<webrtc::DtmfSenderInterface> CreateDtmfSender(webrtc::AudioTrackInterface* track) OVERRIDE; - virtual talk_base::scoped_refptr<webrtc::DataChannelInterface> + virtual rtc::scoped_refptr<webrtc::DataChannelInterface> CreateDataChannel(const std::string& label, const webrtc::DataChannelInit* config) OVERRIDE; @@ -124,8 +124,8 @@ class MockPeerConnectionImpl : public webrtc::PeerConnectionInterface { MockPeerConnectionDependencyFactory* dependency_factory_; std::string stream_label_; - talk_base::scoped_refptr<MockStreamCollection> local_streams_; - talk_base::scoped_refptr<MockStreamCollection> remote_streams_; + rtc::scoped_refptr<MockStreamCollection> local_streams_; + rtc::scoped_refptr<MockStreamCollection> remote_streams_; scoped_ptr<webrtc::SessionDescriptionInterface> local_desc_; scoped_ptr<webrtc::SessionDescriptionInterface> remote_desc_; scoped_ptr<webrtc::SessionDescriptionInterface> created_sessiondescription_; diff --git a/content/renderer/media/peer_connection_identity_service.h b/content/renderer/media/peer_connection_identity_service.h index b68cafa..a72cf47 100644 --- a/content/renderer/media/peer_connection_identity_service.h +++ b/content/renderer/media/peer_connection_identity_service.h @@ -38,7 +38,7 @@ class PeerConnectionIdentityService // The origin of the DTLS connection. GURL origin_; - talk_base::scoped_refptr<webrtc::DTLSIdentityRequestObserver> + rtc::scoped_refptr<webrtc::DTLSIdentityRequestObserver> pending_observer_; int pending_request_id_; diff --git a/content/renderer/media/peer_connection_tracker.cc b/content/renderer/media/peer_connection_tracker.cc index dc9be52..bead220 100644 --- a/content/renderer/media/peer_connection_tracker.cc +++ b/content/renderer/media/peer_connection_tracker.cc @@ -287,8 +287,8 @@ void PeerConnectionTracker::OnGetAllStats() { for (PeerConnectionIdMap::iterator it = peer_connection_id_map_.begin(); it != peer_connection_id_map_.end(); ++it) { - talk_base::scoped_refptr<InternalStatsObserver> observer( - new talk_base::RefCountedObject<InternalStatsObserver>(it->second)); + rtc::scoped_refptr<InternalStatsObserver> observer( + new rtc::RefCountedObject<InternalStatsObserver>(it->second)); it->first->GetStats( observer, diff --git a/content/renderer/media/rtc_data_channel_handler.cc b/content/renderer/media/rtc_data_channel_handler.cc index 1fe4de1..004cc46 100644 --- a/content/renderer/media/rtc_data_channel_handler.cc +++ b/content/renderer/media/rtc_data_channel_handler.cc @@ -103,14 +103,14 @@ unsigned long RtcDataChannelHandler::bufferedAmount() { bool RtcDataChannelHandler::sendStringData(const blink::WebString& data) { std::string utf8_buffer = base::UTF16ToUTF8(data); - talk_base::Buffer buffer(utf8_buffer.c_str(), utf8_buffer.length()); + rtc::Buffer buffer(utf8_buffer.c_str(), utf8_buffer.length()); webrtc::DataBuffer data_buffer(buffer, false); RecordMessageSent(data_buffer.size()); return channel_->Send(data_buffer); } bool RtcDataChannelHandler::sendRawData(const char* data, size_t length) { - talk_base::Buffer buffer(data, length); + rtc::Buffer buffer(data, length); webrtc::DataBuffer data_buffer(buffer, true); RecordMessageSent(data_buffer.size()); return channel_->Send(data_buffer); diff --git a/content/renderer/media/rtc_peer_connection_handler.cc b/content/renderer/media/rtc_peer_connection_handler.cc index c5767ae..0f92bb6e 100644 --- a/content/renderer/media/rtc_peer_connection_handler.cc +++ b/content/renderer/media/rtc_peer_connection_handler.cc @@ -292,8 +292,8 @@ class StatsResponse : public webrtc::StatsObserver { blink::WebString::fromUTF8(value)); } - talk_base::scoped_refptr<LocalRTCStatsRequest> request_; - talk_base::scoped_refptr<LocalRTCStatsResponse> response_; + rtc::scoped_refptr<LocalRTCStatsRequest> request_; + rtc::scoped_refptr<LocalRTCStatsResponse> response_; }; // Implementation of LocalRTCStatsRequest. @@ -315,7 +315,7 @@ blink::WebMediaStreamTrack LocalRTCStatsRequest::component() const { scoped_refptr<LocalRTCStatsResponse> LocalRTCStatsRequest::createResponse() { DCHECK(!response_); - response_ = new talk_base::RefCountedObject<LocalRTCStatsResponse>( + response_ = new rtc::RefCountedObject<LocalRTCStatsResponse>( impl_.createResponse()); return response_.get(); } @@ -472,7 +472,7 @@ bool RTCPeerConnectionHandler::initialize( peer_connection_tracker_->RegisterPeerConnection( this, config, constraints, frame_); - uma_observer_ = new talk_base::RefCountedObject<PeerConnectionUMAObserver>(); + uma_observer_ = new rtc::RefCountedObject<PeerConnectionUMAObserver>(); native_peer_connection_->RegisterUMAObserver(uma_observer_.get()); return true; } @@ -500,7 +500,7 @@ void RTCPeerConnectionHandler::createOffer( const blink::WebRTCSessionDescriptionRequest& request, const blink::WebMediaConstraints& options) { scoped_refptr<CreateSessionDescriptionRequest> description_request( - new talk_base::RefCountedObject<CreateSessionDescriptionRequest>( + new rtc::RefCountedObject<CreateSessionDescriptionRequest>( request, this, PeerConnectionTracker::ACTION_CREATE_OFFER)); RTCMediaConstraints constraints(options); native_peer_connection_->CreateOffer(description_request.get(), &constraints); @@ -513,7 +513,7 @@ void RTCPeerConnectionHandler::createOffer( const blink::WebRTCSessionDescriptionRequest& request, const blink::WebRTCOfferOptions& options) { scoped_refptr<CreateSessionDescriptionRequest> description_request( - new talk_base::RefCountedObject<CreateSessionDescriptionRequest>( + new rtc::RefCountedObject<CreateSessionDescriptionRequest>( request, this, PeerConnectionTracker::ACTION_CREATE_OFFER)); RTCMediaConstraints constraints; @@ -528,7 +528,7 @@ void RTCPeerConnectionHandler::createAnswer( const blink::WebRTCSessionDescriptionRequest& request, const blink::WebMediaConstraints& options) { scoped_refptr<CreateSessionDescriptionRequest> description_request( - new talk_base::RefCountedObject<CreateSessionDescriptionRequest>( + new rtc::RefCountedObject<CreateSessionDescriptionRequest>( request, this, PeerConnectionTracker::ACTION_CREATE_ANSWER)); RTCMediaConstraints constraints(options); native_peer_connection_->CreateAnswer(description_request.get(), @@ -558,7 +558,7 @@ void RTCPeerConnectionHandler::setLocalDescription( this, description, PeerConnectionTracker::SOURCE_LOCAL); scoped_refptr<SetSessionDescriptionRequest> set_request( - new talk_base::RefCountedObject<SetSessionDescriptionRequest>( + new rtc::RefCountedObject<SetSessionDescriptionRequest>( request, this, PeerConnectionTracker::ACTION_SET_LOCAL_DESCRIPTION)); native_peer_connection_->SetLocalDescription(set_request.get(), native_desc); } @@ -583,7 +583,7 @@ void RTCPeerConnectionHandler::setRemoteDescription( this, description, PeerConnectionTracker::SOURCE_REMOTE); scoped_refptr<SetSessionDescriptionRequest> set_request( - new talk_base::RefCountedObject<SetSessionDescriptionRequest>( + new rtc::RefCountedObject<SetSessionDescriptionRequest>( request, this, PeerConnectionTracker::ACTION_SET_REMOTE_DESCRIPTION)); native_peer_connection_->SetRemoteDescription(set_request.get(), native_desc); } @@ -728,13 +728,13 @@ void RTCPeerConnectionHandler::removeStream( void RTCPeerConnectionHandler::getStats( const blink::WebRTCStatsRequest& request) { scoped_refptr<LocalRTCStatsRequest> inner_request( - new talk_base::RefCountedObject<LocalRTCStatsRequest>(request)); + new rtc::RefCountedObject<LocalRTCStatsRequest>(request)); getStats(inner_request.get()); } void RTCPeerConnectionHandler::getStats(LocalRTCStatsRequest* request) { - talk_base::scoped_refptr<webrtc::StatsObserver> observer( - new talk_base::RefCountedObject<StatsResponse>(request)); + rtc::scoped_refptr<webrtc::StatsObserver> observer( + new rtc::RefCountedObject<StatsResponse>(request)); webrtc::MediaStreamTrackInterface* track = NULL; if (request->hasSelector()) { blink::WebMediaStreamSource::Type type = @@ -798,7 +798,7 @@ blink::WebRTCDataChannelHandler* RTCPeerConnectionHandler::createDataChannel( config.maxRetransmitTime = init.maxRetransmitTime; config.protocol = base::UTF16ToUTF8(init.protocol); - talk_base::scoped_refptr<webrtc::DataChannelInterface> webrtc_channel( + rtc::scoped_refptr<webrtc::DataChannelInterface> webrtc_channel( native_peer_connection_->CreateDataChannel(base::UTF16ToUTF8(label), &config)); if (!webrtc_channel) { @@ -826,7 +826,7 @@ blink::WebRTCDTMFSenderHandler* RTCPeerConnectionHandler::createDTMFSender( } webrtc::AudioTrackInterface* audio_track = native_track->GetAudioAdapter(); - talk_base::scoped_refptr<webrtc::DtmfSenderInterface> sender( + rtc::scoped_refptr<webrtc::DtmfSenderInterface> sender( native_peer_connection_->CreateDtmfSender(audio_track)); if (!sender) { DLOG(ERROR) << "Could not create native DTMF sender."; diff --git a/content/renderer/media/rtc_peer_connection_handler.h b/content/renderer/media/rtc_peer_connection_handler.h index 299585f..ec5f775 100644 --- a/content/renderer/media/rtc_peer_connection_handler.h +++ b/content/renderer/media/rtc_peer_connection_handler.h @@ -33,7 +33,7 @@ class WebRtcMediaStreamAdapter; // Mockable wrapper for blink::WebRTCStatsResponse class CONTENT_EXPORT LocalRTCStatsResponse - : public NON_EXPORTED_BASE(talk_base::RefCountInterface) { + : public NON_EXPORTED_BASE(rtc::RefCountInterface) { public: explicit LocalRTCStatsResponse(const blink::WebRTCStatsResponse& impl) : impl_(impl) { @@ -56,7 +56,7 @@ class CONTENT_EXPORT LocalRTCStatsResponse // Mockable wrapper for blink::WebRTCStatsRequest class CONTENT_EXPORT LocalRTCStatsRequest - : public NON_EXPORTED_BASE(talk_base::RefCountInterface) { + : public NON_EXPORTED_BASE(rtc::RefCountInterface) { public: explicit LocalRTCStatsRequest(blink::WebRTCStatsRequest impl); // Constructor for testing. @@ -72,7 +72,7 @@ class CONTENT_EXPORT LocalRTCStatsRequest private: blink::WebRTCStatsRequest impl_; - talk_base::scoped_refptr<LocalRTCStatsResponse> response_; + rtc::scoped_refptr<LocalRTCStatsResponse> response_; }; // RTCPeerConnectionHandler is a delegate for the RTC PeerConnection API diff --git a/content/renderer/media/rtc_peer_connection_handler_unittest.cc b/content/renderer/media/rtc_peer_connection_handler_unittest.cc index a71c434..2bd05e7 100644 --- a/content/renderer/media/rtc_peer_connection_handler_unittest.cc +++ b/content/renderer/media/rtc_peer_connection_handler_unittest.cc @@ -93,7 +93,7 @@ class MockRTCStatsRequest : public LocalRTCStatsRequest { } virtual scoped_refptr<LocalRTCStatsResponse> createResponse() OVERRIDE { DCHECK(!response_.get()); - response_ = new talk_base::RefCountedObject<MockRTCStatsResponse>(); + response_ = new rtc::RefCountedObject<MockRTCStatsResponse>(); return response_; } @@ -459,7 +459,7 @@ TEST_F(RTCPeerConnectionHandlerTest, addStreamWithStoppedAudioAndVideoTrack) { TEST_F(RTCPeerConnectionHandlerTest, GetStatsNoSelector) { scoped_refptr<MockRTCStatsRequest> request( - new talk_base::RefCountedObject<MockRTCStatsRequest>()); + new rtc::RefCountedObject<MockRTCStatsRequest>()); pc_handler_->getStats(request.get()); // Note that callback gets executed synchronously by mock. ASSERT_TRUE(request->result()); @@ -468,7 +468,7 @@ TEST_F(RTCPeerConnectionHandlerTest, GetStatsNoSelector) { TEST_F(RTCPeerConnectionHandlerTest, GetStatsAfterClose) { scoped_refptr<MockRTCStatsRequest> request( - new talk_base::RefCountedObject<MockRTCStatsRequest>()); + new rtc::RefCountedObject<MockRTCStatsRequest>()); pc_handler_->stop(); pc_handler_->getStats(request.get()); // Note that callback gets executed synchronously by mock. @@ -486,7 +486,7 @@ TEST_F(RTCPeerConnectionHandlerTest, GetStatsWithLocalSelector) { ASSERT_LE(1ul, tracks.size()); scoped_refptr<MockRTCStatsRequest> request( - new talk_base::RefCountedObject<MockRTCStatsRequest>()); + new rtc::RefCountedObject<MockRTCStatsRequest>()); request->setSelector(tracks[0]); pc_handler_->getStats(request.get()); EXPECT_EQ(1, request->result()->report_count()); @@ -503,7 +503,7 @@ TEST_F(RTCPeerConnectionHandlerTest, GetStatsWithRemoteSelector) { ASSERT_LE(1ul, tracks.size()); scoped_refptr<MockRTCStatsRequest> request( - new talk_base::RefCountedObject<MockRTCStatsRequest>()); + new rtc::RefCountedObject<MockRTCStatsRequest>()); request->setSelector(tracks[0]); pc_handler_->getStats(request.get()); EXPECT_EQ(1, request->result()->report_count()); @@ -522,7 +522,7 @@ TEST_F(RTCPeerConnectionHandlerTest, GetStatsWithBadSelector) { mock_peer_connection_->SetGetStatsResult(false); scoped_refptr<MockRTCStatsRequest> request( - new talk_base::RefCountedObject<MockRTCStatsRequest>()); + new rtc::RefCountedObject<MockRTCStatsRequest>()); request->setSelector(component); pc_handler_->getStats(request.get()); EXPECT_EQ(0, request->result()->report_count()); diff --git a/content/renderer/media/webrtc/media_stream_remote_video_source.cc b/content/renderer/media/webrtc/media_stream_remote_video_source.cc index 74dbbb2..933bd5d 100644 --- a/content/renderer/media/webrtc/media_stream_remote_video_source.cc +++ b/content/renderer/media/webrtc/media_stream_remote_video_source.cc @@ -72,7 +72,7 @@ void MediaStreamRemoteVideoSource:: RemoteVideoSourceDelegate::RenderFrame( const cricket::VideoFrame* frame) { base::TimeDelta timestamp = base::TimeDelta::FromMicroseconds( - frame->GetElapsedTime() / talk_base::kNumNanosecsPerMicrosec); + frame->GetElapsedTime() / rtc::kNumNanosecsPerMicrosec); scoped_refptr<media::VideoFrame> video_frame; if (frame->GetNativeHandle() != NULL) { diff --git a/content/renderer/media/webrtc/media_stream_track_metrics.cc b/content/renderer/media/webrtc/media_stream_track_metrics.cc index 736cac3..24feb2f 100644 --- a/content/renderer/media/webrtc/media_stream_track_metrics.cc +++ b/content/renderer/media/webrtc/media_stream_track_metrics.cc @@ -42,9 +42,9 @@ class MediaStreamTrackMetricsObserver : public webrtc::ObserverInterface { virtual void OnChanged() OVERRIDE; template <class T> - IdSet GetTrackIds(const std::vector<talk_base::scoped_refptr<T> >& tracks) { + IdSet GetTrackIds(const std::vector<rtc::scoped_refptr<T> >& tracks) { IdSet track_ids; - typename std::vector<talk_base::scoped_refptr<T> >::const_iterator it = + typename std::vector<rtc::scoped_refptr<T> >::const_iterator it = tracks.begin(); for (; it != tracks.end(); ++it) { track_ids.insert((*it)->id()); @@ -72,7 +72,7 @@ class MediaStreamTrackMetricsObserver : public webrtc::ObserverInterface { IdSet video_track_ids_; MediaStreamTrackMetrics::StreamType stream_type_; - talk_base::scoped_refptr<MediaStreamInterface> stream_; + rtc::scoped_refptr<MediaStreamInterface> stream_; // Non-owning. MediaStreamTrackMetrics* owner_; diff --git a/content/renderer/media/webrtc/media_stream_track_metrics_unittest.cc b/content/renderer/media/webrtc/media_stream_track_metrics_unittest.cc index 343ab30..382fcba 100644 --- a/content/renderer/media/webrtc/media_stream_track_metrics_unittest.cc +++ b/content/renderer/media/webrtc/media_stream_track_metrics_unittest.cc @@ -80,7 +80,7 @@ class MediaStreamTrackMetricsTest : public testing::Test { public: virtual void SetUp() OVERRIDE { metrics_.reset(new MockMediaStreamTrackMetrics()); - stream_ = new talk_base::RefCountedObject<MockMediaStream>("stream"); + stream_ = new rtc::RefCountedObject<MockMediaStream>("stream"); } virtual void TearDown() OVERRIDE { @@ -89,11 +89,11 @@ class MediaStreamTrackMetricsTest : public testing::Test { } scoped_refptr<MockAudioTrackInterface> MakeAudioTrack(std::string id) { - return new talk_base::RefCountedObject<MockAudioTrackInterface>(id); + return new rtc::RefCountedObject<MockAudioTrackInterface>(id); } scoped_refptr<MockVideoTrackInterface> MakeVideoTrack(std::string id) { - return new talk_base::RefCountedObject<MockVideoTrackInterface>(id); + return new rtc::RefCountedObject<MockVideoTrackInterface>(id); } scoped_ptr<MockMediaStreamTrackMetrics> metrics_; diff --git a/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc b/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc index a11272f..6d64c4c 100644 --- a/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc +++ b/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc @@ -14,8 +14,8 @@ #include "content/renderer/media/webrtc_local_audio_track.h" #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" -#include "third_party/libjingle/source/talk/base/scoped_ref_ptr.h" #include "third_party/libjingle/source/talk/media/base/videocapturer.h" +#include "third_party/webrtc/base/scoped_ref_ptr.h" using webrtc::AudioSourceInterface; using webrtc::AudioTrackInterface; @@ -90,13 +90,13 @@ VideoTrackVector MockMediaStream::GetVideoTracks() { return video_track_vector_; } -talk_base::scoped_refptr<AudioTrackInterface> MockMediaStream::FindAudioTrack( +rtc::scoped_refptr<AudioTrackInterface> MockMediaStream::FindAudioTrack( const std::string& track_id) { AudioTrackVector::iterator it = FindTrack(&audio_track_vector_, track_id); return it == audio_track_vector_.end() ? NULL : *it; } -talk_base::scoped_refptr<VideoTrackInterface> MockMediaStream::FindVideoTrack( +rtc::scoped_refptr<VideoTrackInterface> MockMediaStream::FindVideoTrack( const std::string& track_id) { VideoTrackVector::iterator it = FindTrack(&video_track_vector_, track_id); return it == video_track_vector_.end() ? NULL : *it; @@ -443,14 +443,14 @@ MockPeerConnectionDependencyFactory::CreatePeerConnection( const webrtc::MediaConstraintsInterface* constraints, blink::WebFrame* frame, webrtc::PeerConnectionObserver* observer) { - return new talk_base::RefCountedObject<MockPeerConnectionImpl>(this); + return new rtc::RefCountedObject<MockPeerConnectionImpl>(this); } scoped_refptr<webrtc::AudioSourceInterface> MockPeerConnectionDependencyFactory::CreateLocalAudioSource( const webrtc::MediaConstraintsInterface* constraints) { last_audio_source_ = - new talk_base::RefCountedObject<MockAudioSource>(constraints); + new rtc::RefCountedObject<MockAudioSource>(constraints); return last_audio_source_; } @@ -464,7 +464,7 @@ scoped_refptr<webrtc::VideoSourceInterface> MockPeerConnectionDependencyFactory::CreateVideoSource( cricket::VideoCapturer* capturer, const blink::WebMediaConstraints& constraints) { - last_video_source_ = new talk_base::RefCountedObject<MockVideoSource>(); + last_video_source_ = new rtc::RefCountedObject<MockVideoSource>(); last_video_source_->SetVideoCapturer(capturer); return last_video_source_; } @@ -478,7 +478,7 @@ MockPeerConnectionDependencyFactory::CreateWebAudioSource( scoped_refptr<webrtc::MediaStreamInterface> MockPeerConnectionDependencyFactory::CreateLocalMediaStream( const std::string& label) { - return new talk_base::RefCountedObject<MockMediaStream>(label); + return new rtc::RefCountedObject<MockMediaStream>(label); } scoped_refptr<webrtc::VideoTrackInterface> @@ -486,7 +486,7 @@ MockPeerConnectionDependencyFactory::CreateLocalVideoTrack( const std::string& id, webrtc::VideoSourceInterface* source) { scoped_refptr<webrtc::VideoTrackInterface> track( - new talk_base::RefCountedObject<MockWebRtcVideoTrack>( + new rtc::RefCountedObject<MockWebRtcVideoTrack>( id, source)); return track; } @@ -496,11 +496,11 @@ MockPeerConnectionDependencyFactory::CreateLocalVideoTrack( const std::string& id, cricket::VideoCapturer* capturer) { scoped_refptr<MockVideoSource> source = - new talk_base::RefCountedObject<MockVideoSource>(); + new rtc::RefCountedObject<MockVideoSource>(); source->SetVideoCapturer(capturer); return - new talk_base::RefCountedObject<MockWebRtcVideoTrack>(id, source.get()); + new rtc::RefCountedObject<MockWebRtcVideoTrack>(id, source.get()); } SessionDescriptionInterface* diff --git a/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.h b/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.h index 2bdda74..871c183 100644 --- a/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.h +++ b/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.h @@ -145,9 +145,9 @@ class MockMediaStream : public webrtc::MediaStreamInterface { virtual std::string label() const OVERRIDE; virtual webrtc::AudioTrackVector GetAudioTracks() OVERRIDE; virtual webrtc::VideoTrackVector GetVideoTracks() OVERRIDE; - virtual talk_base::scoped_refptr<webrtc::AudioTrackInterface> + virtual rtc::scoped_refptr<webrtc::AudioTrackInterface> FindAudioTrack(const std::string& track_id) OVERRIDE; - virtual talk_base::scoped_refptr<webrtc::VideoTrackInterface> + virtual rtc::scoped_refptr<webrtc::VideoTrackInterface> FindVideoTrack(const std::string& track_id) OVERRIDE; virtual void RegisterObserver(webrtc::ObserverInterface* observer) OVERRIDE; virtual void UnregisterObserver(webrtc::ObserverInterface* observer) OVERRIDE; diff --git a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc b/content/renderer/media/webrtc/peer_connection_dependency_factory.cc index ed05bb9..9b4fcdb 100644 --- a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc +++ b/content/renderer/media/webrtc/peer_connection_dependency_factory.cc @@ -44,7 +44,7 @@ #include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface.h" #if defined(USE_OPENSSL) -#include "third_party/libjingle/source/talk/base/ssladapter.h" +#include "third_party/webrtc/base/ssladapter.h" #else #include "net/socket/nss_ssl_util.h" #endif @@ -115,8 +115,8 @@ class P2PPortAllocatorFactory : public webrtc::PortAllocatorFactoryInterface { public: P2PPortAllocatorFactory( P2PSocketDispatcher* socket_dispatcher, - talk_base::NetworkManager* network_manager, - talk_base::PacketSocketFactory* socket_factory, + rtc::NetworkManager* network_manager, + rtc::PacketSocketFactory* socket_factory, blink::WebFrame* web_frame) : socket_dispatcher_(socket_dispatcher), network_manager_(network_manager), @@ -163,8 +163,8 @@ class P2PPortAllocatorFactory : public webrtc::PortAllocatorFactoryInterface { scoped_refptr<P2PSocketDispatcher> socket_dispatcher_; // |network_manager_| and |socket_factory_| are a weak references, owned by // PeerConnectionDependencyFactory. - talk_base::NetworkManager* network_manager_; - talk_base::PacketSocketFactory* socket_factory_; + rtc::NetworkManager* network_manager_; + rtc::PacketSocketFactory* socket_factory_; // Raw ptr to the WebFrame that created the P2PPortAllocatorFactory. blink::WebFrame* web_frame_; }; @@ -309,7 +309,7 @@ void PeerConnectionDependencyFactory::CreatePeerConnectionFactory() { // Init SSL, which will be needed by PeerConnection. #if defined(USE_OPENSSL) - if (!talk_base::InitializeSSL()) { + if (!rtc::InitializeSSL()) { LOG(ERROR) << "Failed on InitializeSSL."; NOTREACHED(); return; @@ -385,7 +385,7 @@ PeerConnectionDependencyFactory::CreatePeerConnection( return NULL; scoped_refptr<P2PPortAllocatorFactory> pa_factory = - new talk_base::RefCountedObject<P2PPortAllocatorFactory>( + new rtc::RefCountedObject<P2PPortAllocatorFactory>( p2p_socket_dispatcher_.get(), network_manager_, socket_factory_.get(), @@ -549,7 +549,7 @@ PeerConnectionDependencyFactory::GetWebRtcAudioDevice() { } void PeerConnectionDependencyFactory::InitializeWorkerThread( - talk_base::Thread** thread, + rtc::Thread** thread, base::WaitableEvent* event) { jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true); diff --git a/content/renderer/media/webrtc/peer_connection_dependency_factory.h b/content/renderer/media/webrtc/peer_connection_dependency_factory.h index 37e0b00..a8c96ca 100644 --- a/content/renderer/media/webrtc/peer_connection_dependency_factory.h +++ b/content/renderer/media/webrtc/peer_connection_dependency_factory.h @@ -22,7 +22,7 @@ namespace base { class WaitableEvent; } -namespace talk_base { +namespace rtc { class NetworkManager; class PacketSocketFactory; class Thread; @@ -179,7 +179,7 @@ class CONTENT_EXPORT PeerConnectionDependencyFactory // creating PeerConnection objects. void CreatePeerConnectionFactory(); - void InitializeWorkerThread(talk_base::Thread** thread, + void InitializeWorkerThread(rtc::Thread** thread, base::WaitableEvent* event); void CreateIpcNetworkManagerOnWorkerThread(base::WaitableEvent* event); @@ -206,8 +206,8 @@ class CONTENT_EXPORT PeerConnectionDependencyFactory // PeerConnection threads. signaling_thread_ is created from the // "current" chrome thread. - talk_base::Thread* signaling_thread_; - talk_base::Thread* worker_thread_; + rtc::Thread* signaling_thread_; + rtc::Thread* worker_thread_; base::Thread chrome_worker_thread_; DISALLOW_COPY_AND_ASSIGN(PeerConnectionDependencyFactory); diff --git a/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.cc b/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.cc index d94edb8..96b6837 100644 --- a/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.cc +++ b/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.cc @@ -18,8 +18,8 @@ scoped_refptr<WebRtcLocalAudioTrackAdapter> WebRtcLocalAudioTrackAdapter::Create( const std::string& label, webrtc::AudioSourceInterface* track_source) { - talk_base::RefCountedObject<WebRtcLocalAudioTrackAdapter>* adapter = - new talk_base::RefCountedObject<WebRtcLocalAudioTrackAdapter>( + rtc::RefCountedObject<WebRtcLocalAudioTrackAdapter>* adapter = + new rtc::RefCountedObject<WebRtcLocalAudioTrackAdapter>( label, track_source); return adapter; } @@ -98,7 +98,7 @@ bool WebRtcLocalAudioTrackAdapter::GetSignalLevel(int* level) { return true; } -talk_base::scoped_refptr<webrtc::AudioProcessorInterface> +rtc::scoped_refptr<webrtc::AudioProcessorInterface> WebRtcLocalAudioTrackAdapter::GetAudioProcessor() { base::AutoLock auto_lock(lock_); return audio_processor_.get(); diff --git a/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h b/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h index b35ad4a..630af24 100644 --- a/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h +++ b/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h @@ -67,7 +67,7 @@ class CONTENT_EXPORT WebRtcLocalAudioTrackAdapter virtual void AddSink(webrtc::AudioTrackSinkInterface* sink) OVERRIDE; virtual void RemoveSink(webrtc::AudioTrackSinkInterface* sink) OVERRIDE; virtual bool GetSignalLevel(int* level) OVERRIDE; - virtual talk_base::scoped_refptr<webrtc::AudioProcessorInterface> + virtual rtc::scoped_refptr<webrtc::AudioProcessorInterface> GetAudioProcessor() OVERRIDE; // cricket::AudioCapturer implementation. @@ -83,7 +83,7 @@ class CONTENT_EXPORT WebRtcLocalAudioTrackAdapter // The source of the audio track which handles the audio constraints. // TODO(xians): merge |track_source_| to |capturer_| in WebRtcLocalAudioTrack. - talk_base::scoped_refptr<webrtc::AudioSourceInterface> track_source_; + rtc::scoped_refptr<webrtc::AudioSourceInterface> track_source_; // The audio processsor that applies audio processing on the data of audio // track. diff --git a/content/renderer/media/webrtc_audio_capturer.cc b/content/renderer/media/webrtc_audio_capturer.cc index e47beea..994f77b 100644 --- a/content/renderer/media/webrtc_audio_capturer.cc +++ b/content/renderer/media/webrtc_audio_capturer.cc @@ -228,7 +228,7 @@ WebRtcAudioCapturer::WebRtcAudioCapturer( MediaStreamAudioSource* audio_source) : constraints_(constraints), audio_processor_( - new talk_base::RefCountedObject<MediaStreamAudioProcessor>( + new rtc::RefCountedObject<MediaStreamAudioProcessor>( constraints, device_info.device.input.effects, audio_device)), running_(false), render_view_id_(render_view_id), diff --git a/content/renderer/media/webrtc_audio_renderer_unittest.cc b/content/renderer/media/webrtc_audio_renderer_unittest.cc index 3cf1b523..914dd52 100644 --- a/content/renderer/media/webrtc_audio_renderer_unittest.cc +++ b/content/renderer/media/webrtc_audio_renderer_unittest.cc @@ -87,7 +87,7 @@ class WebRtcAudioRendererTest : public testing::Test { message_loop_->message_loop_proxy())), factory_(new MockAudioDeviceFactory()), source_(new MockAudioRendererSource()), - stream_(new talk_base::RefCountedObject<MockMediaStream>("label")), + stream_(new rtc::RefCountedObject<MockMediaStream>("label")), renderer_(new WebRtcAudioRenderer(stream_, 1, 1, 1, 44100, 441)) { EXPECT_CALL(*factory_.get(), CreateOutputDevice(1)) .WillOnce(Return(mock_output_device_)); diff --git a/content/renderer/media/webrtc_logging.cc b/content/renderer/media/webrtc_logging.cc index 96868a6..17e5c57 100644 --- a/content/renderer/media/webrtc_logging.cc +++ b/content/renderer/media/webrtc_logging.cc @@ -6,7 +6,7 @@ #include "base/time/time.h" #include "content/public/renderer/webrtc_log_message_delegate.h" -#include "third_party/libjingle/overrides/talk/base/logging.h" +#include "third_party/webrtc/overrides/webrtc/base/logging.h" namespace content { @@ -22,7 +22,7 @@ void InitWebRtcLoggingDelegate(WebRtcLogMessageDelegate* delegate) { void InitWebRtcLogging() { // Log messages from Libjingle should not have timestamps. - talk_base::InitDiagnosticLoggingDelegateFunction(&WebRtcLogMessage); + rtc::InitDiagnosticLoggingDelegateFunction(&WebRtcLogMessage); } void WebRtcLogMessage(const std::string& message) { diff --git a/content/renderer/p2p/host_address_request.cc b/content/renderer/p2p/host_address_request.cc index 72e7c46..e21e0aa 100644 --- a/content/renderer/p2p/host_address_request.cc +++ b/content/renderer/p2p/host_address_request.cc @@ -29,7 +29,7 @@ P2PAsyncAddressResolver::~P2PAsyncAddressResolver() { DCHECK(!registered_); } -void P2PAsyncAddressResolver::Start(const talk_base::SocketAddress& host_name, +void P2PAsyncAddressResolver::Start(const rtc::SocketAddress& host_name, const DoneCallback& done_callback) { DCHECK(delegate_message_loop_->BelongsToCurrentThread()); DCHECK_EQ(STATE_CREATED, state_); @@ -51,7 +51,7 @@ void P2PAsyncAddressResolver::Cancel() { } void P2PAsyncAddressResolver::DoSendRequest( - const talk_base::SocketAddress& host_name, + const rtc::SocketAddress& host_name, const DoneCallback& done_callback) { DCHECK(ipc_message_loop_->BelongsToCurrentThread()); diff --git a/content/renderer/p2p/host_address_request.h b/content/renderer/p2p/host_address_request.h index 7c90b80..ab45486 100644 --- a/content/renderer/p2p/host_address_request.h +++ b/content/renderer/p2p/host_address_request.h @@ -11,7 +11,7 @@ #include "base/memory/ref_counted.h" #include "content/common/content_export.h" #include "net/base/net_util.h" -#include "third_party/libjingle/source/talk/base/asyncresolverinterface.h" +#include "third_party/webrtc/base/asyncresolverinterface.h" namespace base { class MessageLoop; @@ -31,7 +31,7 @@ class P2PAsyncAddressResolver P2PAsyncAddressResolver(P2PSocketDispatcher* dispatcher); // Start address resolve process. - void Start(const talk_base::SocketAddress& addr, + void Start(const rtc::SocketAddress& addr, const DoneCallback& done_callback); // Clients must unregister before exiting for cleanup. void Cancel(); @@ -49,7 +49,7 @@ class P2PAsyncAddressResolver virtual ~P2PAsyncAddressResolver(); - void DoSendRequest(const talk_base::SocketAddress& host_name, + void DoSendRequest(const rtc::SocketAddress& host_name, const DoneCallback& done_callback); void DoUnregister(); void OnResponse(const net::IPAddressList& address); @@ -65,7 +65,7 @@ class P2PAsyncAddressResolver // Accessed on the IPC thread only. int32 request_id_; bool registered_; - std::vector<talk_base::IPAddress> addresses_; + std::vector<rtc::IPAddress> addresses_; DoneCallback done_callback_; DISALLOW_COPY_AND_ASSIGN(P2PAsyncAddressResolver); diff --git a/content/renderer/p2p/ipc_network_manager.cc b/content/renderer/p2p/ipc_network_manager.cc index d306787..8995339 100644 --- a/content/renderer/p2p/ipc_network_manager.cc +++ b/content/renderer/p2p/ipc_network_manager.cc @@ -15,21 +15,21 @@ namespace content { namespace { -talk_base::AdapterType ConvertConnectionTypeToAdapterType( +rtc::AdapterType ConvertConnectionTypeToAdapterType( net::NetworkChangeNotifier::ConnectionType type) { switch (type) { case net::NetworkChangeNotifier::CONNECTION_UNKNOWN: - return talk_base::ADAPTER_TYPE_UNKNOWN; + return rtc::ADAPTER_TYPE_UNKNOWN; case net::NetworkChangeNotifier::CONNECTION_ETHERNET: - return talk_base::ADAPTER_TYPE_ETHERNET; + return rtc::ADAPTER_TYPE_ETHERNET; case net::NetworkChangeNotifier::CONNECTION_WIFI: - return talk_base::ADAPTER_TYPE_WIFI; + return rtc::ADAPTER_TYPE_WIFI; case net::NetworkChangeNotifier::CONNECTION_2G: case net::NetworkChangeNotifier::CONNECTION_3G: case net::NetworkChangeNotifier::CONNECTION_4G: - return talk_base::ADAPTER_TYPE_CELLULAR; + return rtc::ADAPTER_TYPE_CELLULAR; default: - return talk_base::ADAPTER_TYPE_UNKNOWN; + return rtc::ADAPTER_TYPE_UNKNOWN; } } @@ -73,9 +73,9 @@ void IpcNetworkManager::OnNetworkListChanged( // Note: 32 and 64 are the arbitrary(kind of) prefix length used to // differentiate IPv4 and IPv6 addresses. - // talk_base::Network uses these prefix_length to compare network + // rtc::Network uses these prefix_length to compare network // interfaces discovered. - std::vector<talk_base::Network*> networks; + std::vector<rtc::Network*> networks; int ipv4_interfaces = 0; int ipv6_interfaces = 0; for (net::NetworkInterfaceList::const_iterator it = list.begin(); @@ -83,19 +83,19 @@ void IpcNetworkManager::OnNetworkListChanged( if (it->address.size() == net::kIPv4AddressSize) { uint32 address; memcpy(&address, &it->address[0], sizeof(uint32)); - address = talk_base::NetworkToHost32(address); - talk_base::Network* network = new talk_base::Network( - it->name, it->name, talk_base::IPAddress(address), 32, + address = rtc::NetworkToHost32(address); + rtc::Network* network = new rtc::Network( + it->name, it->name, rtc::IPAddress(address), 32, ConvertConnectionTypeToAdapterType(it->type)); - network->AddIP(talk_base::IPAddress(address)); + network->AddIP(rtc::IPAddress(address)); networks.push_back(network); ++ipv4_interfaces; } else if (it->address.size() == net::kIPv6AddressSize) { in6_addr address; memcpy(&address, &it->address[0], sizeof(in6_addr)); - talk_base::IPAddress ip6_addr(address); - if (!talk_base::IPIsPrivate(ip6_addr)) { - talk_base::Network* network = new talk_base::Network( + rtc::IPAddress ip6_addr(address); + if (!rtc::IPIsPrivate(ip6_addr)) { + rtc::Network* network = new rtc::Network( it->name, it->name, ip6_addr, 64, ConvertConnectionTypeToAdapterType(it->type)); network->AddIP(ip6_addr); @@ -115,16 +115,16 @@ void IpcNetworkManager::OnNetworkListChanged( if (CommandLine::ForCurrentProcess()->HasSwitch( switches::kAllowLoopbackInPeerConnection)) { std::string name_v4("loopback_ipv4"); - talk_base::IPAddress ip_address_v4(INADDR_LOOPBACK); - talk_base::Network* network_v4 = new talk_base::Network( - name_v4, name_v4, ip_address_v4, 32, talk_base::ADAPTER_TYPE_UNKNOWN); + rtc::IPAddress ip_address_v4(INADDR_LOOPBACK); + rtc::Network* network_v4 = new rtc::Network( + name_v4, name_v4, ip_address_v4, 32, rtc::ADAPTER_TYPE_UNKNOWN); network_v4->AddIP(ip_address_v4); networks.push_back(network_v4); std::string name_v6("loopback_ipv6"); - talk_base::IPAddress ip_address_v6(in6addr_loopback); - talk_base::Network* network_v6 = new talk_base::Network( - name_v6, name_v6, ip_address_v6, 64, talk_base::ADAPTER_TYPE_UNKNOWN); + rtc::IPAddress ip_address_v6(in6addr_loopback); + rtc::Network* network_v6 = new rtc::Network( + name_v6, name_v6, ip_address_v6, 64, rtc::ADAPTER_TYPE_UNKNOWN); network_v6->AddIP(ip_address_v6); networks.push_back(network_v6); } diff --git a/content/renderer/p2p/ipc_network_manager.h b/content/renderer/p2p/ipc_network_manager.h index 06931dc..4ed3c48 100644 --- a/content/renderer/p2p/ipc_network_manager.h +++ b/content/renderer/p2p/ipc_network_manager.h @@ -12,13 +12,13 @@ #include "content/common/content_export.h" #include "content/renderer/p2p/network_list_observer.h" #include "content/renderer/p2p/socket_dispatcher.h" -#include "third_party/libjingle/source/talk/base/network.h" +#include "third_party/webrtc/base/network.h" namespace content { // IpcNetworkManager is a NetworkManager for libjingle that gets a // list of network interfaces from the browser. -class IpcNetworkManager : public talk_base::NetworkManagerBase, +class IpcNetworkManager : public rtc::NetworkManagerBase, public NetworkListObserver { public: // Constructor doesn't take ownership of the |socket_dispatcher|. diff --git a/content/renderer/p2p/ipc_socket_factory.cc b/content/renderer/p2p/ipc_socket_factory.cc index f9dfbe0..62428ad 100644 --- a/content/renderer/p2p/ipc_socket_factory.cc +++ b/content/renderer/p2p/ipc_socket_factory.cc @@ -19,7 +19,7 @@ #include "content/renderer/p2p/socket_client_impl.h" #include "content/renderer/p2p/socket_dispatcher.h" #include "jingle/glue/utils.h" -#include "third_party/libjingle/source/talk/base/asyncpacketsocket.h" +#include "third_party/webrtc/base/asyncpacketsocket.h" namespace content { @@ -36,22 +36,22 @@ bool IsTcpClientSocket(P2PSocketType type) { (type == P2P_SOCKET_STUN_TLS_CLIENT); } -bool JingleSocketOptionToP2PSocketOption(talk_base::Socket::Option option, +bool JingleSocketOptionToP2PSocketOption(rtc::Socket::Option option, P2PSocketOption* ipc_option) { switch (option) { - case talk_base::Socket::OPT_RCVBUF: + case rtc::Socket::OPT_RCVBUF: *ipc_option = P2P_SOCKET_OPT_RCVBUF; break; - case talk_base::Socket::OPT_SNDBUF: + case rtc::Socket::OPT_SNDBUF: *ipc_option = P2P_SOCKET_OPT_SNDBUF; break; - case talk_base::Socket::OPT_DSCP: + case rtc::Socket::OPT_DSCP: *ipc_option = P2P_SOCKET_OPT_DSCP; break; - case talk_base::Socket::OPT_DONTFRAGMENT: - case talk_base::Socket::OPT_NODELAY: - case talk_base::Socket::OPT_IPV6_V6ONLY: - case talk_base::Socket::OPT_RTP_SENDTIME_EXTN_ID: + case rtc::Socket::OPT_DONTFRAGMENT: + case rtc::Socket::OPT_NODELAY: + case rtc::Socket::OPT_IPV6_V6ONLY: + case rtc::Socket::OPT_RTP_SENDTIME_EXTN_ID: return false; // Not supported by the chrome sockets. default: NOTREACHED(); @@ -63,10 +63,10 @@ bool JingleSocketOptionToP2PSocketOption(talk_base::Socket::Option option, // TODO(miu): This needs tuning. http://crbug.com/237960 const size_t kMaximumInFlightBytes = 64 * 1024; // 64 KB -// IpcPacketSocket implements talk_base::AsyncPacketSocket interface +// IpcPacketSocket implements rtc::AsyncPacketSocket interface // using P2PSocketClient that works over IPC-channel. It must be used // on the thread it was created. -class IpcPacketSocket : public talk_base::AsyncPacketSocket, +class IpcPacketSocket : public rtc::AsyncPacketSocket, public P2PSocketClientDelegate { public: IpcPacketSocket(); @@ -74,21 +74,21 @@ class IpcPacketSocket : public talk_base::AsyncPacketSocket, // Always takes ownership of client even if initialization fails. bool Init(P2PSocketType type, P2PSocketClientImpl* client, - const talk_base::SocketAddress& local_address, - const talk_base::SocketAddress& remote_address); + const rtc::SocketAddress& local_address, + const rtc::SocketAddress& remote_address); - // talk_base::AsyncPacketSocket interface. - virtual talk_base::SocketAddress GetLocalAddress() const OVERRIDE; - virtual talk_base::SocketAddress GetRemoteAddress() const OVERRIDE; + // rtc::AsyncPacketSocket interface. + virtual rtc::SocketAddress GetLocalAddress() const OVERRIDE; + virtual rtc::SocketAddress GetRemoteAddress() const OVERRIDE; virtual int Send(const void *pv, size_t cb, - const talk_base::PacketOptions& options) OVERRIDE; + const rtc::PacketOptions& options) OVERRIDE; virtual int SendTo(const void *pv, size_t cb, - const talk_base::SocketAddress& addr, - const talk_base::PacketOptions& options) OVERRIDE; + const rtc::SocketAddress& addr, + const rtc::PacketOptions& options) OVERRIDE; virtual int Close() OVERRIDE; virtual State GetState() const OVERRIDE; - virtual int GetOption(talk_base::Socket::Option option, int* value) OVERRIDE; - virtual int SetOption(talk_base::Socket::Option option, int value) OVERRIDE; + virtual int GetOption(rtc::Socket::Option option, int* value) OVERRIDE; + virtual int SetOption(rtc::Socket::Option option, int value) OVERRIDE; virtual int GetError() const OVERRIDE; virtual void SetError(int error) OVERRIDE; @@ -119,8 +119,8 @@ class IpcPacketSocket : public talk_base::AsyncPacketSocket, void TraceSendThrottlingState() const; void InitAcceptedTcp(P2PSocketClient* client, - const talk_base::SocketAddress& local_address, - const talk_base::SocketAddress& remote_address); + const rtc::SocketAddress& local_address, + const rtc::SocketAddress& remote_address); int DoSetOption(P2PSocketOption option, int value); @@ -135,10 +135,10 @@ class IpcPacketSocket : public talk_base::AsyncPacketSocket, // Local address is allocated by the browser process, and the // renderer side doesn't know the address until it receives OnOpen() // event from the browser. - talk_base::SocketAddress local_address_; + rtc::SocketAddress local_address_; // Remote address for client TCP connections. - talk_base::SocketAddress remote_address_; + rtc::SocketAddress remote_address_; // Current state of the object. InternalState state_; @@ -169,15 +169,15 @@ class IpcPacketSocket : public talk_base::AsyncPacketSocket, // of MT sig slots clients must call disconnect. This class is to make sure // we destruct from the same thread on which is created. class AsyncAddressResolverImpl : public base::NonThreadSafe, - public talk_base::AsyncResolverInterface { + public rtc::AsyncResolverInterface { public: AsyncAddressResolverImpl(P2PSocketDispatcher* dispatcher); virtual ~AsyncAddressResolverImpl(); - // talk_base::AsyncResolverInterface interface. - virtual void Start(const talk_base::SocketAddress& addr) OVERRIDE; + // rtc::AsyncResolverInterface interface. + virtual void Start(const rtc::SocketAddress& addr) OVERRIDE; virtual bool GetResolvedAddress( - int family, talk_base::SocketAddress* addr) const OVERRIDE; + int family, rtc::SocketAddress* addr) const OVERRIDE; virtual int GetError() const OVERRIDE; virtual void Destroy(bool wait) OVERRIDE; @@ -186,7 +186,7 @@ class AsyncAddressResolverImpl : public base::NonThreadSafe, scoped_refptr<P2PAsyncAddressResolver> resolver_; int port_; // Port number in |addr| from Start() method. - std::vector<talk_base::IPAddress> addresses_; // Resolved addresses. + std::vector<rtc::IPAddress> addresses_; // Resolved addresses. }; IpcPacketSocket::IpcPacketSocket() @@ -217,8 +217,8 @@ void IpcPacketSocket::TraceSendThrottlingState() const { bool IpcPacketSocket::Init(P2PSocketType type, P2PSocketClientImpl* client, - const talk_base::SocketAddress& local_address, - const talk_base::SocketAddress& remote_address) { + const rtc::SocketAddress& local_address, + const rtc::SocketAddress& remote_address) { DCHECK_EQ(base::MessageLoop::current(), message_loop_); DCHECK_EQ(state_, IS_UNINITIALIZED); @@ -255,8 +255,8 @@ bool IpcPacketSocket::Init(P2PSocketType type, void IpcPacketSocket::InitAcceptedTcp( P2PSocketClient* client, - const talk_base::SocketAddress& local_address, - const talk_base::SocketAddress& remote_address) { + const rtc::SocketAddress& local_address, + const rtc::SocketAddress& remote_address) { DCHECK_EQ(base::MessageLoop::current(), message_loop_); DCHECK_EQ(state_, IS_UNINITIALIZED); @@ -268,26 +268,26 @@ void IpcPacketSocket::InitAcceptedTcp( client_->SetDelegate(this); } -// talk_base::AsyncPacketSocket interface. -talk_base::SocketAddress IpcPacketSocket::GetLocalAddress() const { +// rtc::AsyncPacketSocket interface. +rtc::SocketAddress IpcPacketSocket::GetLocalAddress() const { DCHECK_EQ(base::MessageLoop::current(), message_loop_); return local_address_; } -talk_base::SocketAddress IpcPacketSocket::GetRemoteAddress() const { +rtc::SocketAddress IpcPacketSocket::GetRemoteAddress() const { DCHECK_EQ(base::MessageLoop::current(), message_loop_); return remote_address_; } int IpcPacketSocket::Send(const void *data, size_t data_size, - const talk_base::PacketOptions& options) { + const rtc::PacketOptions& options) { DCHECK_EQ(base::MessageLoop::current(), message_loop_); return SendTo(data, data_size, remote_address_, options); } int IpcPacketSocket::SendTo(const void *data, size_t data_size, - const talk_base::SocketAddress& address, - const talk_base::PacketOptions& options) { + const rtc::SocketAddress& address, + const rtc::PacketOptions& options) { DCHECK_EQ(base::MessageLoop::current(), message_loop_); switch (state_) { @@ -355,7 +355,7 @@ int IpcPacketSocket::Close() { return 0; } -talk_base::AsyncPacketSocket::State IpcPacketSocket::GetState() const { +rtc::AsyncPacketSocket::State IpcPacketSocket::GetState() const { DCHECK_EQ(base::MessageLoop::current(), message_loop_); switch (state_) { @@ -382,7 +382,7 @@ talk_base::AsyncPacketSocket::State IpcPacketSocket::GetState() const { return STATE_CLOSED; } -int IpcPacketSocket::GetOption(talk_base::Socket::Option option, int* value) { +int IpcPacketSocket::GetOption(rtc::Socket::Option option, int* value) { P2PSocketOption p2p_socket_option = P2P_SOCKET_OPT_MAX; if (!JingleSocketOptionToP2PSocketOption(option, &p2p_socket_option)) { // unsupported option. @@ -393,7 +393,7 @@ int IpcPacketSocket::GetOption(talk_base::Socket::Option option, int* value) { return 0; } -int IpcPacketSocket::SetOption(talk_base::Socket::Option option, int value) { +int IpcPacketSocket::SetOption(rtc::Socket::Option option, int value) { DCHECK_EQ(base::MessageLoop::current(), message_loop_); P2PSocketOption p2p_socket_option = P2P_SOCKET_OPT_MAX; @@ -456,7 +456,7 @@ void IpcPacketSocket::OnOpen(const net::IPEndPoint& local_address, // in the callback. This address will be used while sending the packets // over the network. if (remote_address_.IsUnresolvedIP()) { - talk_base::SocketAddress jingle_socket_address; + rtc::SocketAddress jingle_socket_address; if (!jingle_glue::IPEndPointToSocketAddress( remote_address, &jingle_socket_address)) { NOTREACHED(); @@ -474,7 +474,7 @@ void IpcPacketSocket::OnIncomingTcpConnection( scoped_ptr<IpcPacketSocket> socket(new IpcPacketSocket()); - talk_base::SocketAddress remote_address; + rtc::SocketAddress remote_address; if (!jingle_glue::IPEndPointToSocketAddress(address, &remote_address)) { // Always expect correct IPv4 address to be allocated. NOTREACHED(); @@ -519,7 +519,7 @@ void IpcPacketSocket::OnDataReceived(const net::IPEndPoint& address, const base::TimeTicks& timestamp) { DCHECK_EQ(base::MessageLoop::current(), message_loop_); - talk_base::SocketAddress address_lj; + rtc::SocketAddress address_lj; if (!jingle_glue::IPEndPointToSocketAddress(address, &address_lj)) { // We should always be able to convert address here because we // don't expect IPv6 address on IPv4 connections. @@ -527,7 +527,7 @@ void IpcPacketSocket::OnDataReceived(const net::IPEndPoint& address, return; } - talk_base::PacketTime packet_time(timestamp.ToInternalValue(), 0); + rtc::PacketTime packet_time(timestamp.ToInternalValue(), 0); SignalReadPacket(this, &data[0], data.size(), address_lj, packet_time); } @@ -540,7 +540,7 @@ AsyncAddressResolverImpl::AsyncAddressResolverImpl( AsyncAddressResolverImpl::~AsyncAddressResolverImpl() { } -void AsyncAddressResolverImpl::Start(const talk_base::SocketAddress& addr) { +void AsyncAddressResolverImpl::Start(const rtc::SocketAddress& addr) { DCHECK(CalledOnValidThread()); // Copy port number from |addr|. |port_| must be copied // when resolved address is returned in GetResolvedAddress. @@ -552,7 +552,7 @@ void AsyncAddressResolverImpl::Start(const talk_base::SocketAddress& addr) { } bool AsyncAddressResolverImpl::GetResolvedAddress( - int family, talk_base::SocketAddress* addr) const { + int family, rtc::SocketAddress* addr) const { DCHECK(CalledOnValidThread()); if (addresses_.empty()) @@ -585,7 +585,7 @@ void AsyncAddressResolverImpl::OnAddressResolved( const net::IPAddressList& addresses) { DCHECK(CalledOnValidThread()); for (size_t i = 0; i < addresses.size(); ++i) { - talk_base::SocketAddress socket_address; + rtc::SocketAddress socket_address; if (!jingle_glue::IPEndPointToSocketAddress( net::IPEndPoint(addresses[i], 0), &socket_address)) { NOTREACHED(); @@ -605,54 +605,54 @@ IpcPacketSocketFactory::IpcPacketSocketFactory( IpcPacketSocketFactory::~IpcPacketSocketFactory() { } -talk_base::AsyncPacketSocket* IpcPacketSocketFactory::CreateUdpSocket( - const talk_base::SocketAddress& local_address, int min_port, int max_port) { - talk_base::SocketAddress crome_address; +rtc::AsyncPacketSocket* IpcPacketSocketFactory::CreateUdpSocket( + const rtc::SocketAddress& local_address, int min_port, int max_port) { + rtc::SocketAddress crome_address; P2PSocketClientImpl* socket_client = new P2PSocketClientImpl(socket_dispatcher_); scoped_ptr<IpcPacketSocket> socket(new IpcPacketSocket()); // TODO(sergeyu): Respect local_address and port limits here (need // to pass them over IPC channel to the browser). if (!socket->Init(P2P_SOCKET_UDP, socket_client, - local_address, talk_base::SocketAddress())) { + local_address, rtc::SocketAddress())) { return NULL; } return socket.release(); } -talk_base::AsyncPacketSocket* IpcPacketSocketFactory::CreateServerTcpSocket( - const talk_base::SocketAddress& local_address, int min_port, int max_port, +rtc::AsyncPacketSocket* IpcPacketSocketFactory::CreateServerTcpSocket( + const rtc::SocketAddress& local_address, int min_port, int max_port, int opts) { // TODO(sergeyu): Implement SSL support. - if (opts & talk_base::PacketSocketFactory::OPT_SSLTCP) + if (opts & rtc::PacketSocketFactory::OPT_SSLTCP) return NULL; - P2PSocketType type = (opts & talk_base::PacketSocketFactory::OPT_STUN) ? + P2PSocketType type = (opts & rtc::PacketSocketFactory::OPT_STUN) ? P2P_SOCKET_STUN_TCP_SERVER : P2P_SOCKET_TCP_SERVER; P2PSocketClientImpl* socket_client = new P2PSocketClientImpl(socket_dispatcher_); scoped_ptr<IpcPacketSocket> socket(new IpcPacketSocket()); if (!socket->Init(type, socket_client, local_address, - talk_base::SocketAddress())) { + rtc::SocketAddress())) { return NULL; } return socket.release(); } -talk_base::AsyncPacketSocket* IpcPacketSocketFactory::CreateClientTcpSocket( - const talk_base::SocketAddress& local_address, - const talk_base::SocketAddress& remote_address, - const talk_base::ProxyInfo& proxy_info, +rtc::AsyncPacketSocket* IpcPacketSocketFactory::CreateClientTcpSocket( + const rtc::SocketAddress& local_address, + const rtc::SocketAddress& remote_address, + const rtc::ProxyInfo& proxy_info, const std::string& user_agent, int opts) { P2PSocketType type; - if (opts & talk_base::PacketSocketFactory::OPT_SSLTCP) { - type = (opts & talk_base::PacketSocketFactory::OPT_STUN) ? + if (opts & rtc::PacketSocketFactory::OPT_SSLTCP) { + type = (opts & rtc::PacketSocketFactory::OPT_STUN) ? P2P_SOCKET_STUN_SSLTCP_CLIENT : P2P_SOCKET_SSLTCP_CLIENT; - } else if (opts & talk_base::PacketSocketFactory::OPT_TLS) { - type = (opts & talk_base::PacketSocketFactory::OPT_STUN) ? + } else if (opts & rtc::PacketSocketFactory::OPT_TLS) { + type = (opts & rtc::PacketSocketFactory::OPT_STUN) ? P2P_SOCKET_STUN_TLS_CLIENT : P2P_SOCKET_TLS_CLIENT; } else { - type = (opts & talk_base::PacketSocketFactory::OPT_STUN) ? + type = (opts & rtc::PacketSocketFactory::OPT_STUN) ? P2P_SOCKET_STUN_TCP_CLIENT : P2P_SOCKET_TCP_CLIENT; } P2PSocketClientImpl* socket_client = @@ -663,7 +663,7 @@ talk_base::AsyncPacketSocket* IpcPacketSocketFactory::CreateClientTcpSocket( return socket.release(); } -talk_base::AsyncResolverInterface* +rtc::AsyncResolverInterface* IpcPacketSocketFactory::CreateAsyncResolver() { scoped_ptr<AsyncAddressResolverImpl> resolver( new AsyncAddressResolverImpl(socket_dispatcher_)); diff --git a/content/renderer/p2p/ipc_socket_factory.h b/content/renderer/p2p/ipc_socket_factory.h index cba98b3..53e1edc 100644 --- a/content/renderer/p2p/ipc_socket_factory.h +++ b/content/renderer/p2p/ipc_socket_factory.h @@ -14,33 +14,33 @@ namespace content { class P2PSocketDispatcher; -// IpcPacketSocketFactory implements talk_base::PacketSocketFactory +// IpcPacketSocketFactory implements rtc::PacketSocketFactory // interface for libjingle using IPC-based P2P sockets. The class must // be used on a thread that is a libjingle thread (implements -// talk_base::Thread) and also has associated base::MessageLoop. Each +// rtc::Thread) and also has associated base::MessageLoop. Each // socket created by the factory must be used on the thread it was // created on. -class IpcPacketSocketFactory : public talk_base::PacketSocketFactory { +class IpcPacketSocketFactory : public rtc::PacketSocketFactory { public: CONTENT_EXPORT explicit IpcPacketSocketFactory( P2PSocketDispatcher* socket_dispatcher); virtual ~IpcPacketSocketFactory(); - virtual talk_base::AsyncPacketSocket* CreateUdpSocket( - const talk_base::SocketAddress& local_address, + virtual rtc::AsyncPacketSocket* CreateUdpSocket( + const rtc::SocketAddress& local_address, int min_port, int max_port) OVERRIDE; - virtual talk_base::AsyncPacketSocket* CreateServerTcpSocket( - const talk_base::SocketAddress& local_address, + virtual rtc::AsyncPacketSocket* CreateServerTcpSocket( + const rtc::SocketAddress& local_address, int min_port, int max_port, int opts) OVERRIDE; - virtual talk_base::AsyncPacketSocket* CreateClientTcpSocket( - const talk_base::SocketAddress& local_address, - const talk_base::SocketAddress& remote_address, - const talk_base::ProxyInfo& proxy_info, + virtual rtc::AsyncPacketSocket* CreateClientTcpSocket( + const rtc::SocketAddress& local_address, + const rtc::SocketAddress& remote_address, + const rtc::ProxyInfo& proxy_info, const std::string& user_agent, int opts) OVERRIDE; - virtual talk_base::AsyncResolverInterface* CreateAsyncResolver() OVERRIDE; + virtual rtc::AsyncResolverInterface* CreateAsyncResolver() OVERRIDE; private: P2PSocketDispatcher* socket_dispatcher_; diff --git a/content/renderer/p2p/port_allocator.cc b/content/renderer/p2p/port_allocator.cc index 61cfefd..be6a72e 100644 --- a/content/renderer/p2p/port_allocator.cc +++ b/content/renderer/p2p/port_allocator.cc @@ -69,8 +69,8 @@ P2PPortAllocator::Config::RelayServerConfig::~RelayServerConfig() { P2PPortAllocator::P2PPortAllocator( blink::WebFrame* web_frame, P2PSocketDispatcher* socket_dispatcher, - talk_base::NetworkManager* network_manager, - talk_base::PacketSocketFactory* socket_factory, + rtc::NetworkManager* network_manager, + rtc::PacketSocketFactory* socket_factory, const Config& config) : cricket::BasicPortAllocator(network_manager, socket_factory), web_frame_(web_frame), @@ -259,7 +259,7 @@ void P2PPortAllocatorSession::ParseRelayResponse() { void P2PPortAllocatorSession::AddConfig() { const P2PPortAllocator::Config& config = allocator_->config_; cricket::PortConfiguration* port_config = new cricket::PortConfiguration( - talk_base::SocketAddress(config.stun_server, config.stun_server_port), + rtc::SocketAddress(config.stun_server, config.stun_server_port), std::string(), std::string()); for (size_t i = 0; i < config.relays.size(); ++i) { @@ -278,7 +278,7 @@ void P2PPortAllocatorSession::AddConfig() { } relay_server.ports.push_back(cricket::ProtocolAddress( - talk_base::SocketAddress(config.relays[i].server_address, + rtc::SocketAddress(config.relays[i].server_address, config.relays[i].port), protocol, config.relays[i].secure)); diff --git a/content/renderer/p2p/port_allocator.h b/content/renderer/p2p/port_allocator.h index 8ff20a5..258d785 100644 --- a/content/renderer/p2p/port_allocator.h +++ b/content/renderer/p2p/port_allocator.h @@ -56,8 +56,8 @@ class P2PPortAllocator : public cricket::BasicPortAllocator { P2PPortAllocator(blink::WebFrame* web_frame, P2PSocketDispatcher* socket_dispatcher, - talk_base::NetworkManager* network_manager, - talk_base::PacketSocketFactory* socket_factory, + rtc::NetworkManager* network_manager, + rtc::PacketSocketFactory* socket_factory, const Config& config); virtual ~P2PPortAllocator(); @@ -115,7 +115,7 @@ class P2PPortAllocatorSession : public cricket::BasicPortAllocatorSession, scoped_ptr<blink::WebURLLoader> relay_session_request_; int relay_session_attempts_; std::string relay_session_response_; - talk_base::SocketAddress relay_ip_; + rtc::SocketAddress relay_ip_; int relay_udp_port_; int relay_tcp_port_; int relay_ssltcp_port_; diff --git a/content/renderer/p2p/socket_client.h b/content/renderer/p2p/socket_client.h index 5d1ecb5..d92407c 100644 --- a/content/renderer/p2p/socket_client.h +++ b/content/renderer/p2p/socket_client.h @@ -11,7 +11,7 @@ #include "content/common/p2p_socket_type.h" #include "net/base/ip_endpoint.h" -namespace talk_base { +namespace rtc { struct PacketOptions; }; @@ -44,7 +44,7 @@ class P2PSocketClient : public base::RefCountedThreadSafe<P2PSocketClient> { // |dscp|. virtual void SendWithDscp(const net::IPEndPoint& address, const std::vector<char>& data, - const talk_base::PacketOptions& options) = 0; + const rtc::PacketOptions& options) = 0; virtual void SetOption(P2PSocketOption option, int value) = 0; diff --git a/content/renderer/p2p/socket_client_impl.cc b/content/renderer/p2p/socket_client_impl.cc index cfa898f..1425151 100644 --- a/content/renderer/p2p/socket_client_impl.cc +++ b/content/renderer/p2p/socket_client_impl.cc @@ -72,7 +72,7 @@ void P2PSocketClientImpl::DoInit(P2PSocketType type, void P2PSocketClientImpl::SendWithDscp( const net::IPEndPoint& address, const std::vector<char>& data, - const talk_base::PacketOptions& options) { + const rtc::PacketOptions& options) { if (!ipc_message_loop_->BelongsToCurrentThread()) { ipc_message_loop_->PostTask( FROM_HERE, base::Bind( @@ -92,7 +92,7 @@ void P2PSocketClientImpl::SendWithDscp( void P2PSocketClientImpl::Send(const net::IPEndPoint& address, const std::vector<char>& data) { - talk_base::PacketOptions options(talk_base::DSCP_DEFAULT); + rtc::PacketOptions options(rtc::DSCP_DEFAULT); SendWithDscp(address, data, options); } diff --git a/content/renderer/p2p/socket_client_impl.h b/content/renderer/p2p/socket_client_impl.h index ae19758..89e48c0 100644 --- a/content/renderer/p2p/socket_client_impl.h +++ b/content/renderer/p2p/socket_client_impl.h @@ -47,7 +47,7 @@ class P2PSocketClientImpl : public P2PSocketClient { // |dscp|. virtual void SendWithDscp(const net::IPEndPoint& address, const std::vector<char>& data, - const talk_base::PacketOptions& options) OVERRIDE; + const rtc::PacketOptions& options) OVERRIDE; // Setting socket options. virtual void SetOption(P2PSocketOption option, int value) OVERRIDE; diff --git a/content/renderer/pepper/pepper_media_stream_video_track_host.cc b/content/renderer/pepper/pepper_media_stream_video_track_host.cc index 604d827..318965e 100644 --- a/content/renderer/pepper/pepper_media_stream_video_track_host.cc +++ b/content/renderer/pepper/pepper_media_stream_video_track_host.cc @@ -20,7 +20,7 @@ #include "ppapi/shared_impl/media_stream_buffer.h" // IS_ALIGNED is also defined in -// third_party/libjingle/overrides/talk/base/basictypes.h +// third_party/webrtc/overrides/webrtc/base/basictypes.h // TODO(ronghuawu): Avoid undef. #undef IS_ALIGNED #include "third_party/libyuv/include/libyuv.h" diff --git a/jingle/glue/DEPS b/jingle/glue/DEPS index 708fdc5..790c9b7 100644 --- a/jingle/glue/DEPS +++ b/jingle/glue/DEPS @@ -1,4 +1,5 @@ # Needed by logging_unittest.cc since it tests the overrides. include_rules = [ "+third_party/libjingle/overrides", + "+third_party/webrtc", ]
\ No newline at end of file diff --git a/jingle/glue/channel_socket_adapter.cc b/jingle/glue/channel_socket_adapter.cc index bca4222..1645f96 100644 --- a/jingle/glue/channel_socket_adapter.cc +++ b/jingle/glue/channel_socket_adapter.cc @@ -76,7 +76,7 @@ int TransportChannelSocketAdapter::Write( } int result; - talk_base::PacketOptions options; + rtc::PacketOptions options; if (channel_->writable()) { result = channel_->SendPacket(buffer->data(), buffer_size, options); if (result < 0) { @@ -101,13 +101,13 @@ int TransportChannelSocketAdapter::Write( int TransportChannelSocketAdapter::SetReceiveBufferSize(int32 size) { DCHECK_EQ(base::MessageLoop::current(), message_loop_); - return (channel_->SetOption(talk_base::Socket::OPT_RCVBUF, size) == 0) ? + return (channel_->SetOption(rtc::Socket::OPT_RCVBUF, size) == 0) ? net::OK : net::ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR; } int TransportChannelSocketAdapter::SetSendBufferSize(int32 size) { DCHECK_EQ(base::MessageLoop::current(), message_loop_); - return (channel_->SetOption(talk_base::Socket::OPT_SNDBUF, size) == 0) ? + return (channel_->SetOption(rtc::Socket::OPT_SNDBUF, size) == 0) ? net::OK : net::ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR; } @@ -142,7 +142,7 @@ void TransportChannelSocketAdapter::OnNewPacket( cricket::TransportChannel* channel, const char* data, size_t data_size, - const talk_base::PacketTime& packet_time, + const rtc::PacketTime& packet_time, int flags) { DCHECK_EQ(base::MessageLoop::current(), message_loop_); DCHECK_EQ(channel, channel_); @@ -174,7 +174,7 @@ 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; + rtc::PacketOptions options; int result = channel_->SendPacket(write_buffer_->data(), write_buffer_size_, options); diff --git a/jingle/glue/channel_socket_adapter.h b/jingle/glue/channel_socket_adapter.h index fc90df9..8bd330f 100644 --- a/jingle/glue/channel_socket_adapter.h +++ b/jingle/glue/channel_socket_adapter.h @@ -8,9 +8,9 @@ #include "base/callback_forward.h" #include "base/compiler_specific.h" #include "net/socket/socket.h" -#include "third_party/libjingle/source/talk/base/asyncpacketsocket.h" -#include "third_party/libjingle/source/talk/base/socketaddress.h" -#include "third_party/libjingle/source/talk/base/sigslot.h" +#include "third_party/webrtc/base/asyncpacketsocket.h" +#include "third_party/webrtc/base/sigslot.h" +#include "third_party/webrtc/base/socketaddress.h" namespace base { class MessageLoop; @@ -55,7 +55,7 @@ class TransportChannelSocketAdapter : public net::Socket, void OnNewPacket(cricket::TransportChannel* channel, const char* data, size_t data_size, - const talk_base::PacketTime& packet_time, + const rtc::PacketTime& packet_time, int flags); void OnWritableState(cricket::TransportChannel* channel); void OnChannelDestroyed(cricket::TransportChannel* channel); diff --git a/jingle/glue/channel_socket_adapter_unittest.cc b/jingle/glue/channel_socket_adapter_unittest.cc index 436f8f7..2baa37f 100644 --- a/jingle/glue/channel_socket_adapter_unittest.cc +++ b/jingle/glue/channel_socket_adapter_unittest.cc @@ -36,19 +36,19 @@ class MockTransportChannel : public cricket::TransportChannel { MOCK_METHOD4(SendPacket, int(const char* data, size_t len, - const talk_base::PacketOptions& options, + const rtc::PacketOptions& options, int flags)); - MOCK_METHOD2(SetOption, int(talk_base::Socket::Option opt, int value)); + MOCK_METHOD2(SetOption, int(rtc::Socket::Option opt, int value)); MOCK_METHOD0(GetError, int()); MOCK_CONST_METHOD0(GetIceRole, cricket::IceRole()); MOCK_METHOD1(GetStats, bool(cricket::ConnectionInfos* infos)); MOCK_CONST_METHOD0(IsDtlsActive, bool()); - MOCK_CONST_METHOD1(GetSslRole, bool(talk_base::SSLRole* role)); + MOCK_CONST_METHOD1(GetSslRole, bool(rtc::SSLRole* role)); MOCK_METHOD1(SetSrtpCiphers, bool(const std::vector<std::string>& ciphers)); MOCK_METHOD1(GetSrtpCipher, bool(std::string* cipher)); - MOCK_CONST_METHOD1(GetLocalIdentity, bool(talk_base::SSLIdentity** identity)); + MOCK_CONST_METHOD1(GetLocalIdentity, bool(rtc::SSLIdentity** identity)); MOCK_CONST_METHOD1(GetRemoteCertificate, - bool(talk_base::SSLCertificate** cert)); + bool(rtc::SSLCertificate** cert)); MOCK_METHOD6(ExportKeyingMaterial, bool(const std::string& label, const uint8* context, size_t context_len, @@ -89,7 +89,7 @@ TEST_F(TransportChannelSocketAdapterTest, Read) { ASSERT_EQ(net::ERR_IO_PENDING, result); channel_.SignalReadPacket(&channel_, kTestData, kTestDataSize, - talk_base::CreatePacketTime(0), 0); + rtc::CreatePacketTime(0), 0); EXPECT_EQ(kTestDataSize, callback_result_); } diff --git a/jingle/glue/chrome_async_socket.cc b/jingle/glue/chrome_async_socket.cc index 2c9812c..dc42e7e 100644 --- a/jingle/glue/chrome_async_socket.cc +++ b/jingle/glue/chrome_async_socket.cc @@ -22,7 +22,7 @@ #include "net/socket/ssl_client_socket.h" #include "net/socket/tcp_client_socket.h" #include "net/ssl/ssl_config_service.h" -#include "third_party/libjingle/source/talk/base/socketaddress.h" +#include "third_party/webrtc/base/socketaddress.h" namespace jingle_glue { @@ -84,7 +84,7 @@ void ChromeAsyncSocket::DoNetErrorFromStatus(int status) { // STATE_CLOSED -> STATE_CONNECTING -bool ChromeAsyncSocket::Connect(const talk_base::SocketAddress& address) { +bool ChromeAsyncSocket::Connect(const rtc::SocketAddress& address) { if (state_ != STATE_CLOSED) { LOG(DFATAL) << "Connect() called on non-closed socket"; DoNonNetError(ERROR_WRONGSTATE); diff --git a/jingle/glue/chrome_async_socket.h b/jingle/glue/chrome_async_socket.h index 7253ded..18c83ca 100644 --- a/jingle/glue/chrome_async_socket.h +++ b/jingle/glue/chrome_async_socket.h @@ -72,7 +72,7 @@ class ChromeAsyncSocket : public buzz::AsyncSocket { // Otherwise, starts the connection process and returns true. // SignalConnected will be raised when the connection is successful; // otherwise, SignalClosed will be raised with a net error set. - virtual bool Connect(const talk_base::SocketAddress& address) OVERRIDE; + virtual bool Connect(const rtc::SocketAddress& address) OVERRIDE; // Tries to read at most |len| bytes into |data|. // diff --git a/jingle/glue/chrome_async_socket_unittest.cc b/jingle/glue/chrome_async_socket_unittest.cc index b3c81b1..a26c136 100644 --- a/jingle/glue/chrome_async_socket_unittest.cc +++ b/jingle/glue/chrome_async_socket_unittest.cc @@ -23,9 +23,9 @@ #include "net/ssl/ssl_config_service.h" #include "net/url_request/url_request_context_getter.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/libjingle/source/talk/base/ipaddress.h" -#include "third_party/libjingle/source/talk/base/sigslot.h" -#include "third_party/libjingle/source/talk/base/socketaddress.h" +#include "third_party/webrtc/base/ipaddress.h" +#include "third_party/webrtc/base/sigslot.h" +#include "third_party/webrtc/base/socketaddress.h" namespace jingle_glue { @@ -431,7 +431,7 @@ class ChromeAsyncSocketTest scoped_ptr<ChromeAsyncSocket> chrome_async_socket_; std::deque<SignalSocketState> signal_socket_states_; - const talk_base::SocketAddress addr_; + const rtc::SocketAddress addr_; private: DISALLOW_COPY_AND_ASSIGN(ChromeAsyncSocketTest); @@ -473,9 +473,9 @@ TEST_F(ChromeAsyncSocketTest, DoubleClose) { } TEST_F(ChromeAsyncSocketTest, NoHostnameConnect) { - talk_base::IPAddress ip_address; - EXPECT_TRUE(talk_base::IPFromString("127.0.0.1", &ip_address)); - const talk_base::SocketAddress no_hostname_addr(ip_address, addr_.port()); + rtc::IPAddress ip_address; + EXPECT_TRUE(rtc::IPFromString("127.0.0.1", &ip_address)); + const rtc::SocketAddress no_hostname_addr(ip_address, addr_.port()); EXPECT_FALSE(chrome_async_socket_->Connect(no_hostname_addr)); ExpectErrorState(ChromeAsyncSocket::STATE_CLOSED, ChromeAsyncSocket::ERROR_DNS); @@ -485,7 +485,7 @@ TEST_F(ChromeAsyncSocketTest, NoHostnameConnect) { } TEST_F(ChromeAsyncSocketTest, ZeroPortConnect) { - const talk_base::SocketAddress zero_port_addr(addr_.hostname(), 0); + const rtc::SocketAddress zero_port_addr(addr_.hostname(), 0); EXPECT_FALSE(chrome_async_socket_->Connect(zero_port_addr)); ExpectErrorState(ChromeAsyncSocket::STATE_CLOSED, ChromeAsyncSocket::ERROR_DNS); diff --git a/jingle/glue/jingle_glue_mock_objects.h b/jingle/glue/jingle_glue_mock_objects.h index e2cd704..f34e6b0 100644 --- a/jingle/glue/jingle_glue_mock_objects.h +++ b/jingle/glue/jingle_glue_mock_objects.h @@ -6,24 +6,24 @@ #define JINGLE_GLUE_JINGLE_GLUE_MOCK_OBJECTS_H_ #include "testing/gmock/include/gmock/gmock.h" -#include "third_party/libjingle/source/talk/base/stream.h" +#include "third_party/webrtc/base/stream.h" namespace jingle_glue { -class MockStream : public talk_base::StreamInterface { +class MockStream : public rtc::StreamInterface { public: MockStream(); virtual ~MockStream(); - MOCK_CONST_METHOD0(GetState, talk_base::StreamState()); + MOCK_CONST_METHOD0(GetState, rtc::StreamState()); - MOCK_METHOD4(Read, talk_base::StreamResult(void*, size_t, size_t*, int*)); - MOCK_METHOD4(Write, talk_base::StreamResult(const void*, size_t, + MOCK_METHOD4(Read, rtc::StreamResult(void*, size_t, size_t*, int*)); + MOCK_METHOD4(Write, rtc::StreamResult(const void*, size_t, size_t*, int*)); MOCK_CONST_METHOD1(GetAvailable, bool(size_t*)); MOCK_METHOD0(Close, void()); - MOCK_METHOD3(PostEvent, void(talk_base::Thread*, int, int)); + MOCK_METHOD3(PostEvent, void(rtc::Thread*, int, int)); MOCK_METHOD2(PostEvent, void(int, int)); }; diff --git a/jingle/glue/logging_unittest.cc b/jingle/glue/logging_unittest.cc index ba1f8594..1cbf01a 100644 --- a/jingle/glue/logging_unittest.cc +++ b/jingle/glue/logging_unittest.cc @@ -9,9 +9,9 @@ // The following include must be first in this file. It ensures that // libjingle style logging is used. -#define LOGGING_INSIDE_LIBJINGLE +#define LOGGING_INSIDE_WEBRTC -#include "third_party/libjingle/overrides/talk/base/logging.h" +#include "third_party/webrtc/overrides/webrtc/base/logging.h" #include "base/command_line.h" #include "base/file_util.h" @@ -25,17 +25,17 @@ static const char* const log_file_name = "libjingle_logging.log"; static const int kDefaultVerbosity = 0; -static const char* AsString(talk_base::LoggingSeverity severity) { +static const char* AsString(rtc::LoggingSeverity severity) { switch (severity) { - case talk_base::LS_ERROR: + case rtc::LS_ERROR: return "LS_ERROR"; - case talk_base::LS_WARNING: + case rtc::LS_WARNING: return "LS_WARNING"; - case talk_base::LS_INFO: + case rtc::LS_INFO: return "LS_INFO"; - case talk_base::LS_VERBOSE: + case rtc::LS_VERBOSE: return "LS_VERBOSE"; - case talk_base::LS_SENSITIVE: + case rtc::LS_SENSITIVE: return "LS_SENSITIVE"; default: return ""; @@ -75,11 +75,11 @@ TEST(LibjingleLogTest, DefaultConfiguration) { ASSERT_TRUE(Initialize(kDefaultVerbosity)); // In the default configuration nothing should be logged. - LOG_V(talk_base::LS_ERROR) << AsString(talk_base::LS_ERROR); - LOG_V(talk_base::LS_WARNING) << AsString(talk_base::LS_WARNING); - LOG_V(talk_base::LS_INFO) << AsString(talk_base::LS_INFO); - LOG_V(talk_base::LS_VERBOSE) << AsString(talk_base::LS_VERBOSE); - LOG_V(talk_base::LS_SENSITIVE) << AsString(talk_base::LS_SENSITIVE); + LOG_V(rtc::LS_ERROR) << AsString(rtc::LS_ERROR); + LOG_V(rtc::LS_WARNING) << AsString(rtc::LS_WARNING); + LOG_V(rtc::LS_INFO) << AsString(rtc::LS_INFO); + LOG_V(rtc::LS_VERBOSE) << AsString(rtc::LS_VERBOSE); + LOG_V(rtc::LS_SENSITIVE) << AsString(rtc::LS_SENSITIVE); // Read file to string. base::FilePath file_path(log_file_name); @@ -87,26 +87,26 @@ TEST(LibjingleLogTest, DefaultConfiguration) { base::ReadFileToString(file_path, &contents_of_file); // Make sure string contains the expected values. - EXPECT_FALSE(ContainsString(contents_of_file, AsString(talk_base::LS_ERROR))); + EXPECT_FALSE(ContainsString(contents_of_file, AsString(rtc::LS_ERROR))); EXPECT_FALSE(ContainsString(contents_of_file, - AsString(talk_base::LS_WARNING))); - EXPECT_FALSE(ContainsString(contents_of_file, AsString(talk_base::LS_INFO))); + AsString(rtc::LS_WARNING))); + EXPECT_FALSE(ContainsString(contents_of_file, AsString(rtc::LS_INFO))); EXPECT_FALSE(ContainsString(contents_of_file, - AsString(talk_base::LS_VERBOSE))); + AsString(rtc::LS_VERBOSE))); EXPECT_FALSE(ContainsString(contents_of_file, - AsString(talk_base::LS_SENSITIVE))); + AsString(rtc::LS_SENSITIVE))); } TEST(LibjingleLogTest, InfoConfiguration) { - ASSERT_TRUE(Initialize(talk_base::LS_INFO)); + ASSERT_TRUE(Initialize(rtc::LS_INFO)); // In this configuration everything lower or equal to LS_INFO should be // logged. - LOG_V(talk_base::LS_ERROR) << AsString(talk_base::LS_ERROR); - LOG_V(talk_base::LS_WARNING) << AsString(talk_base::LS_WARNING); - LOG_V(talk_base::LS_INFO) << AsString(talk_base::LS_INFO); - LOG_V(talk_base::LS_VERBOSE) << AsString(talk_base::LS_VERBOSE); - LOG_V(talk_base::LS_SENSITIVE) << AsString(talk_base::LS_SENSITIVE); + LOG_V(rtc::LS_ERROR) << AsString(rtc::LS_ERROR); + LOG_V(rtc::LS_WARNING) << AsString(rtc::LS_WARNING); + LOG_V(rtc::LS_INFO) << AsString(rtc::LS_INFO); + LOG_V(rtc::LS_VERBOSE) << AsString(rtc::LS_VERBOSE); + LOG_V(rtc::LS_SENSITIVE) << AsString(rtc::LS_SENSITIVE); // Read file to string. base::FilePath file_path(log_file_name); @@ -114,14 +114,14 @@ TEST(LibjingleLogTest, InfoConfiguration) { base::ReadFileToString(file_path, &contents_of_file); // Make sure string contains the expected values. - EXPECT_TRUE(ContainsString(contents_of_file, AsString(talk_base::LS_ERROR))); + EXPECT_TRUE(ContainsString(contents_of_file, AsString(rtc::LS_ERROR))); EXPECT_TRUE(ContainsString(contents_of_file, - AsString(talk_base::LS_WARNING))); - EXPECT_TRUE(ContainsString(contents_of_file, AsString(talk_base::LS_INFO))); + AsString(rtc::LS_WARNING))); + EXPECT_TRUE(ContainsString(contents_of_file, AsString(rtc::LS_INFO))); EXPECT_FALSE(ContainsString(contents_of_file, - AsString(talk_base::LS_VERBOSE))); + AsString(rtc::LS_VERBOSE))); EXPECT_FALSE(ContainsString(contents_of_file, - AsString(talk_base::LS_SENSITIVE))); + AsString(rtc::LS_SENSITIVE))); // Also check that the log is proper. EXPECT_TRUE(ContainsString(contents_of_file, "logging_unittest.cc")); @@ -130,17 +130,17 @@ TEST(LibjingleLogTest, InfoConfiguration) { } TEST(LibjingleLogTest, LogEverythingConfiguration) { - ASSERT_TRUE(Initialize(talk_base::LS_SENSITIVE)); + ASSERT_TRUE(Initialize(rtc::LS_SENSITIVE)); // In this configuration everything should be logged. - LOG_V(talk_base::LS_ERROR) << AsString(talk_base::LS_ERROR); - LOG_V(talk_base::LS_WARNING) << AsString(talk_base::LS_WARNING); - LOG(LS_INFO) << AsString(talk_base::LS_INFO); + LOG_V(rtc::LS_ERROR) << AsString(rtc::LS_ERROR); + LOG_V(rtc::LS_WARNING) << AsString(rtc::LS_WARNING); + LOG(LS_INFO) << AsString(rtc::LS_INFO); static const int kFakeError = 1; - LOG_E(LS_INFO, EN, kFakeError) << "LOG_E(" << AsString(talk_base::LS_INFO) << + LOG_E(LS_INFO, EN, kFakeError) << "LOG_E(" << AsString(rtc::LS_INFO) << ")"; - LOG_V(talk_base::LS_VERBOSE) << AsString(talk_base::LS_VERBOSE); - LOG_V(talk_base::LS_SENSITIVE) << AsString(talk_base::LS_SENSITIVE); + LOG_V(rtc::LS_VERBOSE) << AsString(rtc::LS_VERBOSE); + LOG_V(rtc::LS_SENSITIVE) << AsString(rtc::LS_SENSITIVE); // Read file to string. base::FilePath file_path(log_file_name); @@ -148,14 +148,14 @@ TEST(LibjingleLogTest, LogEverythingConfiguration) { base::ReadFileToString(file_path, &contents_of_file); // Make sure string contains the expected values. - EXPECT_TRUE(ContainsString(contents_of_file, AsString(talk_base::LS_ERROR))); + EXPECT_TRUE(ContainsString(contents_of_file, AsString(rtc::LS_ERROR))); EXPECT_TRUE(ContainsString(contents_of_file, - AsString(talk_base::LS_WARNING))); - EXPECT_TRUE(ContainsString(contents_of_file, AsString(talk_base::LS_INFO))); + AsString(rtc::LS_WARNING))); + EXPECT_TRUE(ContainsString(contents_of_file, AsString(rtc::LS_INFO))); // LOG_E EXPECT_TRUE(ContainsString(contents_of_file, strerror(kFakeError))); EXPECT_TRUE(ContainsString(contents_of_file, - AsString(talk_base::LS_VERBOSE))); + AsString(rtc::LS_VERBOSE))); EXPECT_TRUE(ContainsString(contents_of_file, - AsString(talk_base::LS_SENSITIVE))); + AsString(rtc::LS_SENSITIVE))); } diff --git a/jingle/glue/mock_task.cc b/jingle/glue/mock_task.cc index 8894fbe..f9de76c 100644 --- a/jingle/glue/mock_task.cc +++ b/jingle/glue/mock_task.cc @@ -6,7 +6,7 @@ namespace jingle_glue { -MockTask::MockTask(TaskParent* parent) : talk_base::Task(parent) {} +MockTask::MockTask(TaskParent* parent) : rtc::Task(parent) {} MockTask::~MockTask() {} diff --git a/jingle/glue/mock_task.h b/jingle/glue/mock_task.h index 7fdaddf..676de0f 100644 --- a/jingle/glue/mock_task.h +++ b/jingle/glue/mock_task.h @@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // -// A mock of talk_base::Task. +// A mock of rtc::Task. #ifndef JINGLE_GLUE_MOCK_TASK_H_ #define JINGLE_GLUE_MOCK_TASK_H_ #include "testing/gmock/include/gmock/gmock.h" -#include "third_party/libjingle/source/talk/base/task.h" +#include "third_party/webrtc/base/task.h" namespace jingle_glue { -class MockTask : public talk_base::Task { +class MockTask : public rtc::Task { public: MockTask(TaskParent* parent); diff --git a/jingle/glue/task_pump.h b/jingle/glue/task_pump.h index a90cab6..aae8f7db 100644 --- a/jingle/glue/task_pump.h +++ b/jingle/glue/task_pump.h @@ -8,18 +8,18 @@ #include "base/compiler_specific.h" #include "base/memory/weak_ptr.h" #include "base/threading/non_thread_safe.h" -#include "third_party/libjingle/source/talk/base/taskrunner.h" +#include "third_party/webrtc/base/taskrunner.h" namespace jingle_glue { -// talk_base::TaskRunner implementation that works on chromium threads. -class TaskPump : public talk_base::TaskRunner, public base::NonThreadSafe { +// rtc::TaskRunner implementation that works on chromium threads. +class TaskPump : public rtc::TaskRunner, public base::NonThreadSafe { public: TaskPump(); virtual ~TaskPump(); - // talk_base::TaskRunner implementation. + // rtc::TaskRunner implementation. virtual void WakeTasks() OVERRIDE; virtual int64 CurrentTime() OVERRIDE; diff --git a/jingle/glue/task_pump_unittest.cc b/jingle/glue/task_pump_unittest.cc index a9d5c5c..0782f8f 100644 --- a/jingle/glue/task_pump_unittest.cc +++ b/jingle/glue/task_pump_unittest.cc @@ -23,7 +23,7 @@ TEST_F(TaskPumpTest, Basic) { TaskPump task_pump; MockTask* task = new MockTask(&task_pump); // We have to do this since the state enum is protected in - // talk_base::Task. + // rtc::Task. const int TASK_STATE_DONE = 2; EXPECT_CALL(*task, ProcessStart()).WillOnce(Return(TASK_STATE_DONE)); task->Start(); @@ -35,7 +35,7 @@ TEST_F(TaskPumpTest, Stop) { TaskPump task_pump; MockTask* task = new MockTask(&task_pump); // We have to do this since the state enum is protected in - // talk_base::Task. + // rtc::Task. const int TASK_STATE_ERROR = 3; ON_CALL(*task, ProcessStart()).WillByDefault(Return(TASK_STATE_ERROR)); EXPECT_CALL(*task, ProcessStart()).Times(0); diff --git a/jingle/glue/thread_wrapper.cc b/jingle/glue/thread_wrapper.cc index e2109fe..af69c24 100644 --- a/jingle/glue/thread_wrapper.cc +++ b/jingle/glue/thread_wrapper.cc @@ -8,12 +8,12 @@ #include "base/bind_helpers.h" #include "base/lazy_instance.h" #include "base/threading/thread_local.h" -#include "third_party/libjingle/source/talk/base/nullsocketserver.h" +#include "third_party/webrtc/base/nullsocketserver.h" namespace jingle_glue { struct JingleThreadWrapper::PendingSend { - PendingSend(const talk_base::Message& message_value) + PendingSend(const rtc::Message& message_value) : sending_thread(JingleThreadWrapper::current()), message(message_value), done_event(true, false) { @@ -21,7 +21,7 @@ struct JingleThreadWrapper::PendingSend { } JingleThreadWrapper* sending_thread; - talk_base::Message message; + rtc::Message message; base::WaitableEvent done_event; }; @@ -37,7 +37,7 @@ void JingleThreadWrapper::EnsureForCurrentMessageLoop() { message_loop->AddDestructionObserver(current()); } - DCHECK_EQ(talk_base::Thread::Current(), current()); + DCHECK_EQ(rtc::Thread::Current(), current()); } // static @@ -47,48 +47,48 @@ JingleThreadWrapper* JingleThreadWrapper::current() { JingleThreadWrapper::JingleThreadWrapper( scoped_refptr<base::SingleThreadTaskRunner> task_runner) - : talk_base::Thread(new talk_base::NullSocketServer()), + : rtc::Thread(new rtc::NullSocketServer()), task_runner_(task_runner), send_allowed_(false), last_task_id_(0), pending_send_event_(true, false), weak_ptr_factory_(this) { DCHECK(task_runner->BelongsToCurrentThread()); - DCHECK(!talk_base::Thread::Current()); + DCHECK(!rtc::Thread::Current()); weak_ptr_ = weak_ptr_factory_.GetWeakPtr(); - talk_base::MessageQueueManager::Add(this); + rtc::MessageQueueManager::Add(this); WrapCurrent(); } JingleThreadWrapper::~JingleThreadWrapper() { - Clear(NULL, talk_base::MQID_ANY, NULL); + Clear(NULL, rtc::MQID_ANY, NULL); } void JingleThreadWrapper::WillDestroyCurrentMessageLoop() { - DCHECK_EQ(talk_base::Thread::Current(), current()); + DCHECK_EQ(rtc::Thread::Current(), current()); UnwrapCurrent(); g_jingle_thread_wrapper.Get().Set(NULL); - talk_base::ThreadManager::Instance()->SetCurrentThread(NULL); - talk_base::MessageQueueManager::Remove(this); - talk_base::SocketServer* ss = socketserver(); + rtc::ThreadManager::Instance()->SetCurrentThread(NULL); + rtc::MessageQueueManager::Remove(this); + rtc::SocketServer* ss = socketserver(); delete this; delete ss; } void JingleThreadWrapper::Post( - talk_base::MessageHandler* handler, uint32 message_id, - talk_base::MessageData* data, bool time_sensitive) { + rtc::MessageHandler* handler, uint32 message_id, + rtc::MessageData* data, bool time_sensitive) { PostTaskInternal(0, handler, message_id, data); } void JingleThreadWrapper::PostDelayed( - int delay_ms, talk_base::MessageHandler* handler, - uint32 message_id, talk_base::MessageData* data) { + int delay_ms, rtc::MessageHandler* handler, + uint32 message_id, rtc::MessageData* data) { PostTaskInternal(delay_ms, handler, message_id, data); } -void JingleThreadWrapper::Clear(talk_base::MessageHandler* handler, uint32 id, - talk_base::MessageList* removed) { +void JingleThreadWrapper::Clear(rtc::MessageHandler* handler, uint32 id, + rtc::MessageList* removed) { base::AutoLock auto_lock(lock_); for (MessagesQueue::iterator it = messages_.begin(); @@ -127,8 +127,8 @@ void JingleThreadWrapper::Clear(talk_base::MessageHandler* handler, uint32 id, } } -void JingleThreadWrapper::Send(talk_base::MessageHandler *handler, uint32 id, - talk_base::MessageData *data) { +void JingleThreadWrapper::Send(rtc::MessageHandler *handler, uint32 id, + rtc::MessageData *data) { if (fStop_) return; @@ -136,7 +136,7 @@ void JingleThreadWrapper::Send(talk_base::MessageHandler *handler, uint32 id, DCHECK(current_thread != NULL) << "Send() can be called only from a " "thread that has JingleThreadWrapper."; - talk_base::Message message; + rtc::Message message; message.phandler = handler; message.message_id = id; message.pdata = data; @@ -200,17 +200,17 @@ void JingleThreadWrapper::ProcessPendingSends() { } void JingleThreadWrapper::PostTaskInternal( - int delay_ms, talk_base::MessageHandler* handler, - uint32 message_id, talk_base::MessageData* data) { + int delay_ms, rtc::MessageHandler* handler, + uint32 message_id, rtc::MessageData* data) { int task_id; - talk_base::Message message; + rtc::Message message; message.phandler = handler; message.message_id = message_id; message.pdata = data; { base::AutoLock auto_lock(lock_); task_id = ++last_task_id_; - messages_.insert(std::pair<int, talk_base::Message>(task_id, message)); + messages_.insert(std::pair<int, rtc::Message>(task_id, message)); } if (delay_ms <= 0) { @@ -227,7 +227,7 @@ void JingleThreadWrapper::PostTaskInternal( void JingleThreadWrapper::RunTask(int task_id) { bool have_message = false; - talk_base::Message message; + rtc::Message message; { base::AutoLock auto_lock(lock_); MessagesQueue::iterator it = messages_.find(task_id); @@ -239,7 +239,7 @@ void JingleThreadWrapper::RunTask(int task_id) { } if (have_message) { - if (message.message_id == talk_base::MQID_DISPOSE) { + if (message.message_id == rtc::MQID_DISPOSE) { DCHECK(message.phandler == NULL); delete message.pdata; } else { @@ -263,22 +263,22 @@ void JingleThreadWrapper::Restart() { NOTREACHED(); } -bool JingleThreadWrapper::Get(talk_base::Message*, int, bool) { +bool JingleThreadWrapper::Get(rtc::Message*, int, bool) { NOTREACHED(); return false; } -bool JingleThreadWrapper::Peek(talk_base::Message*, int) { +bool JingleThreadWrapper::Peek(rtc::Message*, int) { NOTREACHED(); return false; } -void JingleThreadWrapper::PostAt(uint32, talk_base::MessageHandler*, - uint32, talk_base::MessageData*) { +void JingleThreadWrapper::PostAt(uint32, rtc::MessageHandler*, + uint32, rtc::MessageData*) { NOTREACHED(); } -void JingleThreadWrapper::Dispatch(talk_base::Message* message) { +void JingleThreadWrapper::Dispatch(rtc::Message* message) { NOTREACHED(); } diff --git a/jingle/glue/thread_wrapper.h b/jingle/glue/thread_wrapper.h index 97e8588..e1365c9 100644 --- a/jingle/glue/thread_wrapper.h +++ b/jingle/glue/thread_wrapper.h @@ -12,11 +12,11 @@ #include "base/message_loop/message_loop.h" #include "base/synchronization/lock.h" #include "base/synchronization/waitable_event.h" -#include "third_party/libjingle/source/talk/base/thread.h" +#include "third_party/webrtc/base/thread.h" namespace jingle_glue { -// JingleThreadWrapper implements talk_base::Thread interface on top of +// JingleThreadWrapper implements rtc::Thread interface on top of // Chromium's SingleThreadTaskRunner interface. Currently only the bare minimum // that is used by P2P part of libjingle is implemented. There are two ways to // create this object: @@ -28,7 +28,7 @@ namespace jingle_glue { // must pass a valid task runner for the current thread and also delete the // wrapper later. class JingleThreadWrapper : public base::MessageLoop::DestructionObserver, - public talk_base::Thread { + public rtc::Thread { public: // Create JingleThreadWrapper for the current thread if it hasn't been created // yet. The thread wrapper is destroyed automatically when the current @@ -54,21 +54,21 @@ class JingleThreadWrapper : public base::MessageLoop::DestructionObserver, // MessageLoop::DestructionObserver implementation. virtual void WillDestroyCurrentMessageLoop() OVERRIDE; - // talk_base::MessageQueue overrides. - virtual void Post(talk_base::MessageHandler *phandler, + // rtc::MessageQueue overrides. + virtual void Post(rtc::MessageHandler *phandler, uint32 id, - talk_base::MessageData *pdata, + rtc::MessageData *pdata, bool time_sensitive) OVERRIDE; virtual void PostDelayed(int delay_ms, - talk_base::MessageHandler* handler, + rtc::MessageHandler* handler, uint32 id, - talk_base::MessageData* data) OVERRIDE; - virtual void Clear(talk_base::MessageHandler* handler, + rtc::MessageData* data) OVERRIDE; + virtual void Clear(rtc::MessageHandler* handler, uint32 id, - talk_base::MessageList* removed) OVERRIDE; - virtual void Send(talk_base::MessageHandler *handler, + rtc::MessageList* removed) OVERRIDE; + virtual void Send(rtc::MessageHandler *handler, uint32 id, - talk_base::MessageData *data) OVERRIDE; + rtc::MessageData *data) OVERRIDE; // Following methods are not supported.They are overriden just to // ensure that they are not called (each of them contain NOTREACHED @@ -77,30 +77,30 @@ class JingleThreadWrapper : public base::MessageLoop::DestructionObserver, virtual void Quit() OVERRIDE; virtual bool IsQuitting() OVERRIDE; virtual void Restart() OVERRIDE; - virtual bool Get(talk_base::Message* message, + virtual bool Get(rtc::Message* message, int delay_ms, bool process_io) OVERRIDE; - virtual bool Peek(talk_base::Message* message, + virtual bool Peek(rtc::Message* message, int delay_ms) OVERRIDE; virtual void PostAt(uint32 timestamp, - talk_base::MessageHandler* handler, + rtc::MessageHandler* handler, uint32 id, - talk_base::MessageData* data) OVERRIDE; - virtual void Dispatch(talk_base::Message* message) OVERRIDE; + rtc::MessageData* data) OVERRIDE; + virtual void Dispatch(rtc::Message* message) OVERRIDE; virtual void ReceiveSends() OVERRIDE; virtual int GetDelay() OVERRIDE; - // talk_base::Thread overrides. + // rtc::Thread overrides. virtual void Stop() OVERRIDE; virtual void Run() OVERRIDE; private: - typedef std::map<int, talk_base::Message> MessagesQueue; + typedef std::map<int, rtc::Message> MessagesQueue; struct PendingSend; void PostTaskInternal( - int delay_ms, talk_base::MessageHandler* handler, - uint32 message_id, talk_base::MessageData* data); + int delay_ms, rtc::MessageHandler* handler, + uint32 message_id, rtc::MessageData* data); void RunTask(int task_id); void ProcessPendingSends(); diff --git a/jingle/glue/thread_wrapper_unittest.cc b/jingle/glue/thread_wrapper_unittest.cc index 3657780..8eabe98 100644 --- a/jingle/glue/thread_wrapper_unittest.cc +++ b/jingle/glue/thread_wrapper_unittest.cc @@ -28,9 +28,9 @@ static const int kMaxTestDelay = 40; namespace { -class MockMessageHandler : public talk_base::MessageHandler { +class MockMessageHandler : public rtc::MessageHandler { public: - MOCK_METHOD1(OnMessage, void(talk_base::Message* msg)); + MOCK_METHOD1(OnMessage, void(rtc::Message* msg)); }; MATCHER_P3(MatchMessage, handler, message_id, data, "") { @@ -66,7 +66,7 @@ class ThreadWrapperTest : public testing::Test { // This method is used by the SendDuringSend test. It sends message to the // main thread synchronously using Send(). void PingMainThread() { - talk_base::MessageData* data = new talk_base::MessageData(); + rtc::MessageData* data = new rtc::MessageData(); MockMessageHandler handler; EXPECT_CALL(handler, OnMessage( @@ -82,21 +82,21 @@ class ThreadWrapperTest : public testing::Test { virtual void SetUp() OVERRIDE { JingleThreadWrapper::EnsureForCurrentMessageLoop(); - thread_ = talk_base::Thread::Current(); + thread_ = rtc::Thread::Current(); } // ThreadWrapper destroyes itself when |message_loop_| is destroyed. base::MessageLoop message_loop_; - talk_base::Thread* thread_; + rtc::Thread* thread_; MockMessageHandler handler1_; MockMessageHandler handler2_; }; TEST_F(ThreadWrapperTest, Post) { - talk_base::MessageData* data1 = new talk_base::MessageData(); - talk_base::MessageData* data2 = new talk_base::MessageData(); - talk_base::MessageData* data3 = new talk_base::MessageData(); - talk_base::MessageData* data4 = new talk_base::MessageData(); + rtc::MessageData* data1 = new rtc::MessageData(); + rtc::MessageData* data2 = new rtc::MessageData(); + rtc::MessageData* data3 = new rtc::MessageData(); + rtc::MessageData* data4 = new rtc::MessageData(); thread_->Post(&handler1_, kTestMessage1, data1); thread_->Post(&handler1_, kTestMessage2, data2); @@ -122,10 +122,10 @@ TEST_F(ThreadWrapperTest, Post) { } TEST_F(ThreadWrapperTest, PostDelayed) { - talk_base::MessageData* data1 = new talk_base::MessageData(); - talk_base::MessageData* data2 = new talk_base::MessageData(); - talk_base::MessageData* data3 = new talk_base::MessageData(); - talk_base::MessageData* data4 = new talk_base::MessageData(); + rtc::MessageData* data1 = new rtc::MessageData(); + rtc::MessageData* data2 = new rtc::MessageData(); + rtc::MessageData* data3 = new rtc::MessageData(); + rtc::MessageData* data4 = new rtc::MessageData(); thread_->PostDelayed(kTestDelayMs1, &handler1_, kTestMessage1, data1); thread_->PostDelayed(kTestDelayMs2, &handler1_, kTestMessage2, data2); @@ -164,7 +164,7 @@ TEST_F(ThreadWrapperTest, Clear) { InSequence in_seq; - talk_base::MessageData* null_data = NULL; + rtc::MessageData* null_data = NULL; EXPECT_CALL(handler1_, OnMessage( MatchMessage(&handler1_, kTestMessage1, null_data))) .WillOnce(DeleteMessageData()); @@ -188,7 +188,7 @@ TEST_F(ThreadWrapperTest, ClearDelayed) { InSequence in_seq; - talk_base::MessageData* null_data = NULL; + rtc::MessageData* null_data = NULL; EXPECT_CALL(handler1_, OnMessage( MatchMessage(&handler1_, kTestMessage1, null_data))) .WillOnce(DeleteMessageData()); @@ -214,15 +214,15 @@ TEST_F(ThreadWrapperTest, ClearDestoroyed) { handler_ptr = &handler; thread_->Post(&handler, kTestMessage1, NULL); } - talk_base::MessageList removed; - thread_->Clear(handler_ptr, talk_base::MQID_ANY, &removed); + rtc::MessageList removed; + thread_->Clear(handler_ptr, rtc::MQID_ANY, &removed); DCHECK_EQ(0U, removed.size()); } // Verify that Send() calls handler synchronously when called on the // same thread. TEST_F(ThreadWrapperTest, SendSameThread) { - talk_base::MessageData* data = new talk_base::MessageData(); + rtc::MessageData* data = new rtc::MessageData(); EXPECT_CALL(handler1_, OnMessage( MatchMessage(&handler1_, kTestMessage1, data))) @@ -230,7 +230,7 @@ TEST_F(ThreadWrapperTest, SendSameThread) { thread_->Send(&handler1_, kTestMessage1, data); } -void InitializeWrapperForNewThread(talk_base::Thread** thread, +void InitializeWrapperForNewThread(rtc::Thread** thread, base::WaitableEvent* done_event) { JingleThreadWrapper::EnsureForCurrentMessageLoop(); JingleThreadWrapper::current()->set_send_allowed(true); @@ -247,7 +247,7 @@ TEST_F(ThreadWrapperTest, SendToOtherThread) { second_thread.Start(); base::WaitableEvent initialized_event(true, false); - talk_base::Thread* target; + rtc::Thread* target; second_thread.message_loop()->PostTask( FROM_HERE, base::Bind(&InitializeWrapperForNewThread, &target, &initialized_event)); @@ -255,7 +255,7 @@ TEST_F(ThreadWrapperTest, SendToOtherThread) { ASSERT_TRUE(target != NULL); - talk_base::MessageData* data = new talk_base::MessageData(); + rtc::MessageData* data = new rtc::MessageData(); EXPECT_CALL(handler1_, OnMessage( MatchMessage(&handler1_, kTestMessage1, data))) @@ -276,7 +276,7 @@ TEST_F(ThreadWrapperTest, SendDuringSend) { second_thread.Start(); base::WaitableEvent initialized_event(true, false); - talk_base::Thread* target; + rtc::Thread* target; second_thread.message_loop()->PostTask( FROM_HERE, base::Bind(&InitializeWrapperForNewThread, &target, &initialized_event)); @@ -284,7 +284,7 @@ TEST_F(ThreadWrapperTest, SendDuringSend) { ASSERT_TRUE(target != NULL); - talk_base::MessageData* data = new talk_base::MessageData(); + rtc::MessageData* data = new rtc::MessageData(); EXPECT_CALL(handler1_, OnMessage( MatchMessage(&handler1_, kTestMessage1, data))) diff --git a/jingle/glue/utils.cc b/jingle/glue/utils.cc index 5350631..acf45cb 100644 --- a/jingle/glue/utils.cc +++ b/jingle/glue/utils.cc @@ -11,21 +11,21 @@ #include "base/values.h" #include "net/base/ip_endpoint.h" #include "net/base/net_util.h" -#include "third_party/libjingle/source/talk/base/byteorder.h" -#include "third_party/libjingle/source/talk/base/socketaddress.h" #include "third_party/libjingle/source/talk/p2p/base/candidate.h" +#include "third_party/webrtc/base/byteorder.h" +#include "third_party/webrtc/base/socketaddress.h" namespace jingle_glue { bool IPEndPointToSocketAddress(const net::IPEndPoint& ip_endpoint, - talk_base::SocketAddress* address) { + rtc::SocketAddress* address) { sockaddr_storage addr; socklen_t len = sizeof(addr); return ip_endpoint.ToSockAddr(reinterpret_cast<sockaddr*>(&addr), &len) && - talk_base::SocketAddressFromSockAddrStorage(addr, address); + rtc::SocketAddressFromSockAddrStorage(addr, address); } -bool SocketAddressToIPEndPoint(const talk_base::SocketAddress& address, +bool SocketAddressToIPEndPoint(const rtc::SocketAddress& address, net::IPEndPoint* ip_endpoint) { sockaddr_storage addr; int size = address.ToSockAddrStorage(&addr); @@ -81,7 +81,7 @@ bool DeserializeP2PCandidate(const std::string& candidate_str, return false; } - candidate->set_address(talk_base::SocketAddress(ip, port)); + candidate->set_address(rtc::SocketAddress(ip, port)); candidate->set_type(type); candidate->set_protocol(protocol); candidate->set_username(username); diff --git a/jingle/glue/utils.h b/jingle/glue/utils.h index a655f71..cb42b4b 100644 --- a/jingle/glue/utils.h +++ b/jingle/glue/utils.h @@ -11,9 +11,9 @@ namespace net { class IPEndPoint; } // namespace net -namespace talk_base { +namespace rtc { class SocketAddress; -} // namespace talk_base +} // namespace rtc namespace cricket { class Candidate; @@ -25,8 +25,8 @@ namespace jingle_glue { // following two functions are used to convert addresses from one // representation to another. bool IPEndPointToSocketAddress(const net::IPEndPoint& ip_endpoint, - talk_base::SocketAddress* address); -bool SocketAddressToIPEndPoint(const talk_base::SocketAddress& address, + rtc::SocketAddress* address); +bool SocketAddressToIPEndPoint(const rtc::SocketAddress& address, net::IPEndPoint* ip_endpoint); // Helper functions to serialize and deserialize P2P candidates. diff --git a/jingle/notifier/DEPS b/jingle/notifier/DEPS index 2d7d13f..3fccbf7 100644 --- a/jingle/notifier/DEPS +++ b/jingle/notifier/DEPS @@ -3,4 +3,5 @@ include_rules = [ "+talk/base", "+talk/xmpp", "+talk/xmllite", + "+webrtc/base", ] diff --git a/jingle/notifier/base/fake_base_task.cc b/jingle/notifier/base/fake_base_task.cc index f3d64ca..3b51af4 100644 --- a/jingle/notifier/base/fake_base_task.cc +++ b/jingle/notifier/base/fake_base_task.cc @@ -20,7 +20,7 @@ class MockAsyncSocket : public buzz::AsyncSocket { MOCK_METHOD0(state, State()); MOCK_METHOD0(error, Error()); MOCK_METHOD0(GetError, int()); - MOCK_METHOD1(Connect, bool(const talk_base::SocketAddress&)); + MOCK_METHOD1(Connect, bool(const rtc::SocketAddress&)); MOCK_METHOD3(Read, bool(char*, size_t, size_t*)); MOCK_METHOD2(Write, bool(const char*, size_t)); MOCK_METHOD0(Close, bool()); @@ -35,7 +35,7 @@ namespace { // PushNotificationsSubscribeTask. class FakeWeakXmppClient : public notifier::WeakXmppClient { public: - explicit FakeWeakXmppClient(talk_base::TaskParent* parent) + explicit FakeWeakXmppClient(rtc::TaskParent* parent) : notifier::WeakXmppClient(parent), jid_("test@example.com/testresource") {} diff --git a/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc b/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc index f7ddf8d..4fc8e18 100644 --- a/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc +++ b/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc @@ -8,9 +8,9 @@ #include "base/basictypes.h" #include "base/logging.h" -#include "talk/base/socketaddress.h" #include "talk/xmpp/constants.h" #include "talk/xmpp/saslcookiemechanism.h" +#include "webrtc/base/socketaddress.h" namespace notifier { @@ -64,8 +64,8 @@ GaiaTokenPreXmppAuth::~GaiaTokenPreXmppAuth() { } void GaiaTokenPreXmppAuth::StartPreXmppAuth( const buzz::Jid& jid, - const talk_base::SocketAddress& server, - const talk_base::CryptString& pass, + const rtc::SocketAddress& server, + const rtc::CryptString& pass, const std::string& auth_mechanism, const std::string& auth_token) { SignalAuthDone(); diff --git a/jingle/notifier/base/gaia_token_pre_xmpp_auth.h b/jingle/notifier/base/gaia_token_pre_xmpp_auth.h index 60e0c96..546288e 100644 --- a/jingle/notifier/base/gaia_token_pre_xmpp_auth.h +++ b/jingle/notifier/base/gaia_token_pre_xmpp_auth.h @@ -28,8 +28,8 @@ class GaiaTokenPreXmppAuth : public buzz::PreXmppAuth { // all the methods out as we don't actually do any authentication at // this point. virtual void StartPreXmppAuth(const buzz::Jid& jid, - const talk_base::SocketAddress& server, - const talk_base::CryptString& pass, + const rtc::SocketAddress& server, + const rtc::CryptString& pass, const std::string& auth_mechanism, const std::string& auth_token) OVERRIDE; diff --git a/jingle/notifier/base/weak_xmpp_client.cc b/jingle/notifier/base/weak_xmpp_client.cc index fa89e46..7cec36e 100644 --- a/jingle/notifier/base/weak_xmpp_client.cc +++ b/jingle/notifier/base/weak_xmpp_client.cc @@ -8,7 +8,7 @@ namespace notifier { -WeakXmppClient::WeakXmppClient(talk_base::TaskParent* parent) +WeakXmppClient::WeakXmppClient(rtc::TaskParent* parent) : buzz::XmppClient(parent), weak_ptr_factory_(this) {} diff --git a/jingle/notifier/base/weak_xmpp_client.h b/jingle/notifier/base/weak_xmpp_client.h index d56e045..49e38dd 100644 --- a/jingle/notifier/base/weak_xmpp_client.h +++ b/jingle/notifier/base/weak_xmpp_client.h @@ -15,18 +15,18 @@ #include "base/threading/non_thread_safe.h" #include "talk/xmpp/xmppclient.h" -namespace talk_base { +namespace rtc { class TaskParent; } // namespace namespace notifier { // buzz::XmppClient's destructor isn't marked virtual, but it inherits -// from talk_base::Task, whose destructor *is* marked virtual, so we +// from rtc::Task, whose destructor *is* marked virtual, so we // can safely inherit from it. class WeakXmppClient : public buzz::XmppClient, public base::NonThreadSafe { public: - explicit WeakXmppClient(talk_base::TaskParent* parent); + explicit WeakXmppClient(rtc::TaskParent* parent); virtual ~WeakXmppClient(); diff --git a/jingle/notifier/base/weak_xmpp_client_unittest.cc b/jingle/notifier/base/weak_xmpp_client_unittest.cc index c1058e9..a4c9c7b 100644 --- a/jingle/notifier/base/weak_xmpp_client_unittest.cc +++ b/jingle/notifier/base/weak_xmpp_client_unittest.cc @@ -9,9 +9,9 @@ #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" #include "jingle/glue/task_pump.h" -#include "talk/base/sigslot.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "webrtc/base/sigslot.h" namespace notifier { diff --git a/jingle/notifier/base/xmpp_connection.h b/jingle/notifier/base/xmpp_connection.h index b783764..5210234 100644 --- a/jingle/notifier/base/xmpp_connection.h +++ b/jingle/notifier/base/xmpp_connection.h @@ -14,8 +14,8 @@ #include "base/memory/weak_ptr.h" #include "base/threading/non_thread_safe.h" #include "net/url_request/url_request_context_getter.h" -#include "talk/base/sigslot.h" #include "talk/xmpp/xmppengine.h" +#include "webrtc/base/sigslot.h" namespace buzz { class PreXmppAuth; diff --git a/jingle/notifier/base/xmpp_connection_unittest.cc b/jingle/notifier/base/xmpp_connection_unittest.cc index 0573363c..3559b4b 100644 --- a/jingle/notifier/base/xmpp_connection_unittest.cc +++ b/jingle/notifier/base/xmpp_connection_unittest.cc @@ -28,11 +28,11 @@ class CaptchaChallenge; class Jid; } // namespace buzz -namespace talk_base { +namespace rtc { class CryptString; class SocketAddress; class Task; -} // namespace talk_base +} // namespace rtc namespace notifier { @@ -50,8 +50,8 @@ class MockPreXmppAuth : public buzz::PreXmppAuth { buzz::SaslMechanism*(const std::string&)); MOCK_METHOD5(StartPreXmppAuth, void(const buzz::Jid&, - const talk_base::SocketAddress&, - const talk_base::CryptString&, + const rtc::SocketAddress&, + const rtc::CryptString&, const std::string&, const std::string&)); MOCK_CONST_METHOD0(IsAuthDone, bool()); @@ -172,7 +172,7 @@ TEST_F(XmppConnectionTest, RaisedError) { #endif TEST_F(XmppConnectionTest, Connect) { - base::WeakPtr<talk_base::Task> weak_ptr; + base::WeakPtr<rtc::Task> weak_ptr; EXPECT_CALL(mock_xmpp_connection_delegate_, OnConnect(_)). WillOnce(SaveArg<0>(&weak_ptr)); @@ -191,7 +191,7 @@ TEST_F(XmppConnectionTest, Connect) { TEST_F(XmppConnectionTest, MultipleConnect) { EXPECT_DEBUG_DEATH({ - base::WeakPtr<talk_base::Task> weak_ptr; + base::WeakPtr<rtc::Task> weak_ptr; EXPECT_CALL(mock_xmpp_connection_delegate_, OnConnect(_)). WillOnce(SaveArg<0>(&weak_ptr)); @@ -212,7 +212,7 @@ TEST_F(XmppConnectionTest, MultipleConnect) { #if !defined(_MSC_VER) || _MSC_VER < 1700 // http://crbug.com/158570 TEST_F(XmppConnectionTest, ConnectThenError) { - base::WeakPtr<talk_base::Task> weak_ptr; + base::WeakPtr<rtc::Task> weak_ptr; EXPECT_CALL(mock_xmpp_connection_delegate_, OnConnect(_)). WillOnce(SaveArg<0>(&weak_ptr)); EXPECT_CALL(mock_xmpp_connection_delegate_, @@ -243,7 +243,7 @@ TEST_F(XmppConnectionTest, TasksDontRunAfterXmppConnectionDestructor) { jingle_glue::MockTask* task = new jingle_glue::MockTask(xmpp_connection.task_pump_.get()); // We have to do this since the state enum is protected in - // talk_base::Task. + // rtc::Task. const int TASK_STATE_ERROR = 3; ON_CALL(*task, ProcessStart()) .WillByDefault(Return(TASK_STATE_ERROR)); diff --git a/jingle/notifier/communicator/connection_settings.cc b/jingle/notifier/communicator/connection_settings.cc index 862f905..164bbbc 100644 --- a/jingle/notifier/communicator/connection_settings.cc +++ b/jingle/notifier/communicator/connection_settings.cc @@ -18,7 +18,7 @@ namespace notifier { const uint16 kSslTcpPort = 443; ConnectionSettings::ConnectionSettings( - const talk_base::SocketAddress& server, + const rtc::SocketAddress& server, SslTcpMode ssltcp_mode, SslTcpSupport ssltcp_support) : server(server), @@ -76,12 +76,12 @@ ConnectionSettingsList MakeConnectionSettingsList( for (ServerList::const_iterator it = servers.begin(); it != servers.end(); ++it) { const ConnectionSettings settings( - talk_base::SocketAddress(it->server.host(), it->server.port()), + rtc::SocketAddress(it->server.host(), it->server.port()), DO_NOT_USE_SSLTCP, it->ssltcp_support); if (it->ssltcp_support == SUPPORTS_SSLTCP) { const ConnectionSettings settings_with_ssltcp( - talk_base::SocketAddress(it->server.host(), kSslTcpPort), + rtc::SocketAddress(it->server.host(), kSslTcpPort), USE_SSLTCP, it->ssltcp_support); if (try_ssltcp_first) { diff --git a/jingle/notifier/communicator/connection_settings.h b/jingle/notifier/communicator/connection_settings.h index fe0f6b0..9091fcb 100644 --- a/jingle/notifier/communicator/connection_settings.h +++ b/jingle/notifier/communicator/connection_settings.h @@ -10,7 +10,7 @@ #include "base/basictypes.h" #include "jingle/notifier/base/server_information.h" -#include "talk/base/socketaddress.h" +#include "webrtc/base/socketaddress.h" namespace buzz { class XmppClientSettings; @@ -25,7 +25,7 @@ enum SslTcpMode { DO_NOT_USE_SSLTCP, USE_SSLTCP }; struct ConnectionSettings { public: - ConnectionSettings(const talk_base::SocketAddress& server, + ConnectionSettings(const rtc::SocketAddress& server, SslTcpMode ssltcp_mode, SslTcpSupport ssltcp_support); ConnectionSettings(); @@ -38,7 +38,7 @@ struct ConnectionSettings { // Fill in the connection-related fields of |client_settings|. void FillXmppClientSettings(buzz::XmppClientSettings* client_settings) const; - talk_base::SocketAddress server; + rtc::SocketAddress server; SslTcpMode ssltcp_mode; SslTcpSupport ssltcp_support; }; diff --git a/jingle/notifier/communicator/connection_settings_unittest.cc b/jingle/notifier/communicator/connection_settings_unittest.cc index c7e0c4c..38606e1 100644 --- a/jingle/notifier/communicator/connection_settings_unittest.cc +++ b/jingle/notifier/communicator/connection_settings_unittest.cc @@ -44,17 +44,17 @@ TEST_F(ConnectionSettingsTest, Basic) { ConnectionSettingsList expected_settings_list; expected_settings_list.push_back( ConnectionSettings( - talk_base::SocketAddress("supports_ssltcp.com", 100), + rtc::SocketAddress("supports_ssltcp.com", 100), DO_NOT_USE_SSLTCP, SUPPORTS_SSLTCP)); expected_settings_list.push_back( ConnectionSettings( - talk_base::SocketAddress("supports_ssltcp.com", 443), + rtc::SocketAddress("supports_ssltcp.com", 443), USE_SSLTCP, SUPPORTS_SSLTCP)); expected_settings_list.push_back( ConnectionSettings( - talk_base::SocketAddress("does_not_support_ssltcp.com", 200), + rtc::SocketAddress("does_not_support_ssltcp.com", 200), DO_NOT_USE_SSLTCP, DOES_NOT_SUPPORT_SSLTCP)); @@ -74,17 +74,17 @@ TEST_F(ConnectionSettingsTest, TrySslTcpFirst) { ConnectionSettingsList expected_settings_list; expected_settings_list.push_back( ConnectionSettings( - talk_base::SocketAddress("supports_ssltcp.com", 443), + rtc::SocketAddress("supports_ssltcp.com", 443), USE_SSLTCP, SUPPORTS_SSLTCP)); expected_settings_list.push_back( ConnectionSettings( - talk_base::SocketAddress("supports_ssltcp.com", 100), + rtc::SocketAddress("supports_ssltcp.com", 100), DO_NOT_USE_SSLTCP, SUPPORTS_SSLTCP)); expected_settings_list.push_back( ConnectionSettings( - talk_base::SocketAddress("does_not_support_ssltcp.com", 200), + rtc::SocketAddress("does_not_support_ssltcp.com", 200), DO_NOT_USE_SSLTCP, DOES_NOT_SUPPORT_SSLTCP)); diff --git a/jingle/notifier/communicator/login.cc b/jingle/notifier/communicator/login.cc index 1a877e1..b3b2dc3 100644 --- a/jingle/notifier/communicator/login.cc +++ b/jingle/notifier/communicator/login.cc @@ -10,17 +10,17 @@ #include "base/rand_util.h" #include "base/time/time.h" #include "net/base/host_port_pair.h" -#include "talk/base/common.h" -#include "talk/base/firewallsocketserver.h" -#include "talk/base/logging.h" -#include "talk/base/physicalsocketserver.h" -#include "talk/base/taskrunner.h" #include "talk/xmllite/xmlelement.h" #include "talk/xmpp/asyncsocket.h" #include "talk/xmpp/prexmppauth.h" #include "talk/xmpp/xmppclient.h" #include "talk/xmpp/xmppclientsettings.h" #include "talk/xmpp/xmppengine.h" +#include "webrtc/base/common.h" +#include "webrtc/base/firewallsocketserver.h" +#include "webrtc/base/logging.h" +#include "webrtc/base/physicalsocketserver.h" +#include "webrtc/base/taskrunner.h" namespace notifier { diff --git a/jingle/notifier/communicator/login_settings.cc b/jingle/notifier/communicator/login_settings.cc index 3dacbea..3f1d3dd 100644 --- a/jingle/notifier/communicator/login_settings.cc +++ b/jingle/notifier/communicator/login_settings.cc @@ -9,8 +9,8 @@ #include "base/logging.h" #include "jingle/notifier/base/server_information.h" #include "net/cert/cert_verifier.h" -#include "talk/base/common.h" -#include "talk/base/socketaddress.h" +#include "webrtc/base/common.h" +#include "webrtc/base/socketaddress.h" namespace notifier { diff --git a/jingle/notifier/listener/push_notifications_listen_task.cc b/jingle/notifier/listener/push_notifications_listen_task.cc index 2e6b2ca..23e3f2a 100644 --- a/jingle/notifier/listener/push_notifications_listen_task.cc +++ b/jingle/notifier/listener/push_notifications_listen_task.cc @@ -9,12 +9,12 @@ #include "jingle/notifier/listener/notification_constants.h" #include "jingle/notifier/listener/notification_defines.h" #include "jingle/notifier/listener/xml_element_util.h" -#include "talk/base/task.h" #include "talk/xmllite/qname.h" #include "talk/xmllite/xmlelement.h" -#include "talk/xmpp/xmppclient.h" #include "talk/xmpp/constants.h" +#include "talk/xmpp/xmppclient.h" #include "talk/xmpp/xmppengine.h" +#include "webrtc/base/task.h" namespace notifier { diff --git a/jingle/notifier/listener/push_notifications_subscribe_task.cc b/jingle/notifier/listener/push_notifications_subscribe_task.cc index b069c9e..0599961 100644 --- a/jingle/notifier/listener/push_notifications_subscribe_task.cc +++ b/jingle/notifier/listener/push_notifications_subscribe_task.cc @@ -10,12 +10,12 @@ #include "base/memory/scoped_ptr.h" #include "jingle/notifier/listener/notification_constants.h" #include "jingle/notifier/listener/xml_element_util.h" -#include "talk/base/task.h" #include "talk/xmllite/qname.h" #include "talk/xmllite/xmlelement.h" -#include "talk/xmpp/xmppclient.h" #include "talk/xmpp/constants.h" +#include "talk/xmpp/xmppclient.h" #include "talk/xmpp/xmppengine.h" +#include "webrtc/base/task.h" namespace notifier { diff --git a/remoting/DEPS b/remoting/DEPS index 309afa5..fa0327c 100644 --- a/remoting/DEPS +++ b/remoting/DEPS @@ -15,6 +15,7 @@ include_rules = [ "+third_party/libjingle", "+third_party/libvpx", "+third_party/libyuv", + "+third_party/webrtc/base", "+third_party/webrtc/modules/desktop_capture", "+ui/base/keycodes", ] diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc index 2e40117..7e76fc1 100644 --- a/remoting/client/plugin/chromoting_instance.cc +++ b/remoting/client/plugin/chromoting_instance.cc @@ -9,8 +9,8 @@ #include <vector> #if defined(OS_NACL) -#include <sys/mount.h> #include <nacl_io/nacl_io.h> +#include <sys/mount.h> #endif #include "base/bind.h" @@ -52,8 +52,8 @@ #include "remoting/protocol/connection_to_host.h" #include "remoting/protocol/host_stub.h" #include "remoting/protocol/libjingle_transport_factory.h" -#include "third_party/libjingle/source/talk/base/helpers.h" -#include "third_party/libjingle/source/talk/base/ssladapter.h" +#include "third_party/webrtc/base/helpers.h" +#include "third_party/webrtc/base/ssladapter.h" #include "url/gurl.h" // Windows defines 'PostMessage', so we have to undef it. @@ -247,12 +247,12 @@ ChromotingInstance::ChromotingInstance(PP_Instance pp_instance) // Initialize random seed for libjingle. It's necessary only with OpenSSL. char random_seed[kRandomSeedSize]; crypto::RandBytes(random_seed, sizeof(random_seed)); - talk_base::InitRandom(random_seed, sizeof(random_seed)); + rtc::InitRandom(random_seed, sizeof(random_seed)); #else // Libjingle's SSL implementation is not really used, but it has to be // initialized for NSS builds to make sure that RNG is initialized in NSS, // because libjingle uses it. - talk_base::InitializeSSL(); + rtc::InitializeSSL(); #endif // !defined(USE_OPENSSL) // Send hello message. diff --git a/remoting/client/plugin/pepper_network_manager.cc b/remoting/client/plugin/pepper_network_manager.cc index a60d330..b019320 100644 --- a/remoting/client/plugin/pepper_network_manager.cc +++ b/remoting/client/plugin/pepper_network_manager.cc @@ -12,7 +12,7 @@ #include "ppapi/cpp/net_address.h" #include "ppapi/cpp/network_list.h" #include "remoting/client/plugin/pepper_util.h" -#include "third_party/libjingle/source/talk/base/socketaddress.h" +#include "third_party/webrtc/base/socketaddress.h" namespace remoting { @@ -63,8 +63,8 @@ void PepperNetworkManager::OnNetworkList(int32_t result, &PepperNetworkManager::OnNetworkList); monitor_.UpdateNetworkList(callback); - // Convert the networks to talk_base::Network. - std::vector<talk_base::Network*> networks; + // Convert the networks to rtc::Network. + std::vector<rtc::Network*> networks; size_t count = list.GetCount(); for (size_t i = 0; i < count; i++) { std::vector<pp::NetAddress> addresses; @@ -74,7 +74,7 @@ void PepperNetworkManager::OnNetworkList(int32_t result, continue; for (size_t i = 0; i < addresses.size(); ++i) { - talk_base::SocketAddress address; + rtc::SocketAddress address; PpNetAddressToSocketAddress(addresses[i], &address); if (address.family() == AF_INET6 && IPIsSiteLocal(address.ipaddr())) { @@ -84,7 +84,7 @@ void PepperNetworkManager::OnNetworkList(int32_t result, continue; } - talk_base::Network* network = new talk_base::Network( + rtc::Network* network = new rtc::Network( list.GetName(i), list.GetDisplayName(i), address.ipaddr(), 0); network->AddIP(address.ipaddr()); networks.push_back(network); diff --git a/remoting/client/plugin/pepper_network_manager.h b/remoting/client/plugin/pepper_network_manager.h index 7711eed..639fb74 100644 --- a/remoting/client/plugin/pepper_network_manager.h +++ b/remoting/client/plugin/pepper_network_manager.h @@ -10,7 +10,7 @@ #include "ppapi/cpp/instance_handle.h" #include "ppapi/cpp/network_monitor.h" #include "ppapi/utility/completion_callback_factory.h" -#include "third_party/libjingle/source/talk/base/network.h" +#include "third_party/webrtc/base/network.h" namespace pp { class NetworkList; @@ -21,7 +21,7 @@ namespace remoting { // PepperNetworkManager uses the PPB_NetworkMonitor API to // implement the NetworkManager interface that libjingle uses to // monitor the host system's network interfaces. -class PepperNetworkManager : public talk_base::NetworkManagerBase { +class PepperNetworkManager : public rtc::NetworkManagerBase { public: PepperNetworkManager(const pp::InstanceHandle& instance); virtual ~PepperNetworkManager(); diff --git a/remoting/client/plugin/pepper_packet_socket_factory.cc b/remoting/client/plugin/pepper_packet_socket_factory.cc index 6669266..4909f89 100644 --- a/remoting/client/plugin/pepper_packet_socket_factory.cc +++ b/remoting/client/plugin/pepper_packet_socket_factory.cc @@ -13,7 +13,7 @@ #include "ppapi/utility/completion_callback_factory.h" #include "remoting/client/plugin/pepper_util.h" #include "remoting/protocol/socket_util.h" -#include "third_party/libjingle/source/talk/base/asyncpacketsocket.h" +#include "third_party/webrtc/base/asyncpacketsocket.h" namespace remoting { @@ -81,30 +81,30 @@ int PepperErrorToNetError(int error) { } } -class UdpPacketSocket : public talk_base::AsyncPacketSocket { +class UdpPacketSocket : public rtc::AsyncPacketSocket { public: explicit UdpPacketSocket(const pp::InstanceHandle& instance); virtual ~UdpPacketSocket(); // |min_port| and |max_port| are set to zero if the port number // should be assigned by the OS. - bool Init(const talk_base::SocketAddress& local_address, + bool Init(const rtc::SocketAddress& local_address, int min_port, int max_port); - // talk_base::AsyncPacketSocket interface. - virtual talk_base::SocketAddress GetLocalAddress() const OVERRIDE; - virtual talk_base::SocketAddress GetRemoteAddress() const OVERRIDE; + // rtc::AsyncPacketSocket interface. + virtual rtc::SocketAddress GetLocalAddress() const OVERRIDE; + virtual rtc::SocketAddress GetRemoteAddress() const OVERRIDE; virtual int Send(const void* data, size_t data_size, - const talk_base::PacketOptions& options) OVERRIDE; + const rtc::PacketOptions& options) OVERRIDE; virtual int SendTo(const void* data, size_t data_size, - const talk_base::SocketAddress& address, - const talk_base::PacketOptions& options) OVERRIDE; + const rtc::SocketAddress& address, + const rtc::PacketOptions& options) OVERRIDE; virtual int Close() OVERRIDE; virtual State GetState() const OVERRIDE; - virtual int GetOption(talk_base::Socket::Option opt, int* value) OVERRIDE; - virtual int SetOption(talk_base::Socket::Option opt, int value) OVERRIDE; + virtual int GetOption(rtc::Socket::Option opt, int* value) OVERRIDE; + virtual int SetOption(rtc::Socket::Option opt, int value) OVERRIDE; virtual int GetError() const OVERRIDE; virtual void SetError(int error) OVERRIDE; @@ -135,7 +135,7 @@ class UdpPacketSocket : public talk_base::AsyncPacketSocket { State state_; int error_; - talk_base::SocketAddress local_address_; + rtc::SocketAddress local_address_; // Used to scan ports when necessary. Both values are set to 0 when // the port number is assigned by OS. @@ -179,7 +179,7 @@ UdpPacketSocket::~UdpPacketSocket() { Close(); } -bool UdpPacketSocket::Init(const talk_base::SocketAddress& local_address, +bool UdpPacketSocket::Init(const rtc::SocketAddress& local_address, int min_port, int max_port) { if (socket_.is_null()) { @@ -239,19 +239,19 @@ void UdpPacketSocket::OnBindCompleted(int result) { } } -talk_base::SocketAddress UdpPacketSocket::GetLocalAddress() const { +rtc::SocketAddress UdpPacketSocket::GetLocalAddress() const { DCHECK_EQ(state_, STATE_BOUND); return local_address_; } -talk_base::SocketAddress UdpPacketSocket::GetRemoteAddress() const { +rtc::SocketAddress UdpPacketSocket::GetRemoteAddress() const { // UDP sockets are not connected - this method should never be called. NOTREACHED(); - return talk_base::SocketAddress(); + return rtc::SocketAddress(); } int UdpPacketSocket::Send(const void* data, size_t data_size, - const talk_base::PacketOptions& options) { + const rtc::PacketOptions& options) { // UDP sockets are not connected - this method should never be called. NOTREACHED(); return EWOULDBLOCK; @@ -259,8 +259,8 @@ int UdpPacketSocket::Send(const void* data, size_t data_size, int UdpPacketSocket::SendTo(const void* data, size_t data_size, - const talk_base::SocketAddress& address, - const talk_base::PacketOptions& options) { + const rtc::SocketAddress& address, + const rtc::PacketOptions& options) { if (state_ != STATE_BOUND) { // TODO(sergeyu): StunPort may try to send stun request before we // are bound. Fix that problem and change this to DCHECK. @@ -292,16 +292,16 @@ int UdpPacketSocket::Close() { return 0; } -talk_base::AsyncPacketSocket::State UdpPacketSocket::GetState() const { +rtc::AsyncPacketSocket::State UdpPacketSocket::GetState() const { return state_; } -int UdpPacketSocket::GetOption(talk_base::Socket::Option opt, int* value) { +int UdpPacketSocket::GetOption(rtc::Socket::Option opt, int* value) { // Options are not supported for Pepper UDP sockets. return -1; } -int UdpPacketSocket::SetOption(talk_base::Socket::Option opt, int value) { +int UdpPacketSocket::SetOption(rtc::Socket::Option opt, int value) { // Options are not supported for Pepper UDP sockets. return -1; } @@ -385,10 +385,10 @@ void UdpPacketSocket::OnReadCompleted(int result, pp::NetAddress address) { void UdpPacketSocket::HandleReadResult(int result, pp::NetAddress address) { if (result > 0) { - talk_base::SocketAddress socket_address; + rtc::SocketAddress socket_address; PpNetAddressToSocketAddress(address, &socket_address); SignalReadPacket(this, &receive_buffer_[0], result, socket_address, - talk_base::CreatePacketTime(0)); + rtc::CreatePacketTime(0)); } else if (result != PP_ERROR_ABORTED) { LOG(ERROR) << "Received error when reading from UDP socket: " << result; } @@ -404,8 +404,8 @@ PepperPacketSocketFactory::PepperPacketSocketFactory( PepperPacketSocketFactory::~PepperPacketSocketFactory() { } -talk_base::AsyncPacketSocket* PepperPacketSocketFactory::CreateUdpSocket( - const talk_base::SocketAddress& local_address, +rtc::AsyncPacketSocket* PepperPacketSocketFactory::CreateUdpSocket( + const rtc::SocketAddress& local_address, int min_port, int max_port) { scoped_ptr<UdpPacketSocket> result(new UdpPacketSocket(pp_instance_)); @@ -414,8 +414,8 @@ talk_base::AsyncPacketSocket* PepperPacketSocketFactory::CreateUdpSocket( return result.release(); } -talk_base::AsyncPacketSocket* PepperPacketSocketFactory::CreateServerTcpSocket( - const talk_base::SocketAddress& local_address, +rtc::AsyncPacketSocket* PepperPacketSocketFactory::CreateServerTcpSocket( + const rtc::SocketAddress& local_address, int min_port, int max_port, int opts) { @@ -424,10 +424,10 @@ talk_base::AsyncPacketSocket* PepperPacketSocketFactory::CreateServerTcpSocket( return NULL; } -talk_base::AsyncPacketSocket* PepperPacketSocketFactory::CreateClientTcpSocket( - const talk_base::SocketAddress& local_address, - const talk_base::SocketAddress& remote_address, - const talk_base::ProxyInfo& proxy_info, +rtc::AsyncPacketSocket* PepperPacketSocketFactory::CreateClientTcpSocket( + const rtc::SocketAddress& local_address, + const rtc::SocketAddress& remote_address, + const rtc::ProxyInfo& proxy_info, const std::string& user_agent, int opts) { // We don't use TCP sockets for remoting connections. @@ -435,7 +435,7 @@ talk_base::AsyncPacketSocket* PepperPacketSocketFactory::CreateClientTcpSocket( return NULL; } -talk_base::AsyncResolverInterface* +rtc::AsyncResolverInterface* PepperPacketSocketFactory::CreateAsyncResolver() { NOTREACHED(); return NULL; diff --git a/remoting/client/plugin/pepper_packet_socket_factory.h b/remoting/client/plugin/pepper_packet_socket_factory.h index 144173b..de7aa6c 100644 --- a/remoting/client/plugin/pepper_packet_socket_factory.h +++ b/remoting/client/plugin/pepper_packet_socket_factory.h @@ -11,26 +11,26 @@ namespace remoting { -class PepperPacketSocketFactory : public talk_base::PacketSocketFactory { +class PepperPacketSocketFactory : public rtc::PacketSocketFactory { public: explicit PepperPacketSocketFactory(const pp::InstanceHandle& instance); virtual ~PepperPacketSocketFactory(); - virtual talk_base::AsyncPacketSocket* CreateUdpSocket( - const talk_base::SocketAddress& local_address, + virtual rtc::AsyncPacketSocket* CreateUdpSocket( + const rtc::SocketAddress& local_address, int min_port, int max_port) OVERRIDE; - virtual talk_base::AsyncPacketSocket* CreateServerTcpSocket( - const talk_base::SocketAddress& local_address, + virtual rtc::AsyncPacketSocket* CreateServerTcpSocket( + const rtc::SocketAddress& local_address, int min_port, int max_port, int opts) OVERRIDE; - virtual talk_base::AsyncPacketSocket* CreateClientTcpSocket( - const talk_base::SocketAddress& local_address, - const talk_base::SocketAddress& remote_address, - const talk_base::ProxyInfo& proxy_info, + virtual rtc::AsyncPacketSocket* CreateClientTcpSocket( + const rtc::SocketAddress& local_address, + const rtc::SocketAddress& remote_address, + const rtc::ProxyInfo& proxy_info, const std::string& user_agent, int opts) OVERRIDE; - virtual talk_base::AsyncResolverInterface* CreateAsyncResolver() OVERRIDE; + virtual rtc::AsyncResolverInterface* CreateAsyncResolver() OVERRIDE; private: const pp::InstanceHandle pp_instance_; diff --git a/remoting/client/plugin/pepper_port_allocator.cc b/remoting/client/plugin/pepper_port_allocator.cc index e0d0b40..5cceee1 100644 --- a/remoting/client/plugin/pepper_port_allocator.cc +++ b/remoting/client/plugin/pepper_port_allocator.cc @@ -35,7 +35,7 @@ class PepperPortAllocatorSession int component, const std::string& ice_username_fragment, const std::string& ice_password, - const std::vector<talk_base::SocketAddress>& stun_hosts, + const std::vector<rtc::SocketAddress>& stun_hosts, const std::vector<std::string>& relay_hosts, const std::string& relay_token, const pp::InstanceHandle& instance); @@ -57,7 +57,7 @@ class PepperPortAllocatorSession pp::InstanceHandle instance_; pp::HostResolver stun_address_resolver_; - talk_base::SocketAddress stun_address_; + rtc::SocketAddress stun_address_; int stun_port_; scoped_ptr<pp::URLLoader> relay_url_loader_; @@ -75,7 +75,7 @@ PepperPortAllocatorSession::PepperPortAllocatorSession( int component, const std::string& ice_username_fragment, const std::string& ice_password, - const std::vector<talk_base::SocketAddress>& stun_hosts, + const std::vector<rtc::SocketAddress>& stun_hosts, const std::vector<std::string>& relay_hosts, const std::string& relay_token, const pp::InstanceHandle& instance) @@ -132,7 +132,7 @@ void PepperPortAllocatorSession::GetPortConfigurations() { // Add an empty configuration synchronously, so a local connection // can be started immediately. ConfigReady(new cricket::PortConfiguration( - talk_base::SocketAddress(), std::string(), std::string())); + rtc::SocketAddress(), std::string(), std::string())); ResolveStunServerAddress(); TryCreateRelaySession(); @@ -293,9 +293,9 @@ void PepperPortAllocatorSession::OnResponseBodyRead(int32_t result) { // static scoped_ptr<PepperPortAllocator> PepperPortAllocator::Create( const pp::InstanceHandle& instance) { - scoped_ptr<talk_base::NetworkManager> network_manager( + scoped_ptr<rtc::NetworkManager> network_manager( new PepperNetworkManager(instance)); - scoped_ptr<talk_base::PacketSocketFactory> socket_factory( + scoped_ptr<rtc::PacketSocketFactory> socket_factory( new PepperPacketSocketFactory(instance)); scoped_ptr<PepperPortAllocator> result(new PepperPortAllocator( instance, network_manager.Pass(), socket_factory.Pass())); @@ -304,8 +304,8 @@ scoped_ptr<PepperPortAllocator> PepperPortAllocator::Create( PepperPortAllocator::PepperPortAllocator( const pp::InstanceHandle& instance, - scoped_ptr<talk_base::NetworkManager> network_manager, - scoped_ptr<talk_base::PacketSocketFactory> socket_factory) + scoped_ptr<rtc::NetworkManager> network_manager, + scoped_ptr<rtc::PacketSocketFactory> socket_factory) : HttpPortAllocatorBase(network_manager.get(), socket_factory.get(), std::string()), diff --git a/remoting/client/plugin/pepper_port_allocator.h b/remoting/client/plugin/pepper_port_allocator.h index 92222a1..5c46a4b 100644 --- a/remoting/client/plugin/pepper_port_allocator.h +++ b/remoting/client/plugin/pepper_port_allocator.h @@ -37,12 +37,12 @@ class PepperPortAllocator : public cricket::HttpPortAllocatorBase { private: PepperPortAllocator( const pp::InstanceHandle& instance, - scoped_ptr<talk_base::NetworkManager> network_manager, - scoped_ptr<talk_base::PacketSocketFactory> socket_factory); + scoped_ptr<rtc::NetworkManager> network_manager, + scoped_ptr<rtc::PacketSocketFactory> socket_factory); pp::InstanceHandle instance_; - scoped_ptr<talk_base::NetworkManager> network_manager_; - scoped_ptr<talk_base::PacketSocketFactory> socket_factory_; + scoped_ptr<rtc::NetworkManager> network_manager_; + scoped_ptr<rtc::PacketSocketFactory> socket_factory_; DISALLOW_COPY_AND_ASSIGN(PepperPortAllocator); }; diff --git a/remoting/client/plugin/pepper_util.cc b/remoting/client/plugin/pepper_util.cc index d00189c..0e575c8 100644 --- a/remoting/client/plugin/pepper_util.cc +++ b/remoting/client/plugin/pepper_util.cc @@ -9,13 +9,13 @@ #include "base/sys_byteorder.h" #include "ppapi/cpp/module.h" #include "ppapi/cpp/net_address.h" -#include "third_party/libjingle/source/talk/base/socketaddress.h" +#include "third_party/webrtc/base/socketaddress.h" namespace remoting { bool SocketAddressToPpNetAddressWithPort( const pp::InstanceHandle& instance, - const talk_base::SocketAddress& address, + const rtc::SocketAddress& address, pp::NetAddress* pp_address, uint16_t port) { switch (address.ipaddr().family()) { @@ -43,7 +43,7 @@ bool SocketAddressToPpNetAddressWithPort( } bool SocketAddressToPpNetAddress(const pp::InstanceHandle& instance, - const talk_base::SocketAddress& address, + const rtc::SocketAddress& address, pp::NetAddress* pp_net_address) { return SocketAddressToPpNetAddressWithPort(instance, address, @@ -52,12 +52,12 @@ bool SocketAddressToPpNetAddress(const pp::InstanceHandle& instance, } void PpNetAddressToSocketAddress(const pp::NetAddress& pp_net_address, - talk_base::SocketAddress* address) { + rtc::SocketAddress* address) { switch (pp_net_address.GetFamily()) { case PP_NETADDRESS_FAMILY_IPV4: { PP_NetAddress_IPv4 ipv4_addr; CHECK(pp_net_address.DescribeAsIPv4Address(&ipv4_addr)); - address->SetIP(talk_base::IPAddress( + address->SetIP(rtc::IPAddress( bit_cast<in_addr>(ipv4_addr.addr))); address->SetPort(base::NetToHost16(ipv4_addr.port)); return; @@ -65,7 +65,7 @@ void PpNetAddressToSocketAddress(const pp::NetAddress& pp_net_address, case PP_NETADDRESS_FAMILY_IPV6: { PP_NetAddress_IPv6 ipv6_addr; CHECK(pp_net_address.DescribeAsIPv6Address(&ipv6_addr)); - address->SetIP(talk_base::IPAddress( + address->SetIP(rtc::IPAddress( bit_cast<in6_addr>(ipv6_addr.addr))); address->SetPort(base::NetToHost16(ipv6_addr.port)); return; diff --git a/remoting/client/plugin/pepper_util.h b/remoting/client/plugin/pepper_util.h index d0d2ad5..2898789 100644 --- a/remoting/client/plugin/pepper_util.h +++ b/remoting/client/plugin/pepper_util.h @@ -14,7 +14,7 @@ class InstanceHandle; class NetAddress; } -namespace talk_base { +namespace rtc { class SocketAddress; } @@ -23,14 +23,14 @@ namespace remoting { // Helpers to convert between different socket address representations. bool SocketAddressToPpNetAddressWithPort( const pp::InstanceHandle& instance, - const talk_base::SocketAddress& address, + const rtc::SocketAddress& address, pp::NetAddress* pp_net_address, uint16_t port); bool SocketAddressToPpNetAddress(const pp::InstanceHandle& instance, - const talk_base::SocketAddress& address, + const rtc::SocketAddress& address, pp::NetAddress* pp_net_address); void PpNetAddressToSocketAddress(const pp::NetAddress& pp_net_address, - talk_base::SocketAddress* address); + rtc::SocketAddress* address); } // namespace remoting diff --git a/remoting/host/chromium_port_allocator_factory.cc b/remoting/host/chromium_port_allocator_factory.cc index a7ed61e..377c48b 100644 --- a/remoting/host/chromium_port_allocator_factory.cc +++ b/remoting/host/chromium_port_allocator_factory.cc @@ -20,12 +20,12 @@ ChromiumPortAllocatorFactory::ChromiumPortAllocatorFactory( ChromiumPortAllocatorFactory::~ChromiumPortAllocatorFactory() {} -talk_base::scoped_refptr<webrtc::PortAllocatorFactoryInterface> +rtc::scoped_refptr<webrtc::PortAllocatorFactoryInterface> ChromiumPortAllocatorFactory::Create( const protocol::NetworkSettings& network_settings, scoped_refptr<net::URLRequestContextGetter> url_request_context_getter) { - talk_base::RefCountedObject<ChromiumPortAllocatorFactory>* allocator_factory = - new talk_base::RefCountedObject<ChromiumPortAllocatorFactory>( + rtc::RefCountedObject<ChromiumPortAllocatorFactory>* allocator_factory = + new rtc::RefCountedObject<ChromiumPortAllocatorFactory>( network_settings, url_request_context_getter); return allocator_factory; } @@ -37,7 +37,7 @@ cricket::PortAllocator* ChromiumPortAllocatorFactory::CreatePortAllocator( protocol::ChromiumPortAllocator::Create(url_request_context_getter_, network_settings_)); - std::vector<talk_base::SocketAddress> stun_hosts; + std::vector<rtc::SocketAddress> stun_hosts; typedef std::vector<StunConfiguration>::const_iterator StunIt; for (StunIt stun_it = stun_servers.begin(); stun_it != stun_servers.end(); ++stun_it) { diff --git a/remoting/host/chromium_port_allocator_factory.h b/remoting/host/chromium_port_allocator_factory.h index 7f61e1b..2558ab2 100644 --- a/remoting/host/chromium_port_allocator_factory.h +++ b/remoting/host/chromium_port_allocator_factory.h @@ -21,7 +21,7 @@ struct NetworkSettings; class ChromiumPortAllocatorFactory : public webrtc::PortAllocatorFactoryInterface { public: - static talk_base::scoped_refptr<webrtc::PortAllocatorFactoryInterface> Create( + static rtc::scoped_refptr<webrtc::PortAllocatorFactoryInterface> Create( const protocol::NetworkSettings& network_settings, scoped_refptr<net::URLRequestContextGetter> url_request_context_getter); diff --git a/remoting/protocol/DEPS b/remoting/protocol/DEPS index 7848a62..d0a8fc9 100644 --- a/remoting/protocol/DEPS +++ b/remoting/protocol/DEPS @@ -8,5 +8,6 @@ include_rules = [ "+remoting/codec", "+remoting/signaling", "+third_party/libjingle", + "+third_party/webrtc", "+third_party/protobuf/src", ] diff --git a/remoting/protocol/chromium_port_allocator.cc b/remoting/protocol/chromium_port_allocator.cc index cfa261f..df9c09c 100644 --- a/remoting/protocol/chromium_port_allocator.cc +++ b/remoting/protocol/chromium_port_allocator.cc @@ -30,7 +30,7 @@ class ChromiumPortAllocatorSession int component, const std::string& ice_username_fragment, const std::string& ice_password, - const std::vector<talk_base::SocketAddress>& stun_hosts, + const std::vector<rtc::SocketAddress>& stun_hosts, const std::vector<std::string>& relay_hosts, const std::string& relay, const scoped_refptr<net::URLRequestContextGetter>& url_context); @@ -56,7 +56,7 @@ ChromiumPortAllocatorSession::ChromiumPortAllocatorSession( int component, const std::string& ice_username_fragment, const std::string& ice_password, - const std::vector<talk_base::SocketAddress>& stun_hosts, + const std::vector<rtc::SocketAddress>& stun_hosts, const std::vector<std::string>& relay_hosts, const std::string& relay, const scoped_refptr<net::URLRequestContextGetter>& url_context) @@ -133,9 +133,9 @@ void ChromiumPortAllocatorSession::OnURLFetchComplete( scoped_ptr<ChromiumPortAllocator> ChromiumPortAllocator::Create( const scoped_refptr<net::URLRequestContextGetter>& url_context, const NetworkSettings& network_settings) { - scoped_ptr<talk_base::NetworkManager> network_manager( - new talk_base::BasicNetworkManager()); - scoped_ptr<talk_base::PacketSocketFactory> socket_factory( + scoped_ptr<rtc::NetworkManager> network_manager( + new rtc::BasicNetworkManager()); + scoped_ptr<rtc::PacketSocketFactory> socket_factory( new ChromiumPacketSocketFactory()); scoped_ptr<ChromiumPortAllocator> result( new ChromiumPortAllocator(url_context, network_manager.Pass(), @@ -164,8 +164,8 @@ scoped_ptr<ChromiumPortAllocator> ChromiumPortAllocator::Create( ChromiumPortAllocator::ChromiumPortAllocator( const scoped_refptr<net::URLRequestContextGetter>& url_context, - scoped_ptr<talk_base::NetworkManager> network_manager, - scoped_ptr<talk_base::PacketSocketFactory> socket_factory) + scoped_ptr<rtc::NetworkManager> network_manager, + scoped_ptr<rtc::PacketSocketFactory> socket_factory) : HttpPortAllocatorBase(network_manager.get(), socket_factory.get(), std::string()), diff --git a/remoting/protocol/chromium_port_allocator.h b/remoting/protocol/chromium_port_allocator.h index 00aedc1..576f41c 100644 --- a/remoting/protocol/chromium_port_allocator.h +++ b/remoting/protocol/chromium_port_allocator.h @@ -41,12 +41,12 @@ class ChromiumPortAllocator : public cricket::HttpPortAllocatorBase { private: ChromiumPortAllocator( const scoped_refptr<net::URLRequestContextGetter>& url_context, - scoped_ptr<talk_base::NetworkManager> network_manager, - scoped_ptr<talk_base::PacketSocketFactory> socket_factory); + scoped_ptr<rtc::NetworkManager> network_manager, + scoped_ptr<rtc::PacketSocketFactory> socket_factory); scoped_refptr<net::URLRequestContextGetter> url_context_; - scoped_ptr<talk_base::NetworkManager> network_manager_; - scoped_ptr<talk_base::PacketSocketFactory> socket_factory_; + scoped_ptr<rtc::NetworkManager> network_manager_; + scoped_ptr<rtc::PacketSocketFactory> socket_factory_; DISALLOW_COPY_AND_ASSIGN(ChromiumPortAllocator); }; diff --git a/remoting/protocol/chromium_socket_factory.cc b/remoting/protocol/chromium_socket_factory.cc index a424adf..57fb33b 100644 --- a/remoting/protocol/chromium_socket_factory.cc +++ b/remoting/protocol/chromium_socket_factory.cc @@ -13,8 +13,8 @@ #include "net/base/net_errors.h" #include "net/udp/udp_server_socket.h" #include "remoting/protocol/socket_util.h" -#include "third_party/libjingle/source/talk/base/asyncpacketsocket.h" -#include "third_party/libjingle/source/talk/base/nethelpers.h" +#include "third_party/webrtc/base/asyncpacketsocket.h" +#include "third_party/webrtc/base/nethelpers.h" namespace remoting { namespace protocol { @@ -30,26 +30,26 @@ const int kReceiveBufferSize = 65536; // reached under normal conditions. const int kMaxSendBufferSize = 256 * 1024; -class UdpPacketSocket : public talk_base::AsyncPacketSocket { +class UdpPacketSocket : public rtc::AsyncPacketSocket { public: UdpPacketSocket(); virtual ~UdpPacketSocket(); - bool Init(const talk_base::SocketAddress& local_address, + bool Init(const rtc::SocketAddress& local_address, int min_port, int max_port); - // talk_base::AsyncPacketSocket interface. - virtual talk_base::SocketAddress GetLocalAddress() const OVERRIDE; - virtual talk_base::SocketAddress GetRemoteAddress() const OVERRIDE; + // rtc::AsyncPacketSocket interface. + virtual rtc::SocketAddress GetLocalAddress() const OVERRIDE; + virtual rtc::SocketAddress GetRemoteAddress() const OVERRIDE; virtual int Send(const void* data, size_t data_size, - const talk_base::PacketOptions& options) OVERRIDE; + const rtc::PacketOptions& options) OVERRIDE; virtual int SendTo(const void* data, size_t data_size, - const talk_base::SocketAddress& address, - const talk_base::PacketOptions& options) OVERRIDE; + const rtc::SocketAddress& address, + const rtc::PacketOptions& options) OVERRIDE; virtual int Close() OVERRIDE; virtual State GetState() const OVERRIDE; - virtual int GetOption(talk_base::Socket::Option option, int* value) OVERRIDE; - virtual int SetOption(talk_base::Socket::Option option, int value) OVERRIDE; + virtual int GetOption(rtc::Socket::Option option, int* value) OVERRIDE; + virtual int SetOption(rtc::Socket::Option option, int value) OVERRIDE; virtual int GetError() const OVERRIDE; virtual void SetError(int error) OVERRIDE; @@ -78,7 +78,7 @@ class UdpPacketSocket : public talk_base::AsyncPacketSocket { State state_; int error_; - talk_base::SocketAddress local_address_; + rtc::SocketAddress local_address_; // Receive buffer and address are populated by asynchronous reads. scoped_refptr<net::IOBuffer> receive_buffer_; @@ -112,7 +112,7 @@ UdpPacketSocket::~UdpPacketSocket() { Close(); } -bool UdpPacketSocket::Init(const talk_base::SocketAddress& local_address, +bool UdpPacketSocket::Init(const rtc::SocketAddress& local_address, int min_port, int max_port) { net::IPEndPoint local_endpoint; if (!jingle_glue::SocketAddressToIPEndPoint( @@ -148,27 +148,27 @@ bool UdpPacketSocket::Init(const talk_base::SocketAddress& local_address, return true; } -talk_base::SocketAddress UdpPacketSocket::GetLocalAddress() const { +rtc::SocketAddress UdpPacketSocket::GetLocalAddress() const { DCHECK_EQ(state_, STATE_BOUND); return local_address_; } -talk_base::SocketAddress UdpPacketSocket::GetRemoteAddress() const { +rtc::SocketAddress UdpPacketSocket::GetRemoteAddress() const { // UDP sockets are not connected - this method should never be called. NOTREACHED(); - return talk_base::SocketAddress(); + return rtc::SocketAddress(); } int UdpPacketSocket::Send(const void* data, size_t data_size, - const talk_base::PacketOptions& options) { + const rtc::PacketOptions& options) { // UDP sockets are not connected - this method should never be called. NOTREACHED(); return EWOULDBLOCK; } int UdpPacketSocket::SendTo(const void* data, size_t data_size, - const talk_base::SocketAddress& address, - const talk_base::PacketOptions& options) { + const rtc::SocketAddress& address, + const rtc::PacketOptions& options) { if (state_ != STATE_BOUND) { NOTREACHED(); return EINVAL; @@ -200,51 +200,51 @@ int UdpPacketSocket::Close() { return 0; } -talk_base::AsyncPacketSocket::State UdpPacketSocket::GetState() const { +rtc::AsyncPacketSocket::State UdpPacketSocket::GetState() const { return state_; } -int UdpPacketSocket::GetOption(talk_base::Socket::Option option, int* value) { +int UdpPacketSocket::GetOption(rtc::Socket::Option option, int* value) { // This method is never called by libjingle. NOTIMPLEMENTED(); return -1; } -int UdpPacketSocket::SetOption(talk_base::Socket::Option option, int value) { +int UdpPacketSocket::SetOption(rtc::Socket::Option option, int value) { if (state_ != STATE_BOUND) { NOTREACHED(); return EINVAL; } switch (option) { - case talk_base::Socket::OPT_DONTFRAGMENT: + case rtc::Socket::OPT_DONTFRAGMENT: NOTIMPLEMENTED(); return -1; - case talk_base::Socket::OPT_RCVBUF: { + case rtc::Socket::OPT_RCVBUF: { int net_error = socket_->SetReceiveBufferSize(value); return (net_error == net::OK) ? 0 : -1; } - case talk_base::Socket::OPT_SNDBUF: { + case rtc::Socket::OPT_SNDBUF: { int net_error = socket_->SetSendBufferSize(value); return (net_error == net::OK) ? 0 : -1; } - case talk_base::Socket::OPT_NODELAY: + case rtc::Socket::OPT_NODELAY: // OPT_NODELAY is only for TCP sockets. NOTREACHED(); return -1; - case talk_base::Socket::OPT_IPV6_V6ONLY: + case rtc::Socket::OPT_IPV6_V6ONLY: NOTIMPLEMENTED(); return -1; - case talk_base::Socket::OPT_DSCP: + case rtc::Socket::OPT_DSCP: NOTIMPLEMENTED(); return -1; - case talk_base::Socket::OPT_RTP_SENDTIME_EXTN_ID: + case rtc::Socket::OPT_RTP_SENDTIME_EXTN_ID: NOTIMPLEMENTED(); return -1; } @@ -336,14 +336,14 @@ void UdpPacketSocket::HandleReadResult(int result) { } if (result > 0) { - talk_base::SocketAddress address; + rtc::SocketAddress address; if (!jingle_glue::IPEndPointToSocketAddress(receive_address_, &address)) { NOTREACHED(); LOG(ERROR) << "Failed to convert address received from RecvFrom()."; return; } SignalReadPacket(this, receive_buffer_->data(), result, address, - talk_base::CreatePacketTime(0)); + rtc::CreatePacketTime(0)); } else { LOG(ERROR) << "Received error when reading from UDP socket: " << result; } @@ -357,8 +357,8 @@ ChromiumPacketSocketFactory::ChromiumPacketSocketFactory() { ChromiumPacketSocketFactory::~ChromiumPacketSocketFactory() { } -talk_base::AsyncPacketSocket* ChromiumPacketSocketFactory::CreateUdpSocket( - const talk_base::SocketAddress& local_address, +rtc::AsyncPacketSocket* ChromiumPacketSocketFactory::CreateUdpSocket( + const rtc::SocketAddress& local_address, int min_port, int max_port) { scoped_ptr<UdpPacketSocket> result(new UdpPacketSocket()); if (!result->Init(local_address, min_port, max_port)) @@ -366,9 +366,9 @@ talk_base::AsyncPacketSocket* ChromiumPacketSocketFactory::CreateUdpSocket( return result.release(); } -talk_base::AsyncPacketSocket* +rtc::AsyncPacketSocket* ChromiumPacketSocketFactory::CreateServerTcpSocket( - const talk_base::SocketAddress& local_address, + const rtc::SocketAddress& local_address, int min_port, int max_port, int opts) { // We don't use TCP sockets for remoting connections. @@ -376,11 +376,11 @@ ChromiumPacketSocketFactory::CreateServerTcpSocket( return NULL; } -talk_base::AsyncPacketSocket* +rtc::AsyncPacketSocket* ChromiumPacketSocketFactory::CreateClientTcpSocket( - const talk_base::SocketAddress& local_address, - const talk_base::SocketAddress& remote_address, - const talk_base::ProxyInfo& proxy_info, + const rtc::SocketAddress& local_address, + const rtc::SocketAddress& remote_address, + const rtc::ProxyInfo& proxy_info, const std::string& user_agent, int opts) { // We don't use TCP sockets for remoting connections. @@ -388,9 +388,9 @@ ChromiumPacketSocketFactory::CreateClientTcpSocket( return NULL; } -talk_base::AsyncResolverInterface* +rtc::AsyncResolverInterface* ChromiumPacketSocketFactory::CreateAsyncResolver() { - return new talk_base::AsyncResolver(); + return new rtc::AsyncResolver(); } } // namespace protocol diff --git a/remoting/protocol/chromium_socket_factory.h b/remoting/protocol/chromium_socket_factory.h index 5a886a5..b07b03c 100644 --- a/remoting/protocol/chromium_socket_factory.h +++ b/remoting/protocol/chromium_socket_factory.h @@ -11,25 +11,25 @@ namespace remoting { namespace protocol { -class ChromiumPacketSocketFactory : public talk_base::PacketSocketFactory { +class ChromiumPacketSocketFactory : public rtc::PacketSocketFactory { public: explicit ChromiumPacketSocketFactory(); virtual ~ChromiumPacketSocketFactory(); - virtual talk_base::AsyncPacketSocket* CreateUdpSocket( - const talk_base::SocketAddress& local_address, + virtual rtc::AsyncPacketSocket* CreateUdpSocket( + const rtc::SocketAddress& local_address, int min_port, int max_port) OVERRIDE; - virtual talk_base::AsyncPacketSocket* CreateServerTcpSocket( - const talk_base::SocketAddress& local_address, + virtual rtc::AsyncPacketSocket* CreateServerTcpSocket( + const rtc::SocketAddress& local_address, int min_port, int max_port, int opts) OVERRIDE; - virtual talk_base::AsyncPacketSocket* CreateClientTcpSocket( - const talk_base::SocketAddress& local_address, - const talk_base::SocketAddress& remote_address, - const talk_base::ProxyInfo& proxy_info, + virtual rtc::AsyncPacketSocket* CreateClientTcpSocket( + const rtc::SocketAddress& local_address, + const rtc::SocketAddress& remote_address, + const rtc::ProxyInfo& proxy_info, const std::string& user_agent, int opts) OVERRIDE; - virtual talk_base::AsyncResolverInterface* CreateAsyncResolver() OVERRIDE; + virtual rtc::AsyncResolverInterface* CreateAsyncResolver() OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(ChromiumPacketSocketFactory); diff --git a/remoting/protocol/chromium_socket_factory_unittest.cc b/remoting/protocol/chromium_socket_factory_unittest.cc index 8755d66..9a0a4dc 100644 --- a/remoting/protocol/chromium_socket_factory_unittest.cc +++ b/remoting/protocol/chromium_socket_factory_unittest.cc @@ -8,8 +8,8 @@ #include "base/run_loop.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/libjingle/source/talk/base/asyncpacketsocket.h" -#include "third_party/libjingle/source/talk/base/socketaddress.h" +#include "third_party/webrtc/base/asyncpacketsocket.h" +#include "third_party/webrtc/base/socketaddress.h" namespace remoting { namespace protocol { @@ -21,30 +21,30 @@ class ChromiumSocketFactoryTest : public testing::Test, socket_factory_.reset(new ChromiumPacketSocketFactory()); socket_.reset(socket_factory_->CreateUdpSocket( - talk_base::SocketAddress("127.0.0.1", 0), 0, 0)); + rtc::SocketAddress("127.0.0.1", 0), 0, 0)); ASSERT_TRUE(socket_.get() != NULL); - EXPECT_EQ(socket_->GetState(), talk_base::AsyncPacketSocket::STATE_BOUND); + EXPECT_EQ(socket_->GetState(), rtc::AsyncPacketSocket::STATE_BOUND); socket_->SignalReadPacket.connect( this, &ChromiumSocketFactoryTest::OnPacket); } - void OnPacket(talk_base::AsyncPacketSocket* socket, + void OnPacket(rtc::AsyncPacketSocket* socket, const char* data, size_t size, - const talk_base::SocketAddress& address, - const talk_base::PacketTime& packet_time) { + const rtc::SocketAddress& address, + const rtc::PacketTime& packet_time) { EXPECT_EQ(socket, socket_.get()); last_packet_.assign(data, data + size); last_address_ = address; run_loop_.Quit(); } - void VerifyCanSendAndReceive(talk_base::AsyncPacketSocket* sender) { + void VerifyCanSendAndReceive(rtc::AsyncPacketSocket* sender) { // UDP packets may be lost, so we have to retry sending it more than once. const int kMaxAttempts = 3; const base::TimeDelta kAttemptPeriod = base::TimeDelta::FromSeconds(1); std::string test_packet("TEST PACKET"); int attempts = 0; - talk_base::PacketOptions options; + rtc::PacketOptions options; while (last_packet_.empty() && attempts++ < kMaxAttempts) { sender->SendTo(test_packet.data(), test_packet.size(), socket_->GetLocalAddress(), options); @@ -60,52 +60,52 @@ class ChromiumSocketFactoryTest : public testing::Test, base::MessageLoopForIO message_loop_; base::RunLoop run_loop_; - scoped_ptr<talk_base::PacketSocketFactory> socket_factory_; - scoped_ptr<talk_base::AsyncPacketSocket> socket_; + scoped_ptr<rtc::PacketSocketFactory> socket_factory_; + scoped_ptr<rtc::AsyncPacketSocket> socket_; std::string last_packet_; - talk_base::SocketAddress last_address_; + rtc::SocketAddress last_address_; }; TEST_F(ChromiumSocketFactoryTest, SendAndReceive) { - scoped_ptr<talk_base::AsyncPacketSocket> sending_socket( + scoped_ptr<rtc::AsyncPacketSocket> sending_socket( socket_factory_->CreateUdpSocket( - talk_base::SocketAddress("127.0.0.1", 0), 0, 0)); + rtc::SocketAddress("127.0.0.1", 0), 0, 0)); ASSERT_TRUE(sending_socket.get() != NULL); EXPECT_EQ(sending_socket->GetState(), - talk_base::AsyncPacketSocket::STATE_BOUND); + rtc::AsyncPacketSocket::STATE_BOUND); VerifyCanSendAndReceive(sending_socket.get()); } TEST_F(ChromiumSocketFactoryTest, SetOptions) { - EXPECT_EQ(0, socket_->SetOption(talk_base::Socket::OPT_SNDBUF, 4096)); - EXPECT_EQ(0, socket_->SetOption(talk_base::Socket::OPT_RCVBUF, 4096)); + EXPECT_EQ(0, socket_->SetOption(rtc::Socket::OPT_SNDBUF, 4096)); + EXPECT_EQ(0, socket_->SetOption(rtc::Socket::OPT_RCVBUF, 4096)); } TEST_F(ChromiumSocketFactoryTest, PortRange) { const int kMinPort = 12400; const int kMaxPort = 12410; socket_.reset(socket_factory_->CreateUdpSocket( - talk_base::SocketAddress("127.0.0.1", 0), kMaxPort, kMaxPort)); + rtc::SocketAddress("127.0.0.1", 0), kMaxPort, kMaxPort)); ASSERT_TRUE(socket_.get() != NULL); - EXPECT_EQ(socket_->GetState(), talk_base::AsyncPacketSocket::STATE_BOUND); + EXPECT_EQ(socket_->GetState(), rtc::AsyncPacketSocket::STATE_BOUND); EXPECT_GE(socket_->GetLocalAddress().port(), kMinPort); EXPECT_LE(socket_->GetLocalAddress().port(), kMaxPort); } TEST_F(ChromiumSocketFactoryTest, TransientError) { - scoped_ptr<talk_base::AsyncPacketSocket> sending_socket( + scoped_ptr<rtc::AsyncPacketSocket> sending_socket( socket_factory_->CreateUdpSocket( - talk_base::SocketAddress("127.0.0.1", 0), 0, 0)); + rtc::SocketAddress("127.0.0.1", 0), 0, 0)); std::string test_packet("TEST"); // Try sending a packet to an IPv6 address from a socket that's bound to an // IPv4 address. This send is expected to fail, but the socket should still be // functional. sending_socket->SendTo(test_packet.data(), test_packet.size(), - talk_base::SocketAddress("::1", 0), - talk_base::PacketOptions()); + rtc::SocketAddress("::1", 0), + rtc::PacketOptions()); // Verify that socket is still usable. VerifyCanSendAndReceive(sending_socket.get()); diff --git a/remoting/protocol/jingle_messages.cc b/remoting/protocol/jingle_messages.cc index 2a5b2f0..f378600 100644 --- a/remoting/protocol/jingle_messages.cc +++ b/remoting/protocol/jingle_messages.cc @@ -77,7 +77,7 @@ bool ParseCandidate(const buzz::XmlElement* element, candidate->name = name; - candidate->candidate.set_address(talk_base::SocketAddress(address, port)); + candidate->candidate.set_address(rtc::SocketAddress(address, port)); candidate->candidate.set_type(type); candidate->candidate.set_protocol(protocol); candidate->candidate.set_username(username); diff --git a/remoting/protocol/jingle_session_manager.cc b/remoting/protocol/jingle_session_manager.cc index 0c2f26e..beef15c 100644 --- a/remoting/protocol/jingle_session_manager.cc +++ b/remoting/protocol/jingle_session_manager.cc @@ -12,8 +12,8 @@ #include "remoting/protocol/transport.h" #include "remoting/signaling/iq_sender.h" #include "remoting/signaling/signal_strategy.h" -#include "third_party/libjingle/source/talk/base/socketaddress.h" #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" +#include "third_party/webrtc/base/socketaddress.h" using buzz::QName; diff --git a/remoting/protocol/jingle_session_manager.h b/remoting/protocol/jingle_session_manager.h index 0193523..89df613 100644 --- a/remoting/protocol/jingle_session_manager.h +++ b/remoting/protocol/jingle_session_manager.h @@ -23,9 +23,9 @@ namespace buzz { class XmlElement; } // namespace buzz -namespace talk_base { +namespace rtc { class SocketAddress; -} // namespace talk_base +} // namespace rtc namespace remoting { @@ -71,7 +71,7 @@ class JingleSessionManager : public SessionManager, void OnJingleInfo( const std::string& relay_token, const std::vector<std::string>& relay_hosts, - const std::vector<talk_base::SocketAddress>& stun_hosts); + const std::vector<rtc::SocketAddress>& stun_hosts); IqSender* iq_sender() { return iq_sender_.get(); } void SendReply(const buzz::XmlElement* original_stanza, diff --git a/remoting/protocol/libjingle_transport_factory.cc b/remoting/protocol/libjingle_transport_factory.cc index d2bddc3..cc31440 100644 --- a/remoting/protocol/libjingle_transport_factory.cc +++ b/remoting/protocol/libjingle_transport_factory.cc @@ -16,12 +16,12 @@ #include "remoting/protocol/channel_authenticator.h" #include "remoting/protocol/network_settings.h" #include "remoting/signaling/jingle_info_request.h" -#include "third_party/libjingle/source/talk/base/network.h" #include "third_party/libjingle/source/talk/p2p/base/constants.h" #include "third_party/libjingle/source/talk/p2p/base/p2ptransportchannel.h" #include "third_party/libjingle/source/talk/p2p/base/port.h" #include "third_party/libjingle/source/talk/p2p/client/basicportallocator.h" #include "third_party/libjingle/source/talk/p2p/client/httpportallocator.h" +#include "third_party/webrtc/base/network.h" namespace remoting { namespace protocol { @@ -127,8 +127,8 @@ LibjingleStreamTransport::LibjingleStreamTransport( network_settings_(network_settings), event_handler_(NULL), ice_username_fragment_( - talk_base::CreateRandomString(cricket::ICE_UFRAG_LENGTH)), - ice_password_(talk_base::CreateRandomString(cricket::ICE_PWD_LENGTH)), + rtc::CreateRandomString(cricket::ICE_UFRAG_LENGTH)), + ice_password_(rtc::CreateRandomString(cricket::ICE_PWD_LENGTH)), can_start_(false), channel_was_writable_(false), connect_attempts_left_(kMaxReconnectAttempts) { @@ -379,7 +379,7 @@ void LibjingleStreamTransport::TryReconnect() { --connect_attempts_left_; // Restart ICE by resetting ICE password. - ice_password_ = talk_base::CreateRandomString(cricket::ICE_PWD_LENGTH); + ice_password_ = rtc::CreateRandomString(cricket::ICE_PWD_LENGTH); channel_->SetIceCredentials(ice_username_fragment_, ice_password_); } @@ -475,7 +475,7 @@ void LibjingleTransportFactory::EnsureFreshJingleInfo() { void LibjingleTransportFactory::OnJingleInfo( const std::string& relay_token, const std::vector<std::string>& relay_hosts, - const std::vector<talk_base::SocketAddress>& stun_hosts) { + const std::vector<rtc::SocketAddress>& stun_hosts) { if (!relay_token.empty() && !relay_hosts.empty()) { port_allocator_->SetRelayHosts(relay_hosts); port_allocator_->SetRelayToken(relay_token); diff --git a/remoting/protocol/libjingle_transport_factory.h b/remoting/protocol/libjingle_transport_factory.h index 1c00731..08661df 100644 --- a/remoting/protocol/libjingle_transport_factory.h +++ b/remoting/protocol/libjingle_transport_factory.h @@ -20,11 +20,11 @@ namespace net { class URLRequestContextGetter; } // namespace net -namespace talk_base { +namespace rtc { class NetworkManager; class PacketSocketFactory; class SocketAddress; -} // namespace talk_base +} // namespace rtc namespace remoting { @@ -54,7 +54,7 @@ class LibjingleTransportFactory : public TransportFactory { void EnsureFreshJingleInfo(); void OnJingleInfo(const std::string& relay_token, const std::vector<std::string>& relay_hosts, - const std::vector<talk_base::SocketAddress>& stun_hosts); + const std::vector<rtc::SocketAddress>& stun_hosts); SignalStrategy* signal_strategy_; scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator_; diff --git a/remoting/protocol/message_decoder.cc b/remoting/protocol/message_decoder.cc index 14ee9a3..59e78b7 100644 --- a/remoting/protocol/message_decoder.cc +++ b/remoting/protocol/message_decoder.cc @@ -8,7 +8,7 @@ #include "net/base/io_buffer.h" #include "remoting/base/compound_buffer.h" #include "remoting/proto/internal.pb.h" -#include "third_party/libjingle/source/talk/base/byteorder.h" +#include "third_party/webrtc/base/byteorder.h" namespace remoting { namespace protocol { @@ -61,7 +61,7 @@ bool MessageDecoder::GetPayloadSize(int* size) { char header[kHeaderSize]; header_buffer.CopyFrom(buffer_, 0, kHeaderSize); header_buffer.CopyTo(header, kHeaderSize); - *size = talk_base::GetBE32(header); + *size = rtc::GetBE32(header); buffer_.CropFront(kHeaderSize); return true; } diff --git a/remoting/protocol/message_reader_unittest.cc b/remoting/protocol/message_reader_unittest.cc index 497e7a5..1ea2412 100644 --- a/remoting/protocol/message_reader_unittest.cc +++ b/remoting/protocol/message_reader_unittest.cc @@ -17,7 +17,7 @@ #include "remoting/protocol/message_reader.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/libjingle/source/talk/base/byteorder.h" +#include "third_party/webrtc/base/byteorder.h" using testing::_; using testing::DoAll; @@ -82,7 +82,7 @@ class MessageReaderTest : public testing::Test { void AddMessage(const std::string& message) { std::string data = std::string(4, ' ') + message; - talk_base::SetBE32(const_cast<char*>(data.data()), message.size()); + rtc::SetBE32(const_cast<char*>(data.data()), message.size()); socket_.AppendInputData(std::vector<char>(data.begin(), data.end())); } diff --git a/remoting/protocol/message_serialization.cc b/remoting/protocol/message_serialization.cc index 2a22209..435baf9 100644 --- a/remoting/protocol/message_serialization.cc +++ b/remoting/protocol/message_serialization.cc @@ -8,7 +8,7 @@ #include "base/containers/hash_tables.h" #include "base/logging.h" #include "net/base/io_buffer.h" -#include "third_party/libjingle/source/talk/base/byteorder.h" +#include "third_party/webrtc/base/byteorder.h" namespace remoting { namespace protocol { @@ -20,7 +20,7 @@ scoped_refptr<net::IOBufferWithSize> SerializeAndFrameMessage( const int kExtraBytes = sizeof(int32); int size = msg.ByteSize() + kExtraBytes; scoped_refptr<net::IOBufferWithSize> buffer(new net::IOBufferWithSize(size)); - talk_base::SetBE32(buffer->data(), msg.GetCachedSize()); + rtc::SetBE32(buffer->data(), msg.GetCachedSize()); msg.SerializeWithCachedSizesToArray( reinterpret_cast<uint8*>(buffer->data()) + kExtraBytes); return buffer; diff --git a/remoting/signaling/DEPS b/remoting/signaling/DEPS index f7228c3d8..3c4e447 100644 --- a/remoting/signaling/DEPS +++ b/remoting/signaling/DEPS @@ -2,4 +2,5 @@ include_rules = [ "+net", "+jingle", "+third_party/libjingle", + "+third_party/webrtc/base", ] diff --git a/remoting/signaling/jingle_info_request.cc b/remoting/signaling/jingle_info_request.cc index 0fc4ab4..5534296 100644 --- a/remoting/signaling/jingle_info_request.cc +++ b/remoting/signaling/jingle_info_request.cc @@ -11,9 +11,9 @@ #include "base/time/time.h" #include "net/base/net_util.h" #include "remoting/signaling/iq_sender.h" -#include "third_party/libjingle/source/talk/base/socketaddress.h" #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" #include "third_party/libjingle/source/talk/xmpp/constants.h" +#include "third_party/webrtc/base/socketaddress.h" namespace remoting { @@ -35,7 +35,7 @@ void JingleInfoRequest::Send(const OnJingleInfoCallback& callback) { if (!request_) { // If we failed to send IqRequest it means that SignalStrategy is // disconnected. Notify the caller. - std::vector<talk_base::SocketAddress> stun_hosts; + std::vector<rtc::SocketAddress> stun_hosts; std::vector<std::string> relay_hosts; std::string relay_token; on_jingle_info_cb_.Run(relay_token, relay_hosts, stun_hosts); @@ -46,7 +46,7 @@ void JingleInfoRequest::Send(const OnJingleInfoCallback& callback) { void JingleInfoRequest::OnResponse(IqRequest* request, const buzz::XmlElement* stanza) { - std::vector<talk_base::SocketAddress> stun_hosts; + std::vector<rtc::SocketAddress> stun_hosts; std::vector<std::string> relay_hosts; std::string relay_token; @@ -80,7 +80,7 @@ void JingleInfoRequest::OnResponse(IqRequest* request, continue; } - stun_hosts.push_back(talk_base::SocketAddress(host, port)); + stun_hosts.push_back(rtc::SocketAddress(host, port)); } } } diff --git a/remoting/signaling/jingle_info_request.h b/remoting/signaling/jingle_info_request.h index b1cbf6f..cfe9959 100644 --- a/remoting/signaling/jingle_info_request.h +++ b/remoting/signaling/jingle_info_request.h @@ -18,9 +18,9 @@ namespace buzz { class XmlElement; } // namespace buzz -namespace talk_base { +namespace rtc { class SocketAddress; -} // namespace talk_base +} // namespace rtc namespace remoting { @@ -39,7 +39,7 @@ class JingleInfoRequest { // if the request has timed out. typedef base::Callback<void(const std::string& relay_token, const std::vector<std::string>& relay_servers, - const std::vector<talk_base::SocketAddress>& + const std::vector<rtc::SocketAddress>& stun_servers)> OnJingleInfoCallback; explicit JingleInfoRequest(SignalStrategy* signal_strategy); diff --git a/remoting/signaling/xmpp_signal_strategy.cc b/remoting/signaling/xmpp_signal_strategy.cc index 62b9312..46f9294 100644 --- a/remoting/signaling/xmpp_signal_strategy.cc +++ b/remoting/signaling/xmpp_signal_strategy.cc @@ -17,9 +17,9 @@ #include "jingle/notifier/base/gaia_token_pre_xmpp_auth.h" #include "net/socket/client_socket_factory.h" #include "net/url_request/url_request_context_getter.h" -#include "third_party/libjingle/source/talk/base/thread.h" #include "third_party/libjingle/source/talk/xmpp/prexmppauth.h" #include "third_party/libjingle/source/talk/xmpp/saslcookiemechanism.h" +#include "third_party/webrtc/base/thread.h" const char kDefaultResourceName[] = "chromoting"; @@ -77,7 +77,7 @@ void XmppSignalStrategy::Connect() { settings.set_token_service(xmpp_server_config_.auth_service); settings.set_auth_token(buzz::AUTH_MECHANISM_GOOGLE_TOKEN, xmpp_server_config_.auth_token); - settings.set_server(talk_base::SocketAddress( + settings.set_server(rtc::SocketAddress( xmpp_server_config_.host, xmpp_server_config_.port)); settings.set_use_tls( xmpp_server_config_.use_tls ? buzz::TLS_ENABLED : buzz::TLS_DISABLED); diff --git a/remoting/signaling/xmpp_signal_strategy.h b/remoting/signaling/xmpp_signal_strategy.h index e612c27..9460e5f 100644 --- a/remoting/signaling/xmpp_signal_strategy.h +++ b/remoting/signaling/xmpp_signal_strategy.h @@ -18,17 +18,17 @@ #include "base/observer_list.h" #include "base/threading/non_thread_safe.h" #include "base/timer/timer.h" -#include "third_party/libjingle/source/talk/base/sigslot.h" #include "third_party/libjingle/source/talk/xmpp/xmppclient.h" +#include "third_party/webrtc/base/sigslot.h" namespace net { class ClientSocketFactory; class URLRequestContextGetter; } // namespace net -namespace talk_base { +namespace rtc { class TaskRunner; -} // namespace talk_base +} // namespace rtc namespace remoting { @@ -96,7 +96,7 @@ class XmppSignalStrategy : public base::NonThreadSafe, net::ClientSocketFactory* socket_factory_; scoped_refptr<net::URLRequestContextGetter> request_context_getter_; std::string resource_name_; - scoped_ptr<talk_base::TaskRunner> task_runner_; + scoped_ptr<rtc::TaskRunner> task_runner_; buzz::XmppClient* xmpp_client_; XmppServerConfig xmpp_server_config_; diff --git a/third_party/libjingle/README.chromium b/third_party/libjingle/README.chromium index 23647f4..5d2ed5d 100644 --- a/third_party/libjingle/README.chromium +++ b/third_party/libjingle/README.chromium @@ -1,7 +1,7 @@ Name: libjingle URL: http://code.google.com/p/webrtc/ Version: unknown -Revision: 6774 +Revision: 6825 License: BSD License File: source/talk/COPYING Security Critical: yes diff --git a/third_party/libjingle/libjingle.gyp b/third_party/libjingle/libjingle.gyp index 1ac789b..3e1b8cd 100644 --- a/third_party/libjingle/libjingle.gyp +++ b/third_party/libjingle/libjingle.gyp @@ -22,7 +22,7 @@ 'HAVE_SRTP', 'HAVE_WEBRTC_VIDEO', 'HAVE_WEBRTC_VOICE', - 'LOGGING_INSIDE_LIBJINGLE', + 'LOGGING_INSIDE_WEBRTC', 'NO_MAIN_THREAD_WRAPPING', 'NO_SOUND_SYSTEM', 'SRTP_RELATIVE_PATH', @@ -40,14 +40,13 @@ }, 'include_dirs': [ './overrides', - './<(libjingle_source)', '../../third_party/webrtc/overrides', + './<(libjingle_source)', '../..', '../../testing/gtest/include', '../../third_party', '../../third_party/libyuv/include', '../../third_party/usrsctp', - '../../third_party/webrtc', ], 'dependencies': [ '<(DEPTH)/base/base.gyp:base', @@ -59,13 +58,12 @@ ], 'direct_dependent_settings': { 'include_dirs': [ + '../../third_party/webrtc/overrides', './overrides', './<(libjingle_source)', - '../../third_party/webrtc/overrides', '../..', '../../testing/gtest/include', '../../third_party', - '../../third_party/webrtc', ], 'defines': [ 'FEATURE_ENABLE_SSL', @@ -98,11 +96,25 @@ ['OS=="linux"', { 'defines': [ 'LINUX', + 'WEBRTC_LINUX', ], }], ['OS=="mac"', { 'defines': [ 'OSX', + 'WEBRTC_MAC', + ], + }], + ['OS=="ios"', { + 'defines': [ + 'IOS', + 'WEBRTC_MAC', + 'WEBRTC_IOS', + ], + }], + ['OS=="win"', { + 'defines': [ + 'WEBRTC_WIN', ], }], ['OS=="android"', { @@ -113,6 +125,7 @@ ['os_posix==1', { 'defines': [ 'POSIX', + 'WEBRTC_POSIX', ], }], ['os_bsd==1', { @@ -202,21 +215,31 @@ ['OS=="linux"', { 'defines': [ 'LINUX', + 'WEBRTC_LINUX', ], }], ['OS=="mac"', { 'defines': [ 'OSX', + 'WEBRTC_MAC', + ], + }], + ['OS=="win"', { + 'defines': [ + 'WEBRTC_WIN', ], }], ['OS=="ios"', { 'defines': [ 'IOS', + 'WEBRTC_MAC', + 'WEBRTC_IOS', ], }], ['os_posix == 1', { 'defines': [ 'POSIX', + 'WEBRTC_POSIX', ], }], ['os_bsd==1', { @@ -241,26 +264,13 @@ 'target_name': 'libjingle', 'type': 'static_library', 'includes': [ 'libjingle_common.gypi' ], - 'sources': [ - 'overrides/talk/base/basictypes.h', - 'overrides/talk/base/constructormagic.h', - 'overrides/talk/base/win32socketinit.cc', - - # Overrides logging.h/.cc because libjingle logging should be done to - # the same place as the chromium logging. - 'overrides/talk/base/logging.cc', - 'overrides/talk/base/logging.h', - ], 'sources!' : [ # Compiled as part of libjingle_p2p_constants. '<(libjingle_source)/talk/p2p/base/constants.cc', '<(libjingle_source)/talk/p2p/base/constants.h', - - # Replaced with logging.cc in the overrides. - '<(libjingle_source)/talk/base/logging.h', - '<(libjingle_source)/talk/base/logging.cc', ], 'dependencies': [ + '<(DEPTH)/third_party/webrtc/base/base.gyp:webrtc_base', 'libjingle_p2p_constants', '<@(libjingle_additional_deps)', ], @@ -508,10 +518,6 @@ 'conditions': [ ['OS=="win"', { 'sources': [ - '<(libjingle_source)/talk/base/win32window.cc', - '<(libjingle_source)/talk/base/win32window.h', - '<(libjingle_source)/talk/base/win32windowpicker.cc', - '<(libjingle_source)/talk/base/win32windowpicker.h', '<(libjingle_source)/talk/media/devices/win32deviceinfo.cc', '<(libjingle_source)/talk/media/devices/win32devicemanager.cc', '<(libjingle_source)/talk/media/devices/win32devicemanager.h', @@ -519,8 +525,6 @@ }], ['OS=="linux"', { 'sources': [ - '<(libjingle_source)/talk/base/linuxwindowpicker.cc', - '<(libjingle_source)/talk/base/linuxwindowpicker.h', '<(libjingle_source)/talk/media/devices/libudevsymboltable.cc', '<(libjingle_source)/talk/media/devices/libudevsymboltable.h', '<(libjingle_source)/talk/media/devices/linuxdeviceinfo.cc', diff --git a/third_party/libjingle/libjingle_common.gypi b/third_party/libjingle/libjingle_common.gypi index 9f6c880..c2bc1bb 100644 --- a/third_party/libjingle/libjingle_common.gypi +++ b/third_party/libjingle/libjingle_common.gypi @@ -7,186 +7,6 @@ 'nacl_untrusted_build%': 0, }, 'sources': [ - '<(libjingle_source)/talk/base/asyncfile.cc', - '<(libjingle_source)/talk/base/asyncfile.h', - '<(libjingle_source)/talk/base/asynchttprequest.cc', - '<(libjingle_source)/talk/base/asynchttprequest.h', - '<(libjingle_source)/talk/base/asyncpacketsocket.h', - '<(libjingle_source)/talk/base/asyncsocket.cc', - '<(libjingle_source)/talk/base/asyncsocket.h', - '<(libjingle_source)/talk/base/asynctcpsocket.cc', - '<(libjingle_source)/talk/base/asynctcpsocket.h', - '<(libjingle_source)/talk/base/asyncudpsocket.cc', - '<(libjingle_source)/talk/base/asyncudpsocket.h', - '<(libjingle_source)/talk/base/autodetectproxy.cc', - '<(libjingle_source)/talk/base/autodetectproxy.h', - '<(libjingle_source)/talk/base/base64.cc', - '<(libjingle_source)/talk/base/base64.h', - '<(libjingle_source)/talk/base/basicdefs.h', - '<(libjingle_source)/talk/base/bytebuffer.cc', - '<(libjingle_source)/talk/base/bytebuffer.h', - '<(libjingle_source)/talk/base/byteorder.h', - '<(libjingle_source)/talk/base/checks.cc', - '<(libjingle_source)/talk/base/checks.h', - '<(libjingle_source)/talk/base/common.cc', - '<(libjingle_source)/talk/base/common.h', - '<(libjingle_source)/talk/base/compile_assert.h', - '<(libjingle_source)/talk/base/cpumonitor.cc', - '<(libjingle_source)/talk/base/cpumonitor.h', - '<(libjingle_source)/talk/base/crc32.cc', - '<(libjingle_source)/talk/base/crc32.h', - '<(libjingle_source)/talk/base/criticalsection.h', - '<(libjingle_source)/talk/base/cryptstring.h', - '<(libjingle_source)/talk/base/diskcache.cc', - '<(libjingle_source)/talk/base/diskcache.h', - '<(libjingle_source)/talk/base/dscp.h', - '<(libjingle_source)/talk/base/event.cc', - '<(libjingle_source)/talk/base/event.h', - '<(libjingle_source)/talk/base/fileutils.cc', - '<(libjingle_source)/talk/base/fileutils.h', - '<(libjingle_source)/talk/base/firewallsocketserver.cc', - '<(libjingle_source)/talk/base/firewallsocketserver.h', - '<(libjingle_source)/talk/base/flags.cc', - '<(libjingle_source)/talk/base/flags.h', - '<(libjingle_source)/talk/base/helpers.cc', - '<(libjingle_source)/talk/base/helpers.h', - '<(libjingle_source)/talk/base/httpbase.cc', - '<(libjingle_source)/talk/base/httpbase.h', - '<(libjingle_source)/talk/base/httpclient.cc', - '<(libjingle_source)/talk/base/httpclient.h', - '<(libjingle_source)/talk/base/httpcommon-inl.h', - '<(libjingle_source)/talk/base/httpcommon.cc', - '<(libjingle_source)/talk/base/httpcommon.h', - '<(libjingle_source)/talk/base/httprequest.cc', - '<(libjingle_source)/talk/base/httprequest.h', - '<(libjingle_source)/talk/base/ifaddrs-android.cc', - '<(libjingle_source)/talk/base/ifaddrs-android.h', - '<(libjingle_source)/talk/base/ipaddress.cc', - '<(libjingle_source)/talk/base/ipaddress.h', - '<(libjingle_source)/talk/base/latebindingsymboltable.cc', - '<(libjingle_source)/talk/base/latebindingsymboltable.h', - '<(libjingle_source)/talk/base/linked_ptr.h', - '<(libjingle_source)/talk/base/linux.cc', - '<(libjingle_source)/talk/base/linux.h', - '<(libjingle_source)/talk/base/logging.cc', - '<(libjingle_source)/talk/base/logging.h', - '<(libjingle_source)/talk/base/maccocoathreadhelper.h', - '<(libjingle_source)/talk/base/maccocoathreadhelper.mm', - '<(libjingle_source)/talk/base/macconversion.cc', - '<(libjingle_source)/talk/base/macconversion.h', - '<(libjingle_source)/talk/base/macutils.cc', - '<(libjingle_source)/talk/base/macutils.h', - '<(libjingle_source)/talk/base/md5.cc', - '<(libjingle_source)/talk/base/md5.h', - '<(libjingle_source)/talk/base/md5digest.h', - '<(libjingle_source)/talk/base/messagedigest.cc', - '<(libjingle_source)/talk/base/messagedigest.h', - '<(libjingle_source)/talk/base/messagehandler.cc', - '<(libjingle_source)/talk/base/messagehandler.h', - '<(libjingle_source)/talk/base/messagequeue.cc', - '<(libjingle_source)/talk/base/messagequeue.h', - '<(libjingle_source)/talk/base/move.h', - '<(libjingle_source)/talk/base/nethelpers.cc', - '<(libjingle_source)/talk/base/nethelpers.h', - '<(libjingle_source)/talk/base/network.cc', - '<(libjingle_source)/talk/base/network.h', - '<(libjingle_source)/talk/base/nssidentity.cc', - '<(libjingle_source)/talk/base/nssidentity.h', - '<(libjingle_source)/talk/base/nssstreamadapter.cc', - '<(libjingle_source)/talk/base/nssstreamadapter.h', - '<(libjingle_source)/talk/base/nullsocketserver.h', - '<(libjingle_source)/talk/base/openssladapter.cc', - '<(libjingle_source)/talk/base/openssldigest.cc', - '<(libjingle_source)/talk/base/opensslidentity.cc', - '<(libjingle_source)/talk/base/opensslstreamadapter.cc', - '<(libjingle_source)/talk/base/pathutils.cc', - '<(libjingle_source)/talk/base/pathutils.h', - '<(libjingle_source)/talk/base/physicalsocketserver.cc', - '<(libjingle_source)/talk/base/physicalsocketserver.h', - '<(libjingle_source)/talk/base/proxydetect.cc', - '<(libjingle_source)/talk/base/proxydetect.h', - '<(libjingle_source)/talk/base/proxyinfo.cc', - '<(libjingle_source)/talk/base/proxyinfo.h', - '<(libjingle_source)/talk/base/ratelimiter.cc', - '<(libjingle_source)/talk/base/ratelimiter.h', - '<(libjingle_source)/talk/base/ratetracker.cc', - '<(libjingle_source)/talk/base/ratetracker.h', - '<(libjingle_source)/talk/base/schanneladapter.cc', - '<(libjingle_source)/talk/base/schanneladapter.h', - '<(libjingle_source)/talk/base/scoped_autorelease_pool.h', - '<(libjingle_source)/talk/base/scoped_autorelease_pool.mm', - '<(libjingle_source)/talk/base/scoped_ptr.h', - '<(libjingle_source)/talk/base/sec_buffer.h', - '<(libjingle_source)/talk/base/sha1.cc', - '<(libjingle_source)/talk/base/sha1.h', - '<(libjingle_source)/talk/base/sha1digest.h', - '<(libjingle_source)/talk/base/signalthread.cc', - '<(libjingle_source)/talk/base/signalthread.h', - '<(libjingle_source)/talk/base/sigslot.h', - '<(libjingle_source)/talk/base/sigslotrepeater.h', - '<(libjingle_source)/talk/base/socket.h', - '<(libjingle_source)/talk/base/socketadapters.cc', - '<(libjingle_source)/talk/base/socketadapters.h', - '<(libjingle_source)/talk/base/socketaddress.cc', - '<(libjingle_source)/talk/base/socketaddress.h', - '<(libjingle_source)/talk/base/socketaddresspair.cc', - '<(libjingle_source)/talk/base/socketaddresspair.h', - '<(libjingle_source)/talk/base/socketfactory.h', - '<(libjingle_source)/talk/base/socketpool.cc', - '<(libjingle_source)/talk/base/socketpool.h', - '<(libjingle_source)/talk/base/socketserver.h', - '<(libjingle_source)/talk/base/socketstream.cc', - '<(libjingle_source)/talk/base/socketstream.h', - '<(libjingle_source)/talk/base/ssladapter.cc', - '<(libjingle_source)/talk/base/ssladapter.h', - '<(libjingle_source)/talk/base/sslfingerprint.cc', - '<(libjingle_source)/talk/base/sslfingerprint.h', - '<(libjingle_source)/talk/base/sslidentity.cc', - '<(libjingle_source)/talk/base/sslidentity.h', - '<(libjingle_source)/talk/base/sslsocketfactory.cc', - '<(libjingle_source)/talk/base/sslsocketfactory.h', - '<(libjingle_source)/talk/base/sslstreamadapter.cc', - '<(libjingle_source)/talk/base/sslstreamadapter.h', - '<(libjingle_source)/talk/base/sslstreamadapterhelper.cc', - '<(libjingle_source)/talk/base/sslstreamadapterhelper.h', - '<(libjingle_source)/talk/base/stream.cc', - '<(libjingle_source)/talk/base/stream.h', - '<(libjingle_source)/talk/base/stringencode.cc', - '<(libjingle_source)/talk/base/stringencode.h', - '<(libjingle_source)/talk/base/stringutils.cc', - '<(libjingle_source)/talk/base/stringutils.h', - '<(libjingle_source)/talk/base/systeminfo.cc', - '<(libjingle_source)/talk/base/systeminfo.h', - '<(libjingle_source)/talk/base/task.cc', - '<(libjingle_source)/talk/base/task.h', - '<(libjingle_source)/talk/base/taskparent.cc', - '<(libjingle_source)/talk/base/taskparent.h', - '<(libjingle_source)/talk/base/taskrunner.cc', - '<(libjingle_source)/talk/base/taskrunner.h', - '<(libjingle_source)/talk/base/template_util.h', - '<(libjingle_source)/talk/base/thread.cc', - '<(libjingle_source)/talk/base/thread.h', - '<(libjingle_source)/talk/base/timeutils.cc', - '<(libjingle_source)/talk/base/timeutils.h', - '<(libjingle_source)/talk/base/timing.cc', - '<(libjingle_source)/talk/base/timing.h', - '<(libjingle_source)/talk/base/unixfilesystem.cc', - '<(libjingle_source)/talk/base/unixfilesystem.h', - '<(libjingle_source)/talk/base/urlencode.cc', - '<(libjingle_source)/talk/base/urlencode.h', - '<(libjingle_source)/talk/base/win32.cc', - '<(libjingle_source)/talk/base/win32.h', - '<(libjingle_source)/talk/base/win32filesystem.cc', - '<(libjingle_source)/talk/base/win32filesystem.h', - '<(libjingle_source)/talk/base/win32securityerrors.cc', - '<(libjingle_source)/talk/base/win32window.cc', - '<(libjingle_source)/talk/base/win32window.h', - '<(libjingle_source)/talk/base/winfirewall.cc', - '<(libjingle_source)/talk/base/winfirewall.h', - '<(libjingle_source)/talk/base/winping.cc', - '<(libjingle_source)/talk/base/winping.h', - '<(libjingle_source)/talk/base/worker.cc', - '<(libjingle_source)/talk/base/worker.h', '<(libjingle_source)/talk/p2p/base/asyncstuntcpsocket.cc', '<(libjingle_source)/talk/p2p/base/asyncstuntcpsocket.h', '<(libjingle_source)/talk/p2p/base/basicpacketsocketfactory.cc', @@ -314,40 +134,16 @@ ['exclude', '/unix[a-z]+\\.(h|cc)$'], ], }], - ['OS!="linux" or nacl_untrusted_build==1', { - 'sources!': [ - '<(libjingle_source)/talk/base/latebindingsymboltable.cc', - '<(libjingle_source)/talk/base/latebindingsymboltable.h', - ], - }], - ['(OS!="linux" and OS!="android") or nacl_untrusted_build==1', { - 'sources!': [ - '<(libjingle_source)/talk/base/linux.cc', - '<(libjingle_source)/talk/base/linux.h', - ], - }], ['(OS!="mac" and OS!="ios") or nacl_untrusted_build==1', { 'sources/': [ ['exclude', '/mac[a-z]+\\.(h|cc)$'], ['exclude', '/scoped_autorelease_pool\\.(h|mm)$'], ], }], - ['OS!="android" or nacl_untrusted_build==1', { - 'sources!': [ - '<(libjingle_source)/talk/base/ifaddrs-android.cc', - '<(libjingle_source)/talk/base/ifaddrs-android.h', - ], - }], ['use_openssl!=1', { 'sources/': [ ['exclude', '/openssl[a-z]+\\.(h|cc)$'], ], }], - ['nacl_untrusted_build==1', { - 'sources!': [ - '<(libjingle_source)/talk/base/systeminfo.cc', - '<(libjingle_source)/talk/base/systeminfo.h', - ], - }], ], } diff --git a/third_party/libjingle/libjingle_nacl.gyp b/third_party/libjingle/libjingle_nacl.gyp index 8b1b498..03f6383 100644 --- a/third_party/libjingle/libjingle_nacl.gyp +++ b/third_party/libjingle/libjingle_nacl.gyp @@ -5,6 +5,7 @@ { 'variables': { 'libjingle_source': "source", + 'webrtc_base': "../webrtc/base", }, 'includes': [ '../../native_client/build/untrusted.gypi', @@ -36,6 +37,7 @@ 'NO_MAIN_THREAD_WRAPPING', 'NO_SOUND_SYSTEM', 'POSIX', + 'WEBRTC_POSIX', 'SRTP_RELATIVE_PATH', 'SSL_USE_OPENSSL', 'USE_WEBRTC_DEV_BRANCH', @@ -52,13 +54,200 @@ }, 'include_dirs': [ './<(libjingle_source)', + '../', ], 'includes': ['libjingle_common.gypi', ], + 'sources': [ + '<(webrtc_base)/asyncfile.cc', + '<(webrtc_base)/asyncfile.h', + '<(webrtc_base)/asynchttprequest.cc', + '<(webrtc_base)/asynchttprequest.h', + '<(webrtc_base)/asyncpacketsocket.h', + '<(webrtc_base)/asyncsocket.cc', + '<(webrtc_base)/asyncsocket.h', + '<(webrtc_base)/asynctcpsocket.cc', + '<(webrtc_base)/asynctcpsocket.h', + '<(webrtc_base)/asyncudpsocket.cc', + '<(webrtc_base)/asyncudpsocket.h', + '<(webrtc_base)/autodetectproxy.cc', + '<(webrtc_base)/autodetectproxy.h', + '<(webrtc_base)/base64.cc', + '<(webrtc_base)/base64.h', + '<(webrtc_base)/basicdefs.h', + '<(webrtc_base)/bytebuffer.cc', + '<(webrtc_base)/bytebuffer.h', + '<(webrtc_base)/byteorder.h', + '<(webrtc_base)/checks.cc', + '<(webrtc_base)/checks.h', + '<(webrtc_base)/common.cc', + '<(webrtc_base)/common.h', + '<(webrtc_base)/compile_assert.h', + '<(webrtc_base)/cpumonitor.cc', + '<(webrtc_base)/cpumonitor.h', + '<(webrtc_base)/crc32.cc', + '<(webrtc_base)/crc32.h', + '<(webrtc_base)/criticalsection.h', + '<(webrtc_base)/cryptstring.h', + '<(webrtc_base)/diskcache.cc', + '<(webrtc_base)/diskcache.h', + '<(webrtc_base)/dscp.h', + '<(webrtc_base)/event.cc', + '<(webrtc_base)/event.h', + '<(webrtc_base)/fileutils.cc', + '<(webrtc_base)/fileutils.h', + '<(webrtc_base)/firewallsocketserver.cc', + '<(webrtc_base)/firewallsocketserver.h', + '<(webrtc_base)/flags.cc', + '<(webrtc_base)/flags.h', + '<(webrtc_base)/helpers.cc', + '<(webrtc_base)/helpers.h', + '<(webrtc_base)/httpbase.cc', + '<(webrtc_base)/httpbase.h', + '<(webrtc_base)/httpclient.cc', + '<(webrtc_base)/httpclient.h', + '<(webrtc_base)/httpcommon-inl.h', + '<(webrtc_base)/httpcommon.cc', + '<(webrtc_base)/httpcommon.h', + '<(webrtc_base)/httprequest.cc', + '<(webrtc_base)/httprequest.h', + '<(webrtc_base)/ipaddress.cc', + '<(webrtc_base)/ipaddress.h', + '<(webrtc_base)/linked_ptr.h', + '<(webrtc_base)/logging.cc', + '<(webrtc_base)/logging.h', + '<(webrtc_base)/maccocoathreadhelper.h', + '<(webrtc_base)/maccocoathreadhelper.mm', + '<(webrtc_base)/macconversion.cc', + '<(webrtc_base)/macconversion.h', + '<(webrtc_base)/macutils.cc', + '<(webrtc_base)/macutils.h', + '<(webrtc_base)/md5.cc', + '<(webrtc_base)/md5.h', + '<(webrtc_base)/md5digest.h', + '<(webrtc_base)/messagedigest.cc', + '<(webrtc_base)/messagedigest.h', + '<(webrtc_base)/messagehandler.cc', + '<(webrtc_base)/messagehandler.h', + '<(webrtc_base)/messagequeue.cc', + '<(webrtc_base)/messagequeue.h', + '<(webrtc_base)/move.h', + '<(webrtc_base)/nethelpers.cc', + '<(webrtc_base)/nethelpers.h', + '<(webrtc_base)/network.cc', + '<(webrtc_base)/network.h', + '<(webrtc_base)/nssidentity.cc', + '<(webrtc_base)/nssidentity.h', + '<(webrtc_base)/nssstreamadapter.cc', + '<(webrtc_base)/nssstreamadapter.h', + '<(webrtc_base)/nullsocketserver.h', + '<(webrtc_base)/openssladapter.cc', + '<(webrtc_base)/openssldigest.cc', + '<(webrtc_base)/opensslidentity.cc', + '<(webrtc_base)/opensslstreamadapter.cc', + '<(webrtc_base)/pathutils.cc', + '<(webrtc_base)/pathutils.h', + '<(webrtc_base)/physicalsocketserver.cc', + '<(webrtc_base)/physicalsocketserver.h', + '<(webrtc_base)/proxydetect.cc', + '<(webrtc_base)/proxydetect.h', + '<(webrtc_base)/proxyinfo.cc', + '<(webrtc_base)/proxyinfo.h', + '<(webrtc_base)/ratelimiter.cc', + '<(webrtc_base)/ratelimiter.h', + '<(webrtc_base)/ratetracker.cc', + '<(webrtc_base)/ratetracker.h', + '<(webrtc_base)/schanneladapter.cc', + '<(webrtc_base)/schanneladapter.h', + '<(webrtc_base)/scoped_autorelease_pool.h', + '<(webrtc_base)/scoped_autorelease_pool.mm', + '<(webrtc_base)/scoped_ptr.h', + '<(webrtc_base)/sec_buffer.h', + '<(webrtc_base)/sha1.cc', + '<(webrtc_base)/sha1.h', + '<(webrtc_base)/sha1digest.h', + '<(webrtc_base)/signalthread.cc', + '<(webrtc_base)/signalthread.h', + '<(webrtc_base)/sigslot.h', + '<(webrtc_base)/sigslotrepeater.h', + '<(webrtc_base)/socket.h', + '<(webrtc_base)/socketadapters.cc', + '<(webrtc_base)/socketadapters.h', + '<(webrtc_base)/socketaddress.cc', + '<(webrtc_base)/socketaddress.h', + '<(webrtc_base)/socketaddresspair.cc', + '<(webrtc_base)/socketaddresspair.h', + '<(webrtc_base)/socketfactory.h', + '<(webrtc_base)/socketpool.cc', + '<(webrtc_base)/socketpool.h', + '<(webrtc_base)/socketserver.h', + '<(webrtc_base)/socketstream.cc', + '<(webrtc_base)/socketstream.h', + '<(webrtc_base)/ssladapter.cc', + '<(webrtc_base)/ssladapter.h', + '<(webrtc_base)/sslfingerprint.cc', + '<(webrtc_base)/sslfingerprint.h', + '<(webrtc_base)/sslidentity.cc', + '<(webrtc_base)/sslidentity.h', + '<(webrtc_base)/sslsocketfactory.cc', + '<(webrtc_base)/sslsocketfactory.h', + '<(webrtc_base)/sslstreamadapter.cc', + '<(webrtc_base)/sslstreamadapter.h', + '<(webrtc_base)/sslstreamadapterhelper.cc', + '<(webrtc_base)/sslstreamadapterhelper.h', + '<(webrtc_base)/stream.cc', + '<(webrtc_base)/stream.h', + '<(webrtc_base)/stringencode.cc', + '<(webrtc_base)/stringencode.h', + '<(webrtc_base)/stringutils.cc', + '<(webrtc_base)/stringutils.h', + '<(webrtc_base)/task.cc', + '<(webrtc_base)/task.h', + '<(webrtc_base)/taskparent.cc', + '<(webrtc_base)/taskparent.h', + '<(webrtc_base)/taskrunner.cc', + '<(webrtc_base)/taskrunner.h', + '<(webrtc_base)/template_util.h', + '<(webrtc_base)/thread.cc', + '<(webrtc_base)/thread.h', + '<(webrtc_base)/timeutils.cc', + '<(webrtc_base)/timeutils.h', + '<(webrtc_base)/timing.cc', + '<(webrtc_base)/timing.h', + '<(webrtc_base)/unixfilesystem.cc', + '<(webrtc_base)/unixfilesystem.h', + '<(webrtc_base)/urlencode.cc', + '<(webrtc_base)/urlencode.h', + '<(webrtc_base)/win32.cc', + '<(webrtc_base)/win32.h', + '<(webrtc_base)/win32filesystem.cc', + '<(webrtc_base)/win32filesystem.h', + '<(webrtc_base)/win32securityerrors.cc', + '<(webrtc_base)/win32window.cc', + '<(webrtc_base)/win32window.h', + '<(webrtc_base)/winfirewall.cc', + '<(webrtc_base)/winfirewall.h', + '<(webrtc_base)/winping.cc', + '<(webrtc_base)/winping.h', + '<(webrtc_base)/worker.cc', + '<(webrtc_base)/worker.h', + ], 'sources!': [ # Compiled as part of libjingle_p2p_constants_nacl. '<(libjingle_source)/talk/p2p/base/constants.cc', '<(libjingle_source)/talk/p2p/base/constants.h', ], + 'sources/': [ + ['exclude', '/mac[a-z]+\\.(h|cc)$'], + ['exclude', '/scoped_autorelease_pool\\.(h|mm)$'], + ], + 'conditions': [ + ['OS!="win"', { + 'sources/': [ + ['exclude', '/win[a-z0-9]+\\.(h|cc)$'], + ['exclude', '/schanneladapter\\.(h|cc)$'], + ], + }], + ], 'direct_dependent_settings': { 'include_dirs': [ './overrides', @@ -74,6 +263,7 @@ 'NO_MAIN_THREAD_WRAPPING', 'NO_SOUND_SYSTEM', 'POSIX', + 'WEBRTC_POSIX', 'SRTP_RELATIVE_PATH', 'SSL_USE_OPENSSL', 'USE_WEBRTC_DEV_BRANCH', diff --git a/third_party/libjingle/overrides/init_webrtc.cc b/third_party/libjingle/overrides/init_webrtc.cc index 5c356ab..e11f78d 100644 --- a/third_party/libjingle/overrides/init_webrtc.cc +++ b/third_party/libjingle/overrides/init_webrtc.cc @@ -11,8 +11,8 @@ #include "base/metrics/field_trial.h" #include "base/native_library.h" #include "base/path_service.h" -#include "talk/base/basictypes.h" -#include "third_party/libjingle/overrides/talk/base/logging.h" +#include "webrtc/base/basictypes.h" +#include "webrtc/base/logging.h" const unsigned char* GetCategoryGroupEnabled(const char* category_group) { return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group); @@ -136,7 +136,7 @@ bool InitializeWebRtcModule() { &init_diagnostic_logging); if (init_ok) - talk_base::SetExtraLoggingInit(init_diagnostic_logging); + rtc::SetExtraLoggingInit(init_diagnostic_logging); return init_ok; } diff --git a/third_party/libjingle/overrides/init_webrtc.h b/third_party/libjingle/overrides/init_webrtc.h index 175c067..c5c190c 100644 --- a/third_party/libjingle/overrides/init_webrtc.h +++ b/third_party/libjingle/overrides/init_webrtc.h @@ -5,6 +5,8 @@ #ifndef THIRD_PARTY_LIBJINGLE_OVERRIDES_INIT_WEBRTC_H_ #define THIRD_PARTY_LIBJINGLE_OVERRIDES_INIT_WEBRTC_H_ +#include <string> + #include "allocator_shim/allocator_stub.h" #include "base/logging.h" #include "third_party/webrtc/system_wrappers/interface/event_tracer.h" diff --git a/third_party/libjingle/overrides/initialize_module.cc b/third_party/libjingle/overrides/initialize_module.cc index c7ef382..ce11567 100644 --- a/third_party/libjingle/overrides/initialize_module.cc +++ b/third_party/libjingle/overrides/initialize_module.cc @@ -7,9 +7,9 @@ #include "base/files/file_path.h" #include "base/logging.h" #include "init_webrtc.h" -#include "talk/base/basictypes.h" #include "talk/media/webrtc/webrtcmediaengine.h" -#include "third_party/libjingle/overrides/talk/base/logging.h" +#include "webrtc/base/basictypes.h" +#include "webrtc/base/logging.h" #if !defined(LIBPEERCONNECTION_IMPLEMENTATION) || defined(LIBPEERCONNECTION_LIB) #error "Only compile the allocator proxy with the shared_library implementation" @@ -81,7 +81,7 @@ bool InitializeModule(const CommandLine& command_line, *create_media_engine = &CreateWebRtcMediaEngine; *destroy_media_engine = &DestroyWebRtcMediaEngine; - *init_diagnostic_logging = &talk_base::InitDiagnosticLoggingDelegateFunction; + *init_diagnostic_logging = &rtc::InitDiagnosticLoggingDelegateFunction; if (CommandLine::Init(0, NULL)) { #if !defined(OS_WIN) diff --git a/third_party/libjingle/overrides/talk/base/basictypes.h b/third_party/libjingle/overrides/talk/base/basictypes.h deleted file mode 100644 index d14eee5..0000000 --- a/third_party/libjingle/overrides/talk/base/basictypes.h +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2014 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 overrides the inclusion of talk/base/basictypes.h to remove -// collisions with Chromium's base/basictypes.h. We then add back a few -// items that Chromium's version doesn't provide, but libjingle expects. - -#ifndef OVERRIDES_TALK_BASE_BASICTYPES_H__ -#define OVERRIDES_TALK_BASE_BASICTYPES_H__ - -#include "base/basictypes.h" -#include "build/build_config.h" - -#ifndef INT_TYPES_DEFINED -#define INT_TYPES_DEFINED - -#ifdef COMPILER_MSVC -#if _MSC_VER >= 1600 -#include <stdint.h> -#else -typedef unsigned __int64 uint64; -typedef __int64 int64; -#endif -#ifndef INT64_C -#define INT64_C(x) x ## I64 -#endif -#ifndef UINT64_C -#define UINT64_C(x) x ## UI64 -#endif -#define INT64_F "I64" -#else // COMPILER_MSVC -#ifndef INT64_C -#define INT64_C(x) x ## LL -#endif -#ifndef UINT64_C -#define UINT64_C(x) x ## ULL -#endif -#ifndef INT64_F -#define INT64_F "ll" -#endif -#endif // COMPILER_MSVC -#endif // INT_TYPES_DEFINED - -// Detect compiler is for x86 or x64. -#if defined(__x86_64__) || defined(_M_X64) || \ - defined(__i386__) || defined(_M_IX86) -#define CPU_X86 1 -#endif -// Detect compiler is for arm. -#if defined(__arm__) || defined(_M_ARM) -#define CPU_ARM 1 -#endif -#if defined(CPU_X86) && defined(CPU_ARM) -#error CPU_X86 and CPU_ARM both defined. -#endif -#if !defined(ARCH_CPU_BIG_ENDIAN) && !defined(ARCH_CPU_LITTLE_ENDIAN) -// x86, arm or GCC provided __BYTE_ORDER__ macros -#if CPU_X86 || CPU_ARM || \ - (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) -#define ARCH_CPU_LITTLE_ENDIAN -#elif defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#define ARCH_CPU_BIG_ENDIAN -#else -#error ARCH_CPU_BIG_ENDIAN or ARCH_CPU_LITTLE_ENDIAN should be defined. -#endif -#endif -#if defined(ARCH_CPU_BIG_ENDIAN) && defined(ARCH_CPU_LITTLE_ENDIAN) -#error ARCH_CPU_BIG_ENDIAN and ARCH_CPU_LITTLE_ENDIAN both defined. -#endif - -#ifdef WIN32 -typedef int socklen_t; -#endif - -namespace talk_base { -template<class T> inline T _min(T a, T b) { return (a > b) ? b : a; } -template<class T> inline T _max(T a, T b) { return (a < b) ? b : a; } - -// For wait functions that take a number of milliseconds, kForever indicates -// unlimited time. -const int kForever = -1; -} - -#ifdef WIN32 -#if _MSC_VER < 1700 - #define alignof(t) __alignof(t) -#endif -#else // !WIN32 -#define alignof(t) __alignof__(t) -#endif // !WIN32 -#define IS_ALIGNED(p, a) (0==(reinterpret_cast<uintptr_t>(p) & ((a)-1))) -#define ALIGNP(p, t) \ - (reinterpret_cast<uint8*>(((reinterpret_cast<uintptr_t>(p) + \ - ((t)-1)) & ~((t)-1)))) - -// LIBJINGLE_DEFINE_STATIC_LOCAL() is a libjingle's copy -// of CR_DEFINE_STATIC_LOCAL(). -#define LIBJINGLE_DEFINE_STATIC_LOCAL(type, name, arguments) \ - CR_DEFINE_STATIC_LOCAL(type, name, arguments) - -#endif // OVERRIDES_TALK_BASE_BASICTYPES_H__ diff --git a/third_party/libjingle/overrides/talk/base/constructormagic.h b/third_party/libjingle/overrides/talk/base/constructormagic.h deleted file mode 100644 index 7f1294d..0000000 --- a/third_party/libjingle/overrides/talk/base/constructormagic.h +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2014 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 overrides the inclusion of talk/base/constructormagic.h -// We do this because constructor magic defines DISALLOW_EVIL_CONSTRUCTORS, -// but we want to use the version from Chromium. - -#ifndef OVERRIDES_TALK_BASE_CONSTRUCTORMAGIC_H__ -#define OVERRIDES_TALK_BASE_CONSTRUCTORMAGIC_H__ - -#include "base/basictypes.h" - -#endif // OVERRIDES_TALK_BASE_CONSTRUCTORMAGIC_H__ diff --git a/third_party/libjingle/overrides/talk/base/logging.cc b/third_party/libjingle/overrides/talk/base/logging.cc deleted file mode 100644 index 799d60c..0000000 --- a/third_party/libjingle/overrides/talk/base/logging.cc +++ /dev/null @@ -1,311 +0,0 @@ -// Copyright 2014 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 "third_party/libjingle/overrides/talk/base/logging.h" - -#if defined(OS_MACOSX) && !defined(OS_IOS) -#include <CoreServices/CoreServices.h> -#endif // OS_MACOSX - -#include <iomanip> - -#include "base/atomicops.h" -#include "base/strings/string_util.h" -#include "base/threading/platform_thread.h" -#include "third_party/libjingle/source/talk/base/ipaddress.h" -#include "third_party/libjingle/source/talk/base/stream.h" -#include "third_party/libjingle/source/talk/base/stringencode.h" -#include "third_party/libjingle/source/talk/base/stringutils.h" -#include "third_party/libjingle/source/talk/base/timeutils.h" - -// From this file we can't use VLOG since it expands into usage of the __FILE__ -// macro (for correct filtering). The actual logging call from DIAGNOSTIC_LOG in -// ~DiagnosticLogMessage. Note that the second parameter to the LAZY_STREAM -// macro is true since the filter check has already been done for -// DIAGNOSTIC_LOG. -#define LOG_LAZY_STREAM_DIRECT(file_name, line_number, sev) \ - LAZY_STREAM(logging::LogMessage(file_name, line_number, \ - -sev).stream(), true) - -namespace talk_base { - -void (*g_logging_delegate_function)(const std::string&) = NULL; -void (*g_extra_logging_init_function)( - void (*logging_delegate_function)(const std::string&)) = NULL; -#ifndef NDEBUG -COMPILE_ASSERT(sizeof(base::subtle::Atomic32) == sizeof(base::PlatformThreadId), - atomic32_not_same_size_as_platformthreadid); -base::subtle::Atomic32 g_init_logging_delegate_thread_id = 0; -#endif - -///////////////////////////////////////////////////////////////////////////// -// Constant Labels -///////////////////////////////////////////////////////////////////////////// - -const char* FindLabel(int value, const ConstantLabel entries[]) { - for (int i = 0; entries[i].label; ++i) { - if (value == entries[i].value) return entries[i].label; - } - return 0; -} - -std::string ErrorName(int err, const ConstantLabel* err_table) { - if (err == 0) - return "No error"; - - if (err_table != 0) { - if (const char * value = FindLabel(err, err_table)) - return value; - } - - char buffer[16]; - base::snprintf(buffer, sizeof(buffer), "0x%08x", err); - return buffer; -} - -///////////////////////////////////////////////////////////////////////////// -// Log helper functions -///////////////////////////////////////////////////////////////////////////// - -// Generates extra information for LOG_E. -static std::string GenerateExtra(LogErrorContext err_ctx, - int err, - const char* module) { - if (err_ctx != ERRCTX_NONE) { - std::ostringstream tmp; - tmp << ": "; - tmp << "[0x" << std::setfill('0') << std::hex << std::setw(8) << err << "]"; - switch (err_ctx) { - case ERRCTX_ERRNO: - tmp << " " << strerror(err); - break; -#if defined(OS_WIN) - case ERRCTX_HRESULT: { - char msgbuf[256]; - DWORD flags = FORMAT_MESSAGE_FROM_SYSTEM; - HMODULE hmod = GetModuleHandleA(module); - if (hmod) - flags |= FORMAT_MESSAGE_FROM_HMODULE; - if (DWORD len = FormatMessageA( - flags, hmod, err, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - msgbuf, sizeof(msgbuf) / sizeof(msgbuf[0]), NULL)) { - while ((len > 0) && - isspace(static_cast<unsigned char>(msgbuf[len-1]))) { - msgbuf[--len] = 0; - } - tmp << " " << msgbuf; - } - break; - } -#endif // OS_WIN -#if defined(OS_IOS) - case ERRCTX_OSSTATUS: - tmp << " " << "Unknown LibJingle error: " << err; - break; -#elif defined(OS_MACOSX) - case ERRCTX_OSSTATUS: { - tmp << " " << nonnull(GetMacOSStatusErrorString(err), "Unknown error"); - if (const char* desc = GetMacOSStatusCommentString(err)) { - tmp << ": " << desc; - } - break; - } -#endif // OS_MACOSX - default: - break; - } - return tmp.str(); - } - return ""; -} - -DiagnosticLogMessage::DiagnosticLogMessage(const char* file, - int line, - LoggingSeverity severity, - bool log_to_chrome, - LogErrorContext err_ctx, - int err) - : file_name_(file), - line_(line), - severity_(severity), - log_to_chrome_(log_to_chrome) { - extra_ = GenerateExtra(err_ctx, err, NULL); -} - -DiagnosticLogMessage::DiagnosticLogMessage(const char* file, - int line, - LoggingSeverity severity, - bool log_to_chrome, - LogErrorContext err_ctx, - int err, - const char* module) - : file_name_(file), - line_(line), - severity_(severity), - log_to_chrome_(log_to_chrome) { - extra_ = GenerateExtra(err_ctx, err, module); -} - -DiagnosticLogMessage::~DiagnosticLogMessage() { - print_stream_ << extra_; - const std::string& str = print_stream_.str(); - if (log_to_chrome_) - LOG_LAZY_STREAM_DIRECT(file_name_, line_, severity_) << str; - if (g_logging_delegate_function && severity_ <= LS_INFO) { - g_logging_delegate_function(str); - } -} - -// Note: this function is a copy from the overriden libjingle implementation. -void LogMultiline(LoggingSeverity level, const char* label, bool input, - const void* data, size_t len, bool hex_mode, - LogMultilineState* state) { - if (!LOG_CHECK_LEVEL_V(level)) - return; - - const char * direction = (input ? " << " : " >> "); - - // NULL data means to flush our count of unprintable characters. - if (!data) { - if (state && state->unprintable_count_[input]) { - LOG_V(level) << label << direction << "## " - << state->unprintable_count_[input] - << " consecutive unprintable ##"; - state->unprintable_count_[input] = 0; - } - return; - } - - // The ctype classification functions want unsigned chars. - const unsigned char* udata = static_cast<const unsigned char*>(data); - - if (hex_mode) { - const size_t LINE_SIZE = 24; - char hex_line[LINE_SIZE * 9 / 4 + 2], asc_line[LINE_SIZE + 1]; - while (len > 0) { - memset(asc_line, ' ', sizeof(asc_line)); - memset(hex_line, ' ', sizeof(hex_line)); - size_t line_len = _min(len, LINE_SIZE); - for (size_t i = 0; i < line_len; ++i) { - unsigned char ch = udata[i]; - asc_line[i] = isprint(ch) ? ch : '.'; - hex_line[i*2 + i/4] = hex_encode(ch >> 4); - hex_line[i*2 + i/4 + 1] = hex_encode(ch & 0xf); - } - asc_line[sizeof(asc_line)-1] = 0; - hex_line[sizeof(hex_line)-1] = 0; - LOG_V(level) << label << direction - << asc_line << " " << hex_line << " "; - udata += line_len; - len -= line_len; - } - return; - } - - size_t consecutive_unprintable = state ? state->unprintable_count_[input] : 0; - - const unsigned char* end = udata + len; - while (udata < end) { - const unsigned char* line = udata; - const unsigned char* end_of_line = strchrn<unsigned char>(udata, - end - udata, - '\n'); - if (!end_of_line) { - udata = end_of_line = end; - } else { - udata = end_of_line + 1; - } - - bool is_printable = true; - - // If we are in unprintable mode, we need to see a line of at least - // kMinPrintableLine characters before we'll switch back. - const ptrdiff_t kMinPrintableLine = 4; - if (consecutive_unprintable && ((end_of_line - line) < kMinPrintableLine)) { - is_printable = false; - } else { - // Determine if the line contains only whitespace and printable - // characters. - bool is_entirely_whitespace = true; - for (const unsigned char* pos = line; pos < end_of_line; ++pos) { - if (isspace(*pos)) - continue; - is_entirely_whitespace = false; - if (!isprint(*pos)) { - is_printable = false; - break; - } - } - // Treat an empty line following unprintable data as unprintable. - if (consecutive_unprintable && is_entirely_whitespace) { - is_printable = false; - } - } - if (!is_printable) { - consecutive_unprintable += (udata - line); - continue; - } - // Print out the current line, but prefix with a count of prior unprintable - // characters. - if (consecutive_unprintable) { - LOG_V(level) << label << direction << "## " << consecutive_unprintable - << " consecutive unprintable ##"; - consecutive_unprintable = 0; - } - // Strip off trailing whitespace. - while ((end_of_line > line) && isspace(*(end_of_line-1))) { - --end_of_line; - } - // Filter out any private data - std::string substr(reinterpret_cast<const char*>(line), end_of_line - line); - std::string::size_type pos_private = substr.find("Email"); - if (pos_private == std::string::npos) { - pos_private = substr.find("Passwd"); - } - if (pos_private == std::string::npos) { - LOG_V(level) << label << direction << substr; - } else { - LOG_V(level) << label << direction << "## omitted for privacy ##"; - } - } - - if (state) { - state->unprintable_count_[input] = consecutive_unprintable; - } -} - -void InitDiagnosticLoggingDelegateFunction( - void (*delegate)(const std::string&)) { -#ifndef NDEBUG - // Ensure that this function is always called from the same thread. - base::subtle::NoBarrier_CompareAndSwap(&g_init_logging_delegate_thread_id, 0, - static_cast<base::subtle::Atomic32>(base::PlatformThread::CurrentId())); - DCHECK_EQ(g_init_logging_delegate_thread_id, - base::PlatformThread::CurrentId()); -#endif - CHECK(delegate); - // This function may be called with the same argument several times if the - // page is reloaded or there are several PeerConnections on one page with - // logging enabled. This is OK, we simply don't have to do anything. - if (delegate == g_logging_delegate_function) - return; - CHECK(!g_logging_delegate_function); -#ifdef NDEBUG - IPAddress::set_strip_sensitive(true); -#endif - g_logging_delegate_function = delegate; - - if (g_extra_logging_init_function) - g_extra_logging_init_function(delegate); -} - -void SetExtraLoggingInit( - void (*function)(void (*delegate)(const std::string&))) { - CHECK(function); - CHECK(!g_extra_logging_init_function); - g_extra_logging_init_function = function; -} - -} // namespace talk_base diff --git a/third_party/libjingle/overrides/talk/base/logging.h b/third_party/libjingle/overrides/talk/base/logging.h deleted file mode 100644 index 3f20a0a..0000000 --- a/third_party/libjingle/overrides/talk/base/logging.h +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright 2014 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 overrides the logging macros in libjingle (talk/base/logging.h). -// Instead of using libjingle's logging implementation, the libjingle macros are -// mapped to the corresponding base/logging.h macro (chromium's VLOG). -// If this file is included outside of libjingle (e.g. in wrapper code) it -// should be included after base/logging.h (if any) or compiler error or -// unexpected behavior may occur (macros that have the same name in libjingle as -// in chromium will use the libjingle definition if this file is included -// first). - -// Setting the LoggingSeverity (and lower) that should be written to file should -// be done via command line by specifying the flags: -// --vmodule or --v please see base/logging.h for details on how to use them. -// Specifying what file to write to is done using InitLogging also in -// base/logging.h. - -// The macros and classes declared in here are not described as they are -// NOT TO BE USED outside of libjingle. - -#ifndef THIRD_PARTY_LIBJINGLE_OVERRIDES_TALK_BASE_LOGGING_H_ -#define THIRD_PARTY_LIBJINGLE_OVERRIDES_TALK_BASE_LOGGING_H_ - -#include <sstream> -#include <string> - -#include "base/logging.h" -#include "third_party/libjingle/source/talk/base/scoped_ref_ptr.h" - -namespace talk_base { - -/////////////////////////////////////////////////////////////////////////////// -// ConstantLabel can be used to easily generate string names from constant -// values. This can be useful for logging descriptive names of error messages. -// Usage: -// const ConstantLabel LIBRARY_ERRORS[] = { -// KLABEL(SOME_ERROR), -// KLABEL(SOME_OTHER_ERROR), -// ... -// LASTLABEL -// } -// -// int err = LibraryFunc(); -// LOG(LS_ERROR) << "LibraryFunc returned: " -// << ErrorName(err, LIBRARY_ERRORS); - -struct ConstantLabel { - int value; - const char* label; -}; -#define KLABEL(x) { x, #x } -#define LASTLABEL { 0, 0 } - -const char* FindLabel(int value, const ConstantLabel entries[]); -std::string ErrorName(int err, const ConstantLabel* err_table); - -////////////////////////////////////////////////////////////////////// -// Note that the non-standard LoggingSeverity aliases exist because they are -// still in broad use. The meanings of the levels are: -// LS_SENSITIVE: Information which should only be logged with the consent -// of the user, due to privacy concerns. -// LS_VERBOSE: This level is for data which we do not want to appear in the -// normal debug log, but should appear in diagnostic logs. -// LS_INFO: Chatty level used in debugging for all sorts of things, the default -// in debug builds. -// LS_WARNING: Something that may warrant investigation. -// LS_ERROR: Something that should not have occurred. -// Note that LoggingSeverity is mapped over to chromiums verbosity levels where -// anything lower than or equal to the current verbosity level is written to -// file which is the opposite of logging severity in libjingle where higher -// severity numbers than or equal to the current severity level are written to -// file. Also, note that the values are explicitly defined here for convenience -// since the command line flag must be set using numerical values. -enum LoggingSeverity { LS_ERROR = 1, - LS_WARNING = 2, - LS_INFO = 3, - LS_VERBOSE = 4, - LS_SENSITIVE = 5, - INFO = LS_INFO, - WARNING = LS_WARNING, - LERROR = LS_ERROR }; - -// LogErrorContext assists in interpreting the meaning of an error value. -enum LogErrorContext { - ERRCTX_NONE, - ERRCTX_ERRNO, // System-local errno - ERRCTX_HRESULT, // Windows HRESULT - ERRCTX_OSSTATUS, // MacOS OSStatus - - // Abbreviations for LOG_E macro - ERRCTX_EN = ERRCTX_ERRNO, // LOG_E(sev, EN, x) - ERRCTX_HR = ERRCTX_HRESULT, // LOG_E(sev, HR, x) - ERRCTX_OS = ERRCTX_OSSTATUS, // LOG_E(sev, OS, x) -}; - -// Class that writes a log message to the logging delegate ("WebRTC logging -// stream" in Chrome) and to Chrome's logging stream. -class DiagnosticLogMessage { - public: - DiagnosticLogMessage(const char* file, int line, LoggingSeverity severity, - bool log_to_chrome, LogErrorContext err_ctx, int err); - DiagnosticLogMessage(const char* file, int line, LoggingSeverity severity, - bool log_to_chrome, LogErrorContext err_ctx, int err, - const char* module); - ~DiagnosticLogMessage(); - - void CreateTimestamp(); - - std::ostream& stream() { return print_stream_; } - - private: - const char* file_name_; - const int line_; - const LoggingSeverity severity_; - const bool log_to_chrome_; - - std::string extra_; - - std::ostringstream print_stream_; -}; - -// This class is used to explicitly ignore values in the conditional -// logging macros. This avoids compiler warnings like "value computed -// is not used" and "statement has no effect". -class LogMessageVoidify { - public: - LogMessageVoidify() { } - // This has to be an operator with a precedence lower than << but - // higher than ?: - void operator&(std::ostream&) { } -}; - -////////////////////////////////////////////////////////////////////// -// Logging Helpers -////////////////////////////////////////////////////////////////////// - -class LogMultilineState { - public: - size_t unprintable_count_[2]; - LogMultilineState() { - unprintable_count_[0] = unprintable_count_[1] = 0; - } -}; - -// When possible, pass optional state variable to track various data across -// multiple calls to LogMultiline. Otherwise, pass NULL. -void LogMultiline(LoggingSeverity level, const char* label, bool input, - const void* data, size_t len, bool hex_mode, - LogMultilineState* state); - -// TODO(grunell): Change name to InitDiagnosticLoggingDelegate or -// InitDiagnosticLogging. Change also in init_webrtc.h/cc. -// TODO(grunell): typedef the delegate function. -void InitDiagnosticLoggingDelegateFunction( - void (*delegate)(const std::string&)); - -void SetExtraLoggingInit( - void (*function)(void (*delegate)(const std::string&))); -} // namespace talk_base - -////////////////////////////////////////////////////////////////////// -// Libjingle macros which are mapped over to their VLOG equivalent in -// base/logging.h -////////////////////////////////////////////////////////////////////// - -#if defined(LOGGING_INSIDE_LIBJINGLE) - -#define DIAGNOSTIC_LOG(sev, ctx, err, ...) \ - talk_base::DiagnosticLogMessage( \ - __FILE__, __LINE__, sev, VLOG_IS_ON(sev), \ - talk_base::ERRCTX_ ## ctx, err, ##__VA_ARGS__).stream() - -#define LOG_CHECK_LEVEL(sev) VLOG_IS_ON(talk_base::sev) -#define LOG_CHECK_LEVEL_V(sev) VLOG_IS_ON(sev) - -#define LOG_V(sev) DIAGNOSTIC_LOG(sev, NONE, 0) -#undef LOG -#define LOG(sev) DIAGNOSTIC_LOG(talk_base::sev, NONE, 0) - -// The _F version prefixes the message with the current function name. -#if defined(__GNUC__) && defined(_DEBUG) -#define LOG_F(sev) LOG(sev) << __PRETTY_FUNCTION__ << ": " -#else -#define LOG_F(sev) LOG(sev) << __FUNCTION__ << ": " -#endif - -#define LOG_E(sev, ctx, err, ...) \ - DIAGNOSTIC_LOG(talk_base::sev, ctx, err, ##__VA_ARGS__) - -#undef LOG_ERRNO_EX -#define LOG_ERRNO_EX(sev, err) LOG_E(sev, ERRNO, err) -#undef LOG_ERRNO -#define LOG_ERRNO(sev) LOG_ERRNO_EX(sev, errno) - -#if defined(OS_WIN) -#define LOG_GLE_EX(sev, err) LOG_E(sev, HRESULT, err) -#define LOG_GLE(sev) LOG_GLE_EX(sev, GetLastError()) -#define LOG_GLEM(sev, mod) LOG_E(sev, HRESULT, GetLastError(), mod) -#define LOG_ERR_EX(sev, err) LOG_GLE_EX(sev, err) -#define LOG_ERR(sev) LOG_GLE(sev) -#define LAST_SYSTEM_ERROR (::GetLastError()) -#else -#define LOG_ERR_EX(sev, err) LOG_ERRNO_EX(sev, err) -#define LOG_ERR(sev) LOG_ERRNO(sev) -#define LAST_SYSTEM_ERROR (errno) -#endif // OS_WIN - -#undef PLOG -#define PLOG(sev, err) LOG_ERR_EX(sev, err) - -#endif // LOGGING_INSIDE_LIBJINGLE - -#endif // THIRD_PARTY_LIBJINGLE_OVERRIDES_TALK_BASE_LOGGING_H_ diff --git a/third_party/libjingle/overrides/talk/base/win32socketinit.cc b/third_party/libjingle/overrides/talk/base/win32socketinit.cc deleted file mode 100644 index e8434f6..0000000 --- a/third_party/libjingle/overrides/talk/base/win32socketinit.cc +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2014 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. - -// Redirect Libjingle's winsock initialization activity into Chromium's -// singleton object that managest precisely that for the browser. - -#include "talk/base/win32socketinit.h" - -#include "net/base/winsock_init.h" - -#ifndef WIN32 -#error "Only compile this on Windows" -#endif - -namespace talk_base { - -void EnsureWinsockInit() { - net::EnsureWinsockInit(); -} - -} // namespace talk_base |