summaryrefslogtreecommitdiffstats
path: root/jingle
diff options
context:
space:
mode:
Diffstat (limited to 'jingle')
-rw-r--r--jingle/notifier/communicator/xmpp_connection_generator.cc14
-rw-r--r--jingle/notifier/communicator/xmpp_connection_generator.h2
2 files changed, 6 insertions, 10 deletions
diff --git a/jingle/notifier/communicator/xmpp_connection_generator.cc b/jingle/notifier/communicator/xmpp_connection_generator.cc
index 5a234e7..b19d16b 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).
diff --git a/jingle/notifier/communicator/xmpp_connection_generator.h b/jingle/notifier/communicator/xmpp_connection_generator.h
index 1100575..9f3ad79 100644
--- a/jingle/notifier/communicator/xmpp_connection_generator.h
+++ b/jingle/notifier/communicator/xmpp_connection_generator.h
@@ -9,7 +9,6 @@
#include "base/memory/scoped_ptr.h"
#include "net/base/address_list.h"
-#include "net/base/completion_callback.h"
#include "net/base/host_resolver.h"
#include "net/base/net_log.h"
#include "net/base/single_request_host_resolver.h"
@@ -65,7 +64,6 @@ class XmppConnectionGenerator {
Delegate* delegate_;
net::SingleRequestHostResolver host_resolver_;
- scoped_ptr<net::OldCompletionCallback> resolve_callback_;
net::AddressList address_list_;
net::BoundNetLog bound_net_log_;
scoped_ptr<ConnectionSettingsList> settings_list_;