mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Migrate to AnyInvocable in webrtc medium
PiperOrigin-RevId: 565805742
This commit is contained in:
committed by
Copybara-Service
parent
b33c0e0332
commit
48eeee8d2b
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user