tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

data_channel_interface.cc (1690B)


      1 /*
      2 *  Copyright 2018 The WebRTC project authors. All Rights Reserved.
      3 *
      4 *  Use of this source code is governed by a BSD-style license
      5 *  that can be found in the LICENSE file in the root of the source
      6 *  tree. An additional intellectual property rights grant can be found
      7 *  in the file PATENTS.  All contributing project authors may
      8 *  be found in the AUTHORS file in the root of the source tree.
      9 */
     10 
     11 #include "api/data_channel_interface.h"
     12 
     13 #include <cstdint>
     14 #include <optional>
     15 #include <string>
     16 
     17 #include "absl/functional/any_invocable.h"
     18 #include "api/priority.h"
     19 #include "api/rtc_error.h"
     20 #include "rtc_base/checks.h"
     21 
     22 namespace webrtc {
     23 
     24 bool DataChannelInterface::ordered() const {
     25  return false;
     26 }
     27 
     28 std::optional<int> DataChannelInterface::maxRetransmitsOpt() const {
     29  return std::nullopt;
     30 }
     31 
     32 std::optional<int> DataChannelInterface::maxPacketLifeTime() const {
     33  return std::nullopt;
     34 }
     35 
     36 std::string DataChannelInterface::protocol() const {
     37  return std::string();
     38 }
     39 
     40 bool DataChannelInterface::negotiated() const {
     41  return false;
     42 }
     43 
     44 PriorityValue DataChannelInterface::priority() const {
     45  return PriorityValue(Priority::kLow);
     46 }
     47 
     48 uint64_t DataChannelInterface::MaxSendQueueSize() {
     49  return 16 * 1024 * 1024;  // 16 MiB
     50 }
     51 
     52 // TODO(tommi): Remove method once downstream implementations have been removed.
     53 bool DataChannelInterface::Send(const DataBuffer& /* buffer */) {
     54  RTC_DCHECK_NOTREACHED();
     55  return false;
     56 }
     57 
     58 // TODO(tommi): Remove implementation once method is pure virtual.
     59 void DataChannelInterface::SendAsync(
     60    DataBuffer /* buffer */,
     61    absl::AnyInvocable<void(RTCError) &&> /* on_complete */) {
     62  RTC_DCHECK_NOTREACHED();
     63 }
     64 
     65 }  // namespace webrtc