diff options
author | Jordan Bayles <jophba@chromium.org> | 2021-04-21 15:08:09 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-21 23:22:55 +0000 |
commit | f71d249a402d2e1f5a6dfd9484263058303ee7df (patch) | |
tree | c112d2aecddf8c3ef092635df573dd91f9859513 /discovery/mdns | |
parent | 9709e9336d093dd2f6147012e88edf967a6e183f (diff) | |
download | openscreen-f71d249a402d2e1f5a6dfd9484263058303ee7df.tar.gz |
Cleanup TODOs from @miu
This patch removes all remaining TODOs from the now-departed @miu,
either reassigning them to jophba, or for the majority, just
implementing the fix directly.
Change-Id: I73c21f577bf115cf37ec880fac54eef1555de7c5
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2831302
Commit-Queue: Jordan Bayles <jophba@chromium.org>
Reviewed-by: Brandon Tolsch <btolsch@chromium.org>
Diffstat (limited to 'discovery/mdns')
-rw-r--r-- | discovery/mdns/mdns_service_impl.cc | 11 | ||||
-rw-r--r-- | discovery/mdns/mdns_service_impl.h | 2 | ||||
-rw-r--r-- | discovery/mdns/public/mdns_service.h | 9 |
3 files changed, 10 insertions, 12 deletions
diff --git a/discovery/mdns/mdns_service_impl.cc b/discovery/mdns/mdns_service_impl.cc index 6d94c3c7..bbbf0815 100644 --- a/discovery/mdns/mdns_service_impl.cc +++ b/discovery/mdns/mdns_service_impl.cc @@ -20,7 +20,7 @@ std::unique_ptr<MdnsService> MdnsService::Create( TaskRunner* task_runner, ReportingClient* reporting_client, const Config& config, - const Config::NetworkInfo& network_info) { + const InterfaceInfo& network_info) { return std::make_unique<MdnsServiceImpl>( task_runner, Clock::now, reporting_client, config, network_info); } @@ -29,22 +29,21 @@ MdnsServiceImpl::MdnsServiceImpl(TaskRunner* task_runner, ClockNowFunctionPtr now_function, ReportingClient* reporting_client, const Config& config, - const Config::NetworkInfo& network_info) + const InterfaceInfo& network_info) : task_runner_(task_runner), now_function_(now_function), reporting_client_(reporting_client), receiver_(config), - interface_(network_info.interface.index) { + interface_(network_info.index) { OSP_DCHECK(task_runner_); OSP_DCHECK(reporting_client_); - OSP_DCHECK(network_info.supported_address_families); // Create all UDP sockets needed for this object. They should not yet be bound // so that they do not send or receive data until the objects on which their // callback depends is initialized. // NOTE: we bind to the Any addresses here because traffic is filtered by // the multicast join calls. - if (network_info.supported_address_families & Config::NetworkInfo::kUseIpV4) { + if (network_info.GetIpAddressV4()) { ErrorOr<std::unique_ptr<UdpSocket>> socket = UdpSocket::Create( task_runner, this, IPEndpoint{IPAddress::kAnyV4(), kDefaultMulticastPort}); @@ -55,7 +54,7 @@ MdnsServiceImpl::MdnsServiceImpl(TaskRunner* task_runner, socket_v4_ = std::move(socket.value()); } - if (network_info.supported_address_families & Config::NetworkInfo::kUseIpV6) { + if (network_info.GetIpAddressV6()) { ErrorOr<std::unique_ptr<UdpSocket>> socket = UdpSocket::Create( task_runner, this, IPEndpoint{IPAddress::kAnyV6(), kDefaultMulticastPort}); diff --git a/discovery/mdns/mdns_service_impl.h b/discovery/mdns/mdns_service_impl.h index e1c15226..523f078f 100644 --- a/discovery/mdns/mdns_service_impl.h +++ b/discovery/mdns/mdns_service_impl.h @@ -40,7 +40,7 @@ class MdnsServiceImpl : public MdnsService, public UdpSocket::Client { ClockNowFunctionPtr now_function, ReportingClient* reporting_client, const Config& config, - const Config::NetworkInfo& network_info); + const InterfaceInfo& network_info); ~MdnsServiceImpl() override; // MdnsService Overrides. diff --git a/discovery/mdns/public/mdns_service.h b/discovery/mdns/public/mdns_service.h index 03e58008..76a8f05d 100644 --- a/discovery/mdns/public/mdns_service.h +++ b/discovery/mdns/public/mdns_service.h @@ -34,11 +34,10 @@ class MdnsService { // Creates a new MdnsService instance, to be owned by the caller. On failure, // returns nullptr. |task_runner|, |reporting_client|, and |config| must exist // for the duration of the resulting instance's life. - static std::unique_ptr<MdnsService> Create( - TaskRunner* task_runner, - ReportingClient* reporting_client, - const Config& config, - const Config::NetworkInfo& network_info); + static std::unique_ptr<MdnsService> Create(TaskRunner* task_runner, + ReportingClient* reporting_client, + const Config& config, + const InterfaceInfo& network_info); // Starts an mDNS query with the given properties. Updated records are passed // to |callback|. The caller must ensure |callback| remains alive while it is |