tor-browser

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

NullTransport.h (1299B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
      3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 #ifndef NULL_TRANSPORT_H_
      6 #define NULL_TRANSPORT_H_
      7 
      8 #include "api/call/transport.h"
      9 
     10 namespace mozilla {
     11 
     12 /**
     13 * NullTransport is registered as ExternalTransport to throw away data
     14 */
     15 class NullTransport : public webrtc::Transport {
     16 public:
     17  virtual bool SendRtp(webrtc::ArrayView<const uint8_t> packet,
     18                       const webrtc::PacketOptions& options) {
     19    (void)packet;
     20    (void)options;
     21    return true;
     22  }
     23 
     24  virtual bool SendRtcp(webrtc::ArrayView<const uint8_t> packet,
     25                        const webrtc::PacketOptions& options) {
     26    (void)packet;
     27    (void)options;
     28    return true;
     29  }
     30 #if 0
     31  virtual int SendPacket(int channel, const void *data, size_t len)
     32  {
     33    (void) channel; (void) data;
     34    return len;
     35  }
     36 
     37  virtual int SendRTCPPacket(int channel, const void *data, size_t len)
     38  {
     39    (void) channel; (void) data;
     40    return len;
     41  }
     42 #endif
     43  NullTransport() {}
     44 
     45  virtual ~NullTransport() {}
     46 
     47 private:
     48  NullTransport(const NullTransport& other) = delete;
     49  void operator=(const NullTransport& other) = delete;
     50 };
     51 
     52 }  // namespace mozilla
     53 
     54 #endif