diff options
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/jingle_glue/chromium_socket_factory.cc | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/remoting/jingle_glue/chromium_socket_factory.cc b/remoting/jingle_glue/chromium_socket_factory.cc index 32e05af..cc599be 100644 --- a/remoting/jingle_glue/chromium_socket_factory.cc +++ b/remoting/jingle_glue/chromium_socket_factory.cc @@ -13,6 +13,7 @@ #include "net/base/net_errors.h" #include "net/udp/udp_server_socket.h" #include "third_party/libjingle/source/talk/base/asyncpacketsocket.h" +#include "third_party/libjingle/source/talk/base/asyncresolverinterface.h" namespace remoting { @@ -34,6 +35,29 @@ bool IsTransientError(int error) { error == net::ERR_ADDRESS_INVALID; } +// TODO(lambroslambrou): Move STUN/relay address resolution from +// PepperPortAllocator to this class. +class DummyAsyncResolver : public talk_base::AsyncResolverInterface { + public: + DummyAsyncResolver() {} + virtual ~DummyAsyncResolver() {} + virtual void Start(const talk_base::SocketAddress& addr) OVERRIDE {} + virtual bool GetResolvedAddress( + int family, + talk_base::SocketAddress* addr) const OVERRIDE { + return false; + } + virtual int GetError() const OVERRIDE { + return 0; + } + virtual void Destroy(bool wait) OVERRIDE { + delete this; + } + + private: + DISALLOW_COPY_AND_ASSIGN(DummyAsyncResolver); +}; + class UdpPacketSocket : public talk_base::AsyncPacketSocket { public: UdpPacketSocket(); @@ -373,8 +397,7 @@ ChromiumPacketSocketFactory::CreateClientTcpSocket( talk_base::AsyncResolverInterface* ChromiumPacketSocketFactory::CreateAsyncResolver() { - NOTREACHED(); - return NULL; + return new DummyAsyncResolver(); } } // namespace remoting |