Index: jingle/notifier/communicator/xmpp_connection_generator.cc |
diff --git a/jingle/notifier/communicator/xmpp_connection_generator.cc b/jingle/notifier/communicator/xmpp_connection_generator.cc |
index 5a234e7bc8df04bfecffcb1ab2efad9846cfbe6c..b19d16b8bf50a1675605d0fc9e74dd77b00722f6 100644 |
--- a/jingle/notifier/communicator/xmpp_connection_generator.cc |
+++ b/jingle/notifier/communicator/xmpp_connection_generator.cc |
@@ -20,6 +20,7 @@ |
#include <vector> |
+#include "base/bind.h" |
#include "base/callback.h" |
#include "base/compiler_specific.h" |
#include "base/logging.h" |
@@ -45,10 +46,6 @@ XmppConnectionGenerator::XmppConnectionGenerator( |
const ServerList& servers) |
: delegate_(delegate), |
host_resolver_(host_resolver), |
- resolve_callback_( |
- ALLOW_THIS_IN_INITIALIZER_LIST( |
- NewCallback(this, |
- &XmppConnectionGenerator::OnServerDNSResolved))), |
settings_list_(new ConnectionSettingsList()), |
settings_index_(0), |
servers_(servers), |
@@ -126,12 +123,13 @@ void XmppConnectionGenerator::UseNextConnection() { |
net::HostResolver::RequestInfo request_info(server); |
int status = |
host_resolver_.Resolve( |
- request_info, &address_list_, resolve_callback_.get(), |
+ request_info, &address_list_, |
+ base::Bind(&XmppConnectionGenerator::OnServerDNSResolved, |
+ base::Unretained(this)), |
bound_net_log_); |
- if (status == net::ERR_IO_PENDING) { |
- // resolve_callback_ will call us when it's called. |
+ if (status == net::ERR_IO_PENDING) // OnServerDNSResolved will be called. |
return; |
- } |
+ |
HandleServerDNSResolved(status); |
} else { |
// We are not resolving DNS here (DNS will be resolved by a lower layer). |