RLBoxWOFF2Types.h (1156B)
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/. */ 6 7 #ifndef MODULES_WOFF2_RLBOXWOFF2TYPES_H_ 8 #define MODULES_WOFF2_RLBOXWOFF2TYPES_H_ 9 10 #include <stddef.h> 11 #include "mozilla/rlbox/rlbox_types.hpp" 12 #include "woff2/decode.h" 13 14 #ifdef MOZ_WASM_SANDBOXING_WOFF2 15 RLBOX_DEFINE_BASE_TYPES_FOR(woff2, wasm2c) 16 #else 17 RLBOX_DEFINE_BASE_TYPES_FOR(woff2, noop) 18 #endif 19 20 #include "mozilla/RLBoxSandboxPool.h" 21 #include "mozilla/StaticPtr.h" 22 23 class RLBoxWOFF2SandboxPool : public mozilla::RLBoxSandboxPool { 24 public: 25 explicit RLBoxWOFF2SandboxPool(size_t aDelaySeconds) 26 : RLBoxSandboxPool(aDelaySeconds) {} 27 28 static mozilla::StaticRefPtr<RLBoxWOFF2SandboxPool> sSingleton; 29 static void Initalize(size_t aDelaySeconds = 10); 30 31 protected: 32 mozilla::UniquePtr<mozilla::RLBoxSandboxDataBase> CreateSandboxData( 33 uint64_t aSize) override; 34 ~RLBoxWOFF2SandboxPool() = default; 35 }; 36 37 #endif