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

Unified Diff: content/browser/renderer_host/p2p/socket_dispatcher_host.cc

Issue 7633036: Return DNS addresses when address can be resolved synchronously. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months 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 | « no previous file | no next file » | 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 728556ec6ca59f646fd918a2bb0c30d28ff0bcbe..b1a5769255b48eaacb43d9e7b686aaac30004e90 100644
--- a/content/browser/renderer_host/p2p/socket_dispatcher_host.cc
+++ b/content/browser/renderer_host/p2p/socket_dispatcher_host.cc
@@ -48,8 +48,10 @@ class P2PSocketDispatcherHost::DnsRequest {
host_name_ = host_name_ + '.';
net::HostResolver::RequestInfo info(net::HostPortPair(host_name_, 0));
- resolver_.Resolve(info, &addresses_, &completion_callback_,
- net::BoundNetLog());
+ int result = resolver_.Resolve(info, &addresses_, &completion_callback_,
+ net::BoundNetLog());
+ if (result != net::ERR_IO_PENDING)
+ OnDone(result);
}
int32 routing_id() { return routing_id_; }
@@ -199,10 +201,10 @@ void P2PSocketDispatcherHost::OnGetHostAddress(const IPC::Message& msg,
int32 request_id) {
DnsRequest* request = new DnsRequest(
msg.routing_id(), request_id, resource_context_->host_resolver());
+ dns_requests_.insert(request);
request->Resolve(host_name, base::Bind(
&P2PSocketDispatcherHost::OnAddressResolved,
base::Unretained(this), request));
- dns_requests_.insert(request);
}
void P2PSocketDispatcherHost::OnAddressResolved(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698