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

Unified Diff: content/browser/renderer_host/p2p/socket_dispatcher_host.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 | « chrome/browser/net/predictor.cc ('k') | content/browser/renderer_host/pepper_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/p2p/socket_dispatcher_host.cc
diff --git a/content/browser/renderer_host/p2p/socket_dispatcher_host.cc b/content/browser/renderer_host/p2p/socket_dispatcher_host.cc
index 3ff79e33cbbae202a462b399941a3c2780aa7214..ee337cefa5756dac5c05ece3956d3d0756765659 100644
--- a/content/browser/renderer_host/p2p/socket_dispatcher_host.cc
+++ b/content/browser/renderer_host/p2p/socket_dispatcher_host.cc
@@ -28,9 +28,7 @@ class P2PSocketDispatcherHost::DnsRequest {
net::HostResolver* host_resolver)
: routing_id_(routing_id),
request_id_(request_id),
- resolver_(host_resolver),
- ALLOW_THIS_IN_INITIALIZER_LIST(completion_callback_(
- this, &P2PSocketDispatcherHost::DnsRequest::OnDone)) {
+ resolver_(host_resolver) {
}
void Resolve(const std::string& host_name,
@@ -52,8 +50,11 @@ class P2PSocketDispatcherHost::DnsRequest {
host_name_ = host_name_ + '.';
net::HostResolver::RequestInfo info(net::HostPortPair(host_name_, 0));
- int result = resolver_.Resolve(info, &addresses_, &completion_callback_,
- net::BoundNetLog());
+ int result = resolver_.Resolve(
+ info, &addresses_,
+ base::Bind(&P2PSocketDispatcherHost::DnsRequest::OnDone,
+ base::Unretained(this)),
+ net::BoundNetLog());
if (result != net::ERR_IO_PENDING)
OnDone(result);
}
@@ -96,8 +97,6 @@ class P2PSocketDispatcherHost::DnsRequest {
net::SingleRequestHostResolver resolver_;
DoneCallback done_callback_;
-
- net::OldCompletionCallbackImpl<DnsRequest> completion_callback_;
};
P2PSocketDispatcherHost::P2PSocketDispatcherHost(
« no previous file with comments | « chrome/browser/net/predictor.cc ('k') | content/browser/renderer_host/pepper_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698