Bug 1726476 - Adjust GetSandboxedRLBoxPath for the changes in rlbox_wasm2c_sandbox. r=nika

rlbox_wasm2c_sandbox was adjusted to avoid using LoadLibraryA (rejected by
build/clang-plugin/LoadLibraryUsageChecker.cpp), so we adjust
GetSandboxedRLBoxPath (which is used to feed it) to return an UTF-16
string on Windows.

Differential Revision: https://phabricator.services.mozilla.com/D123025
This commit is contained in:
Mike Hommey 2021-08-20 23:33:05 +00:00
Родитель ce86abf62b
Коммит 14a11072e2
2 изменённых файлов: 4 добавлений и 9 удалений

Просмотреть файл

@ -12,7 +12,7 @@
namespace mozilla {
namespace ipc {
nsCString GetSandboxedRLBoxPath() {
PathString GetSandboxedRLBoxPath() {
nsCOMPtr<nsIFile> libFile;
nsresult rv = mozilla::BinaryPath::GetFile(getter_AddRefs(libFile));
if (NS_FAILED(rv)) {
@ -24,12 +24,7 @@ nsCString GetSandboxedRLBoxPath() {
MOZ_CRASH("Library preload failure: Failed to get library file\n");
}
PathString fullPath = libFile->NativePath();
#ifdef XP_WIN
return NS_ConvertUTF16toUTF8(fullPath);
#else
return fullPath;
#endif
return libFile->NativePath();
}
PRLibrary* PreloadLibrary(const nsCString& path) {

Просмотреть файл

@ -8,11 +8,11 @@
#ifndef ipc_glue_LibrarySandboxPreload_h
#define ipc_glue_LibrarySandboxPreload_h
#include "nsString.h"
#include "mozilla/FileUtils.h"
namespace mozilla {
namespace ipc {
nsCString GetSandboxedRLBoxPath();
PathString GetSandboxedRLBoxPath();
void PreloadSandboxedDynamicLibrary();
} // namespace ipc
} // namespace mozilla