Bug 1948620: Part 2 - Use library names for rlbox_wasm2c memory allocations r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D241897
This commit is contained in:
@@ -87,7 +87,9 @@ OggDemuxer::nsAutoOggSyncState::~nsAutoOggSyncState() {
|
|||||||
rlbox_sandbox_ogg* OggDemuxer::CreateSandbox() {
|
rlbox_sandbox_ogg* OggDemuxer::CreateSandbox() {
|
||||||
rlbox_sandbox_ogg* sandbox = new rlbox_sandbox_ogg();
|
rlbox_sandbox_ogg* sandbox = new rlbox_sandbox_ogg();
|
||||||
#ifdef MOZ_WASM_SANDBOXING_OGG
|
#ifdef MOZ_WASM_SANDBOXING_OGG
|
||||||
bool success = sandbox->create_sandbox(false /* infallible */);
|
bool success = sandbox->create_sandbox(/* shouldAbortOnFailure = */ false,
|
||||||
|
/* custom capacity = */ nullptr,
|
||||||
|
"rlbox_wasm2c_ogg");
|
||||||
#else
|
#else
|
||||||
bool success = sandbox->create_sandbox();
|
bool success = sandbox->create_sandbox();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ RLBoxHunspell* RLBoxHunspell::Create(const nsCString& affpath,
|
|||||||
const w2c_mem_capacity capacity = get_valid_wasm2c_memory_capacity(
|
const w2c_mem_capacity capacity = get_valid_wasm2c_memory_capacity(
|
||||||
expectedMaxMemory, true /* wasm's 32-bit memory */);
|
expectedMaxMemory, true /* wasm's 32-bit memory */);
|
||||||
|
|
||||||
bool success =
|
bool success = sandbox->create_sandbox(/* shouldAbortOnFailure = */ false,
|
||||||
sandbox->create_sandbox(/* shouldAbortOnFailure = */ false, &capacity);
|
&capacity, "rlbox_wasm2c_hunspell");
|
||||||
#elif defined(MOZ_WASM_SANDBOXING_HUNSPELL)
|
#elif defined(MOZ_WASM_SANDBOXING_HUNSPELL)
|
||||||
bool success = sandbox->create_sandbox(/* shouldAbortOnFailure = */ false);
|
bool success = sandbox->create_sandbox(/* shouldAbortOnFailure = */ false);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -57,7 +57,8 @@ UniquePtr<RLBoxSandboxDataBase> RLBoxWOFF2SandboxPool::CreateSandboxData(
|
|||||||
#if defined(MOZ_WASM_SANDBOXING_WOFF2)
|
#if defined(MOZ_WASM_SANDBOXING_WOFF2)
|
||||||
const w2c_mem_capacity capacity =
|
const w2c_mem_capacity capacity =
|
||||||
get_valid_wasm2c_memory_capacity(aSize, true /* 32-bit wasm memory*/);
|
get_valid_wasm2c_memory_capacity(aSize, true /* 32-bit wasm memory*/);
|
||||||
bool createOK = sandbox->create_sandbox(/* infallible = */ false, &capacity);
|
bool createOK = sandbox->create_sandbox(/* shouldAbortOnFailure = */ false,
|
||||||
|
&capacity, "rlbox_wasm2c_woff2");
|
||||||
#else
|
#else
|
||||||
bool createOK = sandbox->create_sandbox();
|
bool createOK = sandbox->create_sandbox();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -655,7 +655,13 @@ struct gfxFontEntry::GrSandboxData {
|
|||||||
grGetGlyphAdvanceCallback;
|
grGetGlyphAdvanceCallback;
|
||||||
|
|
||||||
GrSandboxData() {
|
GrSandboxData() {
|
||||||
|
#if defined(MOZ_WASM_SANDBOXING_GRAPHITE)
|
||||||
|
sandbox.create_sandbox(/* shouldAbortOnFailure = */ true,
|
||||||
|
/* custom capacity = */ nullptr,
|
||||||
|
"rlbox_wasm2c_graphite");
|
||||||
|
#else
|
||||||
sandbox.create_sandbox();
|
sandbox.create_sandbox();
|
||||||
|
#endif
|
||||||
grGetTableCallback =
|
grGetTableCallback =
|
||||||
sandbox.register_callback(gfxFontEntryCallbacks::GrGetTable);
|
sandbox.register_callback(gfxFontEntryCallbacks::GrGetTable);
|
||||||
grReleaseTableCallback =
|
grReleaseTableCallback =
|
||||||
|
|||||||
@@ -14,7 +14,10 @@ RLBoxSoundTouch::RLBoxSoundTouch() {}
|
|||||||
|
|
||||||
bool RLBoxSoundTouch::Init() {
|
bool RLBoxSoundTouch::Init() {
|
||||||
#ifdef MOZ_WASM_SANDBOXING_SOUNDTOUCH
|
#ifdef MOZ_WASM_SANDBOXING_SOUNDTOUCH
|
||||||
const bool success = mSandbox.create_sandbox(false /* infallible */);
|
const bool success = mSandbox.create_sandbox(
|
||||||
|
/* shouldAbortOnFailure = */ false,
|
||||||
|
/* custom capacity = */ nullptr,
|
||||||
|
"rlbox_wasm2c_soundtouch");
|
||||||
#else
|
#else
|
||||||
const bool success = true;
|
const bool success = true;
|
||||||
mSandbox.create_sandbox();
|
mSandbox.create_sandbox();
|
||||||
|
|||||||
@@ -1450,7 +1450,8 @@ RLBoxExpatSandboxPool::CreateSandboxData(uint64_t aSize) {
|
|||||||
#ifdef MOZ_WASM_SANDBOXING_EXPAT
|
#ifdef MOZ_WASM_SANDBOXING_EXPAT
|
||||||
const w2c_mem_capacity capacity =
|
const w2c_mem_capacity capacity =
|
||||||
get_valid_wasm2c_memory_capacity(aSize, true /* 32-bit wasm memory*/);
|
get_valid_wasm2c_memory_capacity(aSize, true /* 32-bit wasm memory*/);
|
||||||
bool create_ok = sandbox->create_sandbox(/* infallible = */ false, &capacity);
|
bool create_ok = sandbox->create_sandbox(/* shouldAbortOnFailure = */ false,
|
||||||
|
&capacity, "rlbox_wasm2c_expat");
|
||||||
#else
|
#else
|
||||||
bool create_ok = sandbox->create_sandbox();
|
bool create_ok = sandbox->create_sandbox();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user