aboutsummaryrefslogtreecommitdiff
path: root/pc/data_channel_controller.cc
diff options
context:
space:
mode:
authorErwin Jansen <jansene@google.com>2021-06-30 07:29:26 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-06-30 07:29:26 +0000
commit059cdc5996938f5f6b5343b6c969c12098275587 (patch)
tree6eacaffe4bebf8e00c290c1e1839e084b0c52e88 /pc/data_channel_controller.cc
parent97e54a7e73c7b24e464ef06ef3c3b3716f21bb15 (diff)
parent16be34ae72cdb525c88c2b31b21b976f35fe36d8 (diff)
downloadwebrtc-059cdc5996938f5f6b5343b6c969c12098275587.tar.gz
Merge "Merge upstream-master and enable ARM64" into emu-master-devemu-31-stable-releaseemu-31-release
Diffstat (limited to 'pc/data_channel_controller.cc')
-rw-r--r--pc/data_channel_controller.cc26
1 files changed, 9 insertions, 17 deletions
diff --git a/pc/data_channel_controller.cc b/pc/data_channel_controller.cc
index 6b3500cbff..d8e6b39895 100644
--- a/pc/data_channel_controller.cc
+++ b/pc/data_channel_controller.cc
@@ -31,11 +31,12 @@ bool DataChannelController::HasDataChannels() const {
return !sctp_data_channels_.empty();
}
-bool DataChannelController::SendData(const cricket::SendDataParams& params,
+bool DataChannelController::SendData(int sid,
+ const SendDataParams& params,
const rtc::CopyOnWriteBuffer& payload,
cricket::SendDataResult* result) {
if (data_channel_transport())
- return DataChannelSendData(params, payload, result);
+ return DataChannelSendData(sid, params, payload, result);
RTC_LOG(LS_ERROR) << "SendData called before transport is ready";
return false;
}
@@ -106,7 +107,7 @@ void DataChannelController::OnDataReceived(
RTC_DCHECK_RUN_ON(network_thread());
cricket::ReceiveDataParams params;
params.sid = channel_id;
- params.type = ToCricketDataMessageType(type);
+ params.type = type;
signaling_thread()->PostTask(
ToQueuedTask([self = weak_factory_.GetWeakPtr(), params, buffer] {
if (self) {
@@ -222,7 +223,7 @@ std::vector<DataChannelStats> DataChannelController::GetDataChannelStats()
bool DataChannelController::HandleOpenMessage_s(
const cricket::ReceiveDataParams& params,
const rtc::CopyOnWriteBuffer& buffer) {
- if (params.type == cricket::DMT_CONTROL && IsOpenMessage(buffer)) {
+ if (params.type == DataMessageType::kControl && IsOpenMessage(buffer)) {
// Received OPEN message; parse and signal that a new data channel should
// be created.
std::string label;
@@ -386,7 +387,8 @@ void DataChannelController::set_data_channel_transport(
}
bool DataChannelController::DataChannelSendData(
- const cricket::SendDataParams& params,
+ int sid,
+ const SendDataParams& params,
const rtc::CopyOnWriteBuffer& payload,
cricket::SendDataResult* result) {
// TODO(bugs.webrtc.org/11547): Expect method to be called on the network
@@ -395,19 +397,9 @@ bool DataChannelController::DataChannelSendData(
RTC_DCHECK_RUN_ON(signaling_thread());
RTC_DCHECK(data_channel_transport());
- SendDataParams send_params;
- send_params.type = ToWebrtcDataMessageType(params.type);
- send_params.ordered = params.ordered;
- if (params.max_rtx_count >= 0) {
- send_params.max_rtx_count = params.max_rtx_count;
- } else if (params.max_rtx_ms >= 0) {
- send_params.max_rtx_ms = params.max_rtx_ms;
- }
-
RTCError error = network_thread()->Invoke<RTCError>(
- RTC_FROM_HERE, [this, params, send_params, payload] {
- return data_channel_transport()->SendData(params.sid, send_params,
- payload);
+ RTC_FROM_HERE, [this, sid, params, payload] {
+ return data_channel_transport()->SendData(sid, params, payload);
});
if (error.ok()) {