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

Unified Diff: chrome/browser/devtools/device/tcp_device_provider.cc

Issue 2116983002: Change HostResolver::Resolve() to take an std::unique_ptr<Request>* rather than a RequestHandle* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mmenke's comments and rebasing Created 4 years, 5 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
Index: chrome/browser/devtools/device/tcp_device_provider.cc
diff --git a/chrome/browser/devtools/device/tcp_device_provider.cc b/chrome/browser/devtools/device/tcp_device_provider.cc
index 33eb767cf52b66f10cb2839fb0c21d3cc60893bd..cddd826937064d3846358d1c0b2f6590deb80cc4 100644
--- a/chrome/browser/devtools/device/tcp_device_provider.cc
+++ b/chrome/browser/devtools/device/tcp_device_provider.cc
@@ -36,13 +36,16 @@ class ResolveHostAndOpenSocket final {
: callback_(callback) {
host_resolver_ = net::HostResolver::CreateDefaultResolver(nullptr);
net::HostResolver::RequestInfo request_info(address);
+ std::unique_ptr<net::HostResolver::Request> request;
mmenke 2016/07/21 16:00:40 Not needed (Note that there's also a bug below - y
maksims (do not use this acc) 2016/07/22 10:16:00 Ops...
int result = host_resolver_->Resolve(
request_info, net::DEFAULT_PRIORITY, &address_list_,
base::Bind(&ResolveHostAndOpenSocket::OnResolved,
base::Unretained(this)),
- nullptr, net::BoundNetLog());
+ &request_, net::BoundNetLog());
if (result != net::ERR_IO_PENDING)
OnResolved(result);
+ else if (result == net::ERR_IO_PENDING)
+ request_ = std::move(request);
}
private:
@@ -60,6 +63,7 @@ class ResolveHostAndOpenSocket final {
}
std::unique_ptr<net::HostResolver> host_resolver_;
+ std::unique_ptr<net::HostResolver::Request> request_;
net::AddressList address_list_;
AdbClientSocket::SocketCallback callback_;
};

Powered by Google App Engine
This is Rietveld 408576698