Bug 1526591 - Remove devtools.inspector.shapesHighlighter.enabled pref. r=rcaliman
[gecko.git] / dom / prio / PrioEncoder.h
blob2195e0d63da43f9b5a789f0a349458d92215dde2
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"
13 #include "mprio.h"
15 class nsIGlobalObject;
17 namespace mozilla {
18 namespace dom {
20 class PrioEncoder {
21 public:
22 NS_INLINE_DECL_REFCOUNTING(PrioEncoder)
24 static void Encode(GlobalObject& aGlobal, const nsCString& aBatchID,
25 const PrioParams& aPrioParams,
26 RootedDictionary<PrioEncodedData>& aData,
27 ErrorResult& aRv);
29 // maximum number of booleans that can be prio-encoded in a single batch.
30 const static uint32_t gNumBooleans = 2046;
32 private:
33 PrioEncoder();
34 ~PrioEncoder();
36 static PublicKey sPublicKeyA;
38 static PublicKey sPublicKeyB;
40 static StaticRefPtr<PrioEncoder> sSingleton;
42 static bool IsValidHexPublicKey(mozilla::Span<const char>);
45 } // namespace dom
46 } // namespace mozilla
48 #endif // mozilla_dom_PrioEncoder_h