mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 02:25:34 +00:00
Bug 1054616 - Clean up logging-related shims for Linux sandboxing. r=kang
This commit is contained in:
parent
23c21aa709
commit
3ae6c90876
@ -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 <windows.h>
|
||||
#include "base/logging.h"
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#ifdef OS_WIN
|
||||
#include <windows.h>
|
||||
#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
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user