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

Unified Diff: net/dns/host_resolver_mojo.cc

Issue 2083463002: Replace //net TypeConverters with StructTraits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@type-converter-cleanup--gurl
Patch Set: rebase Created 4 years, 2 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_mojo.cc
diff --git a/net/dns/host_resolver_mojo.cc b/net/dns/host_resolver_mojo.cc
index aeca31baf2e2a6e2bed6376dde81ac973d3d813f..3c311c4a2a8601a6828233aaa50b5e1ec437b9b1 100644
--- a/net/dns/host_resolver_mojo.cc
+++ b/net/dns/host_resolver_mojo.cc
@@ -10,7 +10,6 @@
#include "mojo/public/cpp/bindings/binding.h"
#include "net/base/address_list.h"
#include "net/base/net_errors.h"
-#include "net/dns/mojo_host_type_converters.h"
namespace net {
namespace {
@@ -38,8 +37,7 @@ class HostResolverMojo::Job : public interfaces::HostResolverRequestClient {
private:
// interfaces::HostResolverRequestClient override.
- void ReportResult(int32_t error,
- interfaces::AddressListPtr address_list) override;
+ void ReportResult(int32_t error, const AddressList& address_list) override;
// Mojo error handler.
void OnConnectionError();
@@ -95,7 +93,7 @@ int HostResolverMojo::Resolve(const RequestInfo& info,
host_cache_weak_factory_.GetWeakPtr()));
request->reset(new RequestImpl(std::move(job)));
- impl_->ResolveDns(interfaces::HostResolverRequestInfo::From(info),
+ impl_->ResolveDns(base::MakeUnique<HostResolver::RequestInfo>(info),
std::move(handle));
return ERR_IO_PENDING;
}
@@ -142,11 +140,10 @@ HostResolverMojo::Job::Job(
&HostResolverMojo::Job::OnConnectionError, base::Unretained(this)));
}
-void HostResolverMojo::Job::ReportResult(
- int32_t error,
- interfaces::AddressListPtr address_list) {
- if (error == OK && address_list)
- *addresses_ = address_list->To<AddressList>();
+void HostResolverMojo::Job::ReportResult(int32_t error,
+ const AddressList& address_list) {
+ if (error == OK)
+ *addresses_ = address_list;
if (host_cache_) {
base::TimeDelta ttl = base::TimeDelta::FromSeconds(
error == OK ? kCacheEntryTTLSeconds : kNegativeCacheEntryTTLSeconds);
@@ -159,7 +156,7 @@ void HostResolverMojo::Job::ReportResult(
}
void HostResolverMojo::Job::OnConnectionError() {
- ReportResult(ERR_FAILED, interfaces::AddressListPtr());
+ ReportResult(ERR_FAILED, AddressList());
}
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698