Bug 1891688: Don't rely on static_assert(false) being valid in uninstantiated templat...
[gecko.git] / modules / woff2 / RLBoxWOFF2Sandbox.h
blobf8b0d416142dd9102f7bd398658e8e09f52487d4
1 /* -*- Mode: C++; tab-width: 20; 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 MODULES_WOFF2_RLBOX_WOFF2_SANDBOX_H_
8 #define MODULES_WOFF2_RLBOX_WOFF2_SANDBOX_H_
10 #include <brotli/decode.h>
12 extern "C" {
14 // Because RLBox doesn't (yet) cleanly support {size,uint8}_t types on Windows,
15 // we're using unsigned long instead of size_t and char instead of uint8_t.
17 // Since RLBox doesn't support C++ APIs, we expose C wrappers for the WOFF2.
18 bool RLBoxConvertWOFF2ToTTF(const char* aData, unsigned long aLength,
19 unsigned long aDecompressedSize,
20 unsigned long* aResultSize, void** aResultOwningStr,
21 char** aResultData);
22 // RLBoxDeleteWOFF2String is used to delete the C++ string allocated by
23 // RLBoxConvertWOFF2ToTTF.
24 void RLBoxDeleteWOFF2String(void** aStr);
26 typedef BrotliDecoderResult(BrotliDecompressCallback)(
27 unsigned long aEncodedSize, const char* aEncodedBuffer,
28 unsigned long* aDecodedSize, char* aDecodedBuffer);
30 // Callback to the unsandboxed Brotli.
32 extern BrotliDecompressCallback* sRLBoxBrotliDecompressCallback;
34 void RegisterWOFF2Callback(BrotliDecompressCallback* aCallback);
35 BrotliDecoderResult RLBoxBrotliDecoderDecompress(size_t aEncodedSize,
36 const uint8_t* aEncodedBuffer,
37 size_t* aDecodedSize,
38 uint8_t* aDecodedBuffer);
41 #endif