summaryrefslogtreecommitdiffstats
path: root/jingle
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-16 18:58:29 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-16 18:58:29 +0000
commitaa22b24e681201499f9dc82c3d62d66e682bf118 (patch)
tree0760db471972868a35219a2fd28a0a733cfac2d8 /jingle
parent66ad7faacf401592f814b73ec8d670a552f4c61e (diff)
downloadchromium_src-aa22b24e681201499f9dc82c3d62d66e682bf118.zip
chromium_src-aa22b24e681201499f9dc82c3d62d66e682bf118.tar.gz
chromium_src-aa22b24e681201499f9dc82c3d62d66e682bf118.tar.bz2
base::Bind: Convert HostResolver::Resolve.
BUG=none TEST=none R=willchan@chromium.org Review URL: http://codereview.chromium.org/8549004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110333 0039d316-1c4b-4281-b951-d872f2087c98
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_;