Migrate to AnyInvocable in webrtc medium

PiperOrigin-RevId: 565805742
This commit is contained in:
Janusz Sobczak
2023-09-15 16:26:09 -07:00
committed by Copybara-Service
parent b33c0e0332
commit 48eeee8d2b
2 changed files with 4 additions and 4 deletions
@@ -42,6 +42,7 @@ cc_library(
"//internal/platform:types",
"//proto/mediums:web_rtc_signaling_frames_cc_proto",
# TODO: Support WebRTC
"@com_google_absl//absl/functional:any_invocable",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/time",
],
@@ -17,9 +17,8 @@
#ifndef NO_WEBRTC
#include "absl/functional/any_invocable.h"
#include "connections/implementation/mediums/webrtc_socket.h"
#include "connections/listeners.h"
#include "internal/platform/byte_array.h"
namespace nearby {
namespace connections {
@@ -29,11 +28,11 @@ namespace mediums {
struct DataChannelListener {
// Called when the data channel is open and the socket wraper is ready to
// read and write.
std::function<void(WebRtcSocketWrapper)> data_channel_open_cb =
absl::AnyInvocable<void(WebRtcSocketWrapper)> data_channel_open_cb =
[](WebRtcSocketWrapper) {};
// Called when the data channel is closed.
std::function<void()> data_channel_closed_cb = []() {};
absl::AnyInvocable<void()> data_channel_closed_cb = []() {};
};
} // namespace mediums