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

Unified Diff: net/dns/host_resolver_impl_fuzzer.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: changed implementation of attach/detach of request 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: net/dns/host_resolver_impl_fuzzer.cc
diff --git a/net/dns/host_resolver_impl_fuzzer.cc b/net/dns/host_resolver_impl_fuzzer.cc
index c9c9e170649f130e5b6f76e4406593c607934b22..bfbefd67f5508b73fdf01354107f53761b9adf3a 100644
--- a/net/dns/host_resolver_impl_fuzzer.cc
+++ b/net/dns/host_resolver_impl_fuzzer.cc
@@ -38,7 +38,7 @@ class DnsRequest {
: host_resolver_(host_resolver),
data_provider_(data_provider),
dns_requests_(dns_requests),
- handle_(nullptr),
+ request_(),
mmenke 2016/07/19 19:03:56 this isn't needed.
maksims (do not use this acc) 2016/07/21 07:12:45 Done.
is_running_(false) {}
~DnsRequest() {
@@ -155,7 +155,7 @@ class DnsRequest {
info.set_allow_cached_response(data_provider_->ConsumeBool());
return host_resolver_->Resolve(
info, priority, &address_list_,
- base::Bind(&DnsRequest::OnCallback, base::Unretained(this)), &handle_,
+ base::Bind(&DnsRequest::OnCallback, base::Unretained(this)), &request_,
net::BoundNetLog());
}
@@ -173,7 +173,7 @@ class DnsRequest {
// Cancel the request, if not already completed. Otherwise, does nothing.
void Cancel() {
if (is_running_)
- host_resolver_->CancelRequest(handle_);
+ request_.reset();
mmenke 2016/07/19 19:03:56 nit: Can unconditionally reset the request here.
maksims (do not use this acc) 2016/07/21 07:12:45 Done.
is_running_ = false;
}
@@ -181,7 +181,7 @@ class DnsRequest {
net::FuzzedDataProvider* data_provider_;
std::vector<std::unique_ptr<DnsRequest>>* dns_requests_;
- net::HostResolver::RequestHandle handle_;
+ std::unique_ptr<net::HostResolver::Request> request_;
net::AddressList address_list_;
bool is_running_;

Powered by Google App Engine
This is Rietveld 408576698