tor-browser

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

WebTransportHash.h (895B)


      1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 #ifndef mozilla_net_WebTransportHash_h
      7 #define mozilla_net_WebTransportHash_h
      8 
      9 #include "nsIWebTransport.h"
     10 
     11 namespace mozilla::net {
     12 
     13 class WebTransportHash final : public nsIWebTransportHash {
     14 public:
     15  NS_DECL_THREADSAFE_ISUPPORTS
     16  NS_DECL_NSIWEBTRANSPORTHASH
     17 
     18  explicit WebTransportHash(const nsACString& algorithm,
     19                            const nsTArray<uint8_t>& value)
     20      : mAlgorithm(algorithm), mValue(Span(value)) {}
     21 
     22 private:
     23  ~WebTransportHash() = default;
     24  nsCString mAlgorithm;
     25  nsTArray<uint8_t> mValue;
     26 };
     27 
     28 }  // namespace mozilla::net
     29 
     30 #endif  // mozilla_net_WebTransportHash_h