diff options
author | ronghuawu@chromium.org <ronghuawu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-31 22:19:46 +0000 |
---|---|---|
committer | ronghuawu@chromium.org <ronghuawu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-31 22:19:46 +0000 |
commit | bf45dff0ca703e5ad3bb6c6754ebdcb0c1b1296a (patch) | |
tree | c8f5b0600665f3597d8c036411f565b6ba79515e /remoting | |
parent | 00e1d2773de880b96aff7e2d33b2b0914778901f (diff) | |
download | chromium_src-bf45dff0ca703e5ad3bb6c6754ebdcb0c1b1296a.zip chromium_src-bf45dff0ca703e5ad3bb6c6754ebdcb0c1b1296a.tar.gz chromium_src-bf45dff0ca703e5ad3bb6c6754ebdcb0c1b1296a.tar.bz2 |
Update webrtc&libjingle 6774:6799.
BUG=N/A
R=hellner@chromium.org
TBR=darin@chromium.org, hclam@chromium.org, jochen@chromium.org, palmer@chromium.org, sergeyu@chromium.org, wez@chromium.org
Commit on behalf of hellner@. Original CL tried and approved in https://codereview.chromium.org/429113002/
Review URL: https://codereview.chromium.org/429253003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286902 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
31 files changed, 203 insertions, 200 deletions
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_; |