diff --git a/security/sandbox/chromium/base/shim/base/logging.cpp b/security/sandbox/chromium/base/shim/base/logging.cpp index 635125456b99..e01d8a54cefa 100644 --- a/security/sandbox/chromium/base/shim/base/logging.cpp +++ b/security/sandbox/chromium/base/shim/base/logging.cpp @@ -4,10 +4,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include #include "base/logging.h" -#include "base/strings/string_piece.h" -#include "base/strings/string_util.h" +#ifdef OS_WIN +#include +#endif namespace { int min_log_level = 0; @@ -51,6 +51,21 @@ LogMessage::~LogMessage() { } +int GetMinLogLevel() +{ + return min_log_level; +} + +int GetVlogLevelHelper(const char* file, size_t N) +{ + return 0; +} + +void RawLog(int level, const char* message) +{ +} + +#ifdef OS_WIN LogMessage::SaveLastError::SaveLastError() : last_error_(::GetLastError()) { @@ -66,11 +81,6 @@ SystemErrorCode GetLastSystemErrorCode() return ::GetLastError(); } -int GetMinLogLevel() -{ - return min_log_level; -} - Win32ErrorLogMessage::Win32ErrorLogMessage(const char* file, int line, LogSeverity severity, SystemErrorCode err, @@ -94,10 +104,6 @@ Win32ErrorLogMessage::Win32ErrorLogMessage(const char* file, Win32ErrorLogMessage::~Win32ErrorLogMessage() { } - -int GetVlogLevelHelper(const char* file, size_t N) -{ - return 0; -} +#endif // OS_WIN } // namespace logging diff --git a/security/sandbox/linux/Sandbox.cpp b/security/sandbox/linux/Sandbox.cpp index badd7dde0540..f1b143db4442 100644 --- a/security/sandbox/linux/Sandbox.cpp +++ b/security/sandbox/linux/Sandbox.cpp @@ -482,34 +482,3 @@ CanSandboxMediaPlugin() #endif // MOZ_GMP_SANDBOX } // namespace mozilla - - -// "Polyfill" for sandbox::Die, the real version of which requires -// Chromium's logging code. -namespace sandbox { - -void -Die::SandboxDie(const char* msg, const char* file, int line) -{ - SANDBOX_LOG_ERROR("%s:%d: %s\n", file, line, msg); - _exit(127); -} - -} // namespace sandbox - - -// Stubs for unreached logging calls from Chromium CHECK() macro. -#include "base/logging.h" -namespace logging { - -LogMessage::LogMessage(const char *file, int line, int) - : file_(file), line_(line) -{ - MOZ_CRASH("Unexpected call to logging::LogMessage::LogMessage"); -} - -LogMessage::~LogMessage() { - MOZ_CRASH("Unexpected call to logging::LogMessage::~LogMessage"); -} - -} // namespace logging diff --git a/security/sandbox/linux/moz.build b/security/sandbox/linux/moz.build index 4af04c6e81e2..9ad235af330a 100644 --- a/security/sandbox/linux/moz.build +++ b/security/sandbox/linux/moz.build @@ -14,8 +14,11 @@ EXPORTS.mozilla += [ ] SOURCES += [ + '../chromium/base/shim/base/logging.cpp', '../chromium/sandbox/linux/seccomp-bpf/basicblock.cc', '../chromium/sandbox/linux/seccomp-bpf/codegen.cc', + '../chromium/sandbox/linux/seccomp-bpf/die.cc', + '../chromium/sandbox/linux/seccomp-bpf/syscall.cc', 'Sandbox.cpp', 'SandboxAssembler.cpp', 'SandboxFilter.cpp', @@ -24,10 +27,9 @@ SOURCES += [ DEFINES['NS_NO_XPCOM'] = True DISABLE_STL_WRAPPING = True -LOCAL_INCLUDES += [ - '/security/sandbox', - '/security/sandbox/chromium', -] +LOCAL_INCLUDES += ['/security/sandbox/chromium/base/shim'] +LOCAL_INCLUDES += ['/security/sandbox/chromium'] +LOCAL_INCLUDES += ['/security/sandbox'] if CONFIG['OS_TARGET'] != 'Android': # Needed for clock_gettime with glibc < 2.17: