Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Unified Diff: jingle/notifier/communicator/xmpp_connection_generator.cc

Issue 8549004: base::Bind: Convert HostResolver::Resolve. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « jingle/notifier/communicator/xmpp_connection_generator.h ('k') | net/base/host_resolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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).
« no previous file with comments | « jingle/notifier/communicator/xmpp_connection_generator.h ('k') | net/base/host_resolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698