1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=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
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_PrioEncoder_h
8 #define mozilla_dom_PrioEncoder_h
10 #include "mozilla/dom/PrioEncoderBinding.h"
11 #include "mozilla/dom/RootedDictionary.h"
15 class nsIGlobalObject
;
22 NS_INLINE_DECL_REFCOUNTING(PrioEncoder
)
24 static void Encode(GlobalObject
& aGlobal
, const nsCString
& aBatchID
,
25 const PrioParams
& aPrioParams
,
26 RootedDictionary
<PrioEncodedData
>& aData
,
29 // maximum number of booleans that can be prio-encoded in a single batch.
30 const static uint32_t gNumBooleans
= 2046;
36 static PublicKey sPublicKeyA
;
38 static PublicKey sPublicKeyB
;
40 static StaticRefPtr
<PrioEncoder
> sSingleton
;
42 static bool IsValidHexPublicKey(mozilla::Span
<const char>);
46 } // namespace mozilla
48 #endif // mozilla_dom_PrioEncoder_h