tor-browser

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

HybridSdpParser.h (1051B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
      5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef _HYBRIDSDPPARSER_H_
      8 #define _HYBRIDSDPPARSER_H_
      9 
     10 #include "sdp/SdpParser.h"
     11 
     12 namespace mozilla {
     13 
     14 // This shim parser delegates parsing to WEbRTC-SDP and SIPCC, based on
     15 // preference flags.
     16 class HybridSdpParser : public SdpParser {
     17  static const std::string& ParserName();
     18 
     19 public:
     20  HybridSdpParser();
     21  virtual ~HybridSdpParser() = default;
     22 
     23  auto Name() const -> const std::string& override { return ParserName(); }
     24  auto Parse(const std::string& aText)
     25      -> UniquePtr<SdpParser::Results> override;
     26 
     27 private:
     28  const bool mStrictSuccess;
     29  const UniquePtr<SdpParser> mPrimary;
     30  const Maybe<UniquePtr<SdpParser>> mSecondary;
     31  const Maybe<UniquePtr<SdpParser>> mFailover;
     32 };
     33 
     34 }  // namespace mozilla
     35 
     36 #endif