diff --git a/internal/platform/implementation/wifi_lan.h b/internal/platform/implementation/wifi_lan.h index 39fd6a6c..b967f4aa 100644 --- a/internal/platform/implementation/wifi_lan.h +++ b/internal/platform/implementation/wifi_lan.h @@ -17,6 +17,7 @@ #include +#include "absl/functional/any_invocable.h" #include "internal/platform/cancellation_flag.h" #include "internal/platform/input_stream.h" #include "internal/platform/listeners.h" @@ -99,10 +100,10 @@ class WifiLanMedium { // Callback that is invoked when a discovered service is found or lost. struct DiscoveredServiceCallback { - absl::AnyInvocable - service_discovered_cb = DefaultCallback(); - absl::AnyInvocable service_lost_cb = - DefaultCallback(); + absl::AnyInvocable + service_discovered_cb = DefaultCallback(); + absl::AnyInvocable + service_lost_cb = DefaultCallback(); }; // Starts the discovery of nearby WifiLan services. diff --git a/internal/platform/nsd_service_info.h b/internal/platform/nsd_service_info.h index 26962434..533030b6 100644 --- a/internal/platform/nsd_service_info.h +++ b/internal/platform/nsd_service_info.h @@ -63,7 +63,7 @@ class NsdServiceInfo { // Sets all TXTRecord. void SetTxtRecords( - absl::flat_hash_map& txt_records) { + const absl::flat_hash_map& txt_records) { txt_records_ = txt_records; } diff --git a/internal/platform/wifi_lan.cc b/internal/platform/wifi_lan.cc index 1a80bd1c..ec0d1410 100644 --- a/internal/platform/wifi_lan.cc +++ b/internal/platform/wifi_lan.cc @@ -43,7 +43,7 @@ bool WifiLanMedium::StartDiscovery(const std::string& service_id, } api::WifiLanMedium::DiscoveredServiceCallback api_callback = { .service_discovered_cb = - [this](NsdServiceInfo service_info) { + [this](const NsdServiceInfo& service_info) { MutexLock lock(&mutex_); std::string service_type = service_info.GetServiceType(); // Check callback for the service type. @@ -86,7 +86,7 @@ bool WifiLanMedium::StartDiscovery(const std::string& service_id, medium_callback.service_discovered_cb(service_info, service_id); }, .service_lost_cb = - [this](NsdServiceInfo service_info) { + [this](const NsdServiceInfo& service_info) { MutexLock lock(&mutex_); std::string service_type = service_info.GetServiceType(); std::string service_name = service_info.GetServiceName();