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

Unified Diff: net/proxy/sync_host_resolver_bridge.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 | « net/proxy/proxy_resolver_js_bindings_unittest.cc ('k') | net/proxy/sync_host_resolver_bridge_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/sync_host_resolver_bridge.cc
diff --git a/net/proxy/sync_host_resolver_bridge.cc b/net/proxy/sync_host_resolver_bridge.cc
index 7bd20c61e6b5622eb23a6aae2036a3f512bfc6a9..69dce07ff1f2abfb28bfb2071990fd404af07166 100644
--- a/net/proxy/sync_host_resolver_bridge.cc
+++ b/net/proxy/sync_host_resolver_bridge.cc
@@ -4,6 +4,7 @@
#include "net/proxy/sync_host_resolver_bridge.h"
+#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/message_loop.h"
@@ -52,7 +53,6 @@ class SyncHostResolverBridge::Core
HostResolver* const host_resolver_;
MessageLoop* const host_resolver_loop_;
- net::OldCompletionCallbackImpl<Core> callback_;
// The result from the current request (set on |host_resolver_loop_|).
int err_;
// The currently outstanding request to |host_resolver_|, or NULL.
@@ -75,8 +75,6 @@ SyncHostResolverBridge::Core::Core(HostResolver* host_resolver,
MessageLoop* host_resolver_loop)
: host_resolver_(host_resolver),
host_resolver_loop_(host_resolver_loop),
- ALLOW_THIS_IN_INITIALIZER_LIST(
- callback_(this, &Core::OnResolveCompletion)),
err_(0),
outstanding_request_(NULL),
event_(true, false),
@@ -104,7 +102,8 @@ void SyncHostResolverBridge::Core::StartResolve(
return;
int error = host_resolver_->Resolve(
- info, addresses, &callback_, &outstanding_request_, BoundNetLog());
+ info, addresses, base::Bind(&Core::OnResolveCompletion, this),
+ &outstanding_request_, BoundNetLog());
if (error != ERR_IO_PENDING)
OnResolveCompletion(error); // Completed synchronously.
}
« no previous file with comments | « net/proxy/proxy_resolver_js_bindings_unittest.cc ('k') | net/proxy/sync_host_resolver_bridge_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698