summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordcaiafa@chromium.org <dcaiafa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-17 06:26:33 +0000
committerdcaiafa@chromium.org <dcaiafa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-17 06:26:33 +0000
commit5c73592c918b4ef0c6c700f0ad2f1421890ad7c2 (patch)
tree188747a04f0547a90445a624f56f44f1c43af11c
parent965c489787d2ebea46636ee1c6b04ce173fad8e1 (diff)
downloadchromium_src-5c73592c918b4ef0c6c700f0ad2f1421890ad7c2.zip
chromium_src-5c73592c918b4ef0c6c700f0ad2f1421890ad7c2.tar.gz
chromium_src-5c73592c918b4ef0c6c700f0ad2f1421890ad7c2.tar.bz2
Fix host STUN. Use talk_base::AsyncResolver.
StunRequest requires the AsyncResolver object produced by the configured SocketFactory to resolve the address of the STUN server before it can send the STUN requests. ChromiumSocketFactory currently produces DummyAsyncResolver, which doesn't do any resolving. The fix is to provide Libjingle's talk_base::AsyncResolver. BUG=333958 Review URL: https://codereview.chromium.org/141083007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245437 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--remoting/jingle_glue/chromium_socket_factory.cc27
1 files changed, 2 insertions, 25 deletions
diff --git a/remoting/jingle_glue/chromium_socket_factory.cc b/remoting/jingle_glue/chromium_socket_factory.cc
index 12e911c..520dc8a 100644
--- a/remoting/jingle_glue/chromium_socket_factory.cc
+++ b/remoting/jingle_glue/chromium_socket_factory.cc
@@ -13,7 +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"
+#include "third_party/libjingle/source/talk/base/nethelpers.h"
namespace remoting {
@@ -35,29 +35,6 @@ 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();
@@ -398,7 +375,7 @@ ChromiumPacketSocketFactory::CreateClientTcpSocket(
talk_base::AsyncResolverInterface*
ChromiumPacketSocketFactory::CreateAsyncResolver() {
- return new DummyAsyncResolver();
+ return new talk_base::AsyncResolver();
}
} // namespace remoting