mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-19 00:13:33 +00:00
www/qt5-webengine: Update to 5.15.8
* Under the hood runs Chromium 87.0.4280.144 with security fixes up to
version 96.0.4664.110 and patches were taken from of www/chromium
87.0.4280.141 (391acded85
).
* Prune some unneeded patches (mostly from the headless and unittest
areas) and try to align the unbundling of dependencies similar to
qt6-webengine for consistency.
* Adjust Mk/Uses/qt-dist.mk accordingly as the naming of the distfiles
has changed since Qt 5.15.3.
Tested by: tcberner
Differential Revision: https://reviews.freebsd.org/D38165
This commit is contained in:
parent
d69b20995d
commit
8067206f03
@ -85,7 +85,11 @@ _QT6_MASTER_SITES= ${MASTER_SITE_QT}
|
||||
_QT6_MASTER_SITE_SUBDIR= official_releases/qt/${_QT_VERSION:R}/${_QT_VERSION}/submodules \
|
||||
official_releases/additional_libraries/${_QT_VERSION:R}/${_QT_VERSION}/
|
||||
# Qt5 specific distnames
|
||||
. if ${_QT_DIST} == webengine
|
||||
_QT5_DISTNAME= ${_QT_DIST:S,^,qt,:S,$,-everywhere-opensource-src-${DISTVERSION},}
|
||||
. else
|
||||
_QT5_DISTNAME= ${_QT_DIST:S,^,qt,:S,$,-everywhere-src-${DISTVERSION},}
|
||||
. endif
|
||||
_QT5_DISTNAME_kde= ${_QT_DIST:S,^,kde-qt,:S,$,-${DISTVERSION},}
|
||||
# Qt6 specific distnames
|
||||
_QT6_DISTNAME= ${_QT_DIST:S,^,qt,:S,$,-everywhere-src-${DISTVERSION},}
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
PORTNAME= webengine
|
||||
DISTVERSION= ${QT5_VERSION}
|
||||
PORTREVISION= 8
|
||||
PORTREVISION= 0
|
||||
CATEGORIES= www
|
||||
PKGNAMEPREFIX= qt5-
|
||||
|
||||
@ -24,7 +24,6 @@ MAINTAINER= kde@FreeBSD.org
|
||||
COMMENT= Qt 5 library to render web content
|
||||
|
||||
BUILD_DEPENDS= bison:devel/bison \
|
||||
yasm:devel/yasm \
|
||||
${LOCALBASE}/include/linux/input.h:devel/evdev-proto \
|
||||
${LOCALBASE}/include/linux/videodev2.h:multimedia/v4l_compat
|
||||
LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg \
|
||||
@ -38,6 +37,7 @@ LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg \
|
||||
liblcms2.so:graphics/lcms2 \
|
||||
libnspr4.so:devel/nspr \
|
||||
libnss3.so:security/nss \
|
||||
libopenh264.so:multimedia/openh264 \
|
||||
libopus.so:audio/opus \
|
||||
libpci.so:devel/libpci \
|
||||
libpng.so:graphics/png \
|
||||
@ -47,7 +47,16 @@ LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg \
|
||||
libwebp.so:graphics/webp
|
||||
|
||||
DISTINFO_FILE= ${.CURDIR}/distinfo
|
||||
QT5_VERSION= 5.15.2
|
||||
QT5_VERSION= 5.15.8
|
||||
|
||||
# Add extra-patch-no-mempcpy-nasm only when there's no mempcpy() in base.
|
||||
# Nested variable expansion avoids executing the test when not needed for
|
||||
# expanding EXTRA_PATCHES.
|
||||
# mempcpy was introduced in ee37f64cf875255338f917a9da76c643cf59786c
|
||||
EXTRA_PATCHES+= ${"${:!${GREP} mempcpy ${CROSS_SYSROOT}/usr/include/string.h \
|
||||
|| ${TRUE}!}" == "":?${PATCHDIR}/extra-patch-no-mempcpy-nasm:}
|
||||
|
||||
WRKSRC= ${WRKDIR}/qtwebengine-everywhere-src-${DISTVERSION}
|
||||
|
||||
OPTIONS_SINGLE= AUDIO
|
||||
OPTIONS_SINGLE_AUDIO= ALSA PULSEAUDIO SNDIO
|
||||
@ -71,15 +80,16 @@ SNDIO_VARS_OFF= QMAKE_CONFIGURE_ARGS+=-no-sndio
|
||||
# We pass `norecursive' to USES=qmake because src/plugins/plugins.pro checks
|
||||
# whether webenginewidgets is available, which fails when qmake processes all
|
||||
# .pro files at once.
|
||||
USES= gl gnome gperf jpeg ninja:build pkgconfig python:2.7,build \
|
||||
qmake:norecursive,outsource qt-dist:5,webengine shebangfix xorg
|
||||
USES= gl gnome gperf jpeg minizip ninja:build nodejs:build,lts \
|
||||
pkgconfig python:2.7,build qmake:norecursive,outsource \
|
||||
qt-dist:5,webengine shebangfix xorg
|
||||
USE_GL= gl
|
||||
USE_GNOME= glib20 libxml2 libxslt
|
||||
USE_QT= core declarative gui location network printsupport \
|
||||
webchannel widgets \
|
||||
buildtools:build designer:build qmake:build
|
||||
USE_XORG= x11 xcb xcomposite xcursor xdamage xext xfixes xi xorgproto \
|
||||
xrandr xrender xscrnsaver xtst
|
||||
USE_XORG= x11 xcb xcomposite xcursor xdamage xext xfixes xi xkbfile \
|
||||
xorgproto xrandr xrender xscrnsaver xtst
|
||||
|
||||
QMAKE_CONFIGURE_ARGS= -proprietary-codecs -system-ffmpeg
|
||||
|
||||
@ -132,10 +142,10 @@ post-extract-SNDIO-on:
|
||||
post-patch:
|
||||
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \
|
||||
${WRKSRC}/src/3rdparty/chromium/base/linux_util.cc \
|
||||
${WRKSRC}/src/3rdparty/chromium/base/test/BUILD.gn \
|
||||
${WRKSRC}/src/3rdparty/chromium/build/toolchain/gcc_toolchain.gni \
|
||||
${WRKSRC}/src/3rdparty/chromium/chrome/common/chrome_paths.cc \
|
||||
${WRKSRC}/src/3rdparty/chromium/third_party/pdfium/core/fxge/fx_ge_linux.cpp \
|
||||
${WRKSRC}/src/3rdparty/chromium/third_party/pdfium/xfa/fgas/font/cfx_fontsourceenum_file.cpp \
|
||||
${WRKSRC}/src/3rdparty/gn/build/gen.py
|
||||
|
||||
.if ${ARCH:Mmips*} || ${ARCH:Mpowerpc*} || ${ARCH} == sparc64
|
||||
@ -149,8 +159,9 @@ pre-configure:
|
||||
# $LOCALBASE/bin/python being python3 if the default versions is set to 3.x.
|
||||
${MKDIR} ${CONFIGURE_WRKSRC}/bin && ${LN} -s ${PYTHON_CMD} ${CONFIGURE_WRKSRC}/bin/python
|
||||
# Unbundle a few dependencies.
|
||||
${PYTHON_CMD} ${WRKSRC}/src/3rdparty/chromium/build/linux/unbundle/replace_gn_files.py \
|
||||
--system-libraries libwebp libxml libxslt yasm
|
||||
cd ${WRKSRC}/src/3rdparty/chromium && ${SETENV} ${CONFIGURE_ENV} ${PYTHON_CMD} \
|
||||
./build/linux/unbundle/replace_gn_files.py --system-libraries\
|
||||
fontconfig freetype harfbuzz-ng libdrm libevent libpng libwebp libxml libxslt openh264 opus || ${FALSE}
|
||||
# Rerun syncqt.pl -- otherwise the resulting package misses some forwarding headers.
|
||||
cd ${WRKSRC} && ${QT_BINDIR}/syncqt.pl -version ${QT5_VERSION}
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
TIMESTAMP = 1606050276
|
||||
SHA256 (KDE/Qt/5.15.2/qtwebengine-everywhere-src-5.15.2.tar.xz) = c8afca0e43d84f7bd595436fbe4d13a5bbdb81ec5104d605085d07545b6f91e0
|
||||
SIZE (KDE/Qt/5.15.2/qtwebengine-everywhere-src-5.15.2.tar.xz) = 280142544
|
||||
TIMESTAMP = 1673702204
|
||||
SHA256 (KDE/Qt/5.15.8/qtwebengine-everywhere-opensource-src-5.15.8.tar.xz) = 4f56dcab592a8e44c93951fb9d4840b5f73fd80ec2776979d38e42abca2b61e3
|
||||
SIZE (KDE/Qt/5.15.8/qtwebengine-everywhere-opensource-src-5.15.8.tar.xz) = 316379144
|
||||
|
11
www/qt5-webengine/files/extra-patch-no-mempcpy-nasm
Normal file
11
www/qt5-webengine/files/extra-patch-no-mempcpy-nasm
Normal file
@ -0,0 +1,11 @@
|
||||
--- src/3rdparty/chromium/third_party/nasm/config/config-linux.h.orig 2022-06-08 06:40:31 UTC
|
||||
+++ src/3rdparty/chromium/third_party/nasm/config/config-linux.h
|
||||
@@ -336,7 +336,7 @@
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the `mempcpy' function. */
|
||||
-#define HAVE_MEMPCPY 1
|
||||
+/* #undef HAVE_MEMPCPY */
|
||||
|
||||
/* Define to 1 if you have a working `mmap' system call. */
|
||||
#define HAVE_MMAP 1
|
@ -4,8 +4,3 @@ gn_args += enable_basic_printing=true \
|
||||
enable_print_preview=true \
|
||||
use_dbus=true \
|
||||
use_udev=false
|
||||
|
||||
# Once the port works better, we can think about readding the diverse `use_system_<foo>`
|
||||
# for bundled libraries.
|
||||
# For now, only add very few system libraries.
|
||||
gn_args += use_system_yasm=true
|
||||
|
@ -1,40 +0,0 @@
|
||||
--- src/3rdparty/chromium/base/strings/safe_sprintf_unittest.cc.orig 2018-11-13 18:25:11 UTC
|
||||
+++ src/3rdparty/chromium/base/strings/safe_sprintf_unittest.cc
|
||||
@@ -730,6 +730,7 @@ TEST(SafeSPrintfTest, EmbeddedNul) {
|
||||
}
|
||||
|
||||
TEST(SafeSPrintfTest, EmitNULL) {
|
||||
+/* Avoid compiler error: http://pastebin.com/1edWUE84
|
||||
char buf[40];
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
@@ -741,6 +742,7 @@ TEST(SafeSPrintfTest, EmitNULL) {
|
||||
EXPECT_EQ("0x0", std::string(buf));
|
||||
EXPECT_EQ(6, SafeSPrintf(buf, "%s", NULL));
|
||||
EXPECT_EQ("<NULL>", std::string(buf));
|
||||
+*/
|
||||
#if defined(__GCC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
--- src/3rdparty/chromium/base/threading/thread_local_storage_unittest.cc.orig 2018-11-13 18:25:11 UTC
|
||||
+++ src/3rdparty/chromium/base/threading/thread_local_storage_unittest.cc
|
||||
@@ -86,7 +86,7 @@ class ThreadLocalStorageRunner : public DelegateSimple
|
||||
void ThreadLocalStorageCleanup(void *value) {
|
||||
int *ptr = reinterpret_cast<int*>(value);
|
||||
// Destructors should never be called with a NULL.
|
||||
- ASSERT_NE(reinterpret_cast<int*>(NULL), ptr);
|
||||
+ ASSERT_NE(static_cast<int*>(NULL), ptr);
|
||||
if (*ptr == kFinalTlsValue)
|
||||
return; // We've been called enough times.
|
||||
ASSERT_LT(kFinalTlsValue, *ptr);
|
||||
--- src/3rdparty/chromium/media/audio/audio_output_proxy_unittest.cc.orig 2018-11-13 18:25:11 UTC
|
||||
+++ src/3rdparty/chromium/media/audio/audio_output_proxy_unittest.cc
|
||||
@@ -410,7 +410,7 @@ class AudioOutputProxyTest : public testing::Test {
|
||||
// |stream| is closed at this point. Start() should reopen it again.
|
||||
EXPECT_CALL(manager(), MakeAudioOutputStream(_, _, _))
|
||||
.Times(2)
|
||||
- .WillRepeatedly(Return(reinterpret_cast<AudioOutputStream*>(NULL)));
|
||||
+ .WillRepeatedly(Return(static_cast<AudioOutputStream*>(NULL)));
|
||||
|
||||
EXPECT_CALL(callback_, OnError()).Times(2);
|
||||
|
@ -1,4 +1,4 @@
|
||||
--- mkspecs/features/functions.prf.orig 2020-11-07 01:22:36 UTC
|
||||
--- mkspecs/features/functions.prf.orig 2021-12-15 16:12:54 UTC
|
||||
+++ mkspecs/features/functions.prf
|
||||
@@ -84,6 +84,10 @@ defineReplace(gnWebEngineArgs) {
|
||||
include($$QTWEBENGINE_ROOT/src/buildtools/config/windows.pri)
|
||||
@ -19,15 +19,15 @@
|
||||
include($$QTWEBENGINE_ROOT/src/pdf/config/common.pri)
|
||||
isEmpty(gn_args): error(No gn_args found please make sure you have valid configuration.)
|
||||
return($$gn_args)
|
||||
@@ -106,6 +111,7 @@ defineReplace(gnArch) {
|
||||
contains(qtArch, "arm64"): return(arm64)
|
||||
@@ -107,6 +112,7 @@ defineReplace(gnArch) {
|
||||
contains(qtArch, "mips"): return(mipsel)
|
||||
contains(qtArch, "mips64"): return(mips64el)
|
||||
contains(qtArch, "mips64el"): return(mips64el)
|
||||
+ contains(qtArch, "power64"): return(ppc64)
|
||||
return(unknown)
|
||||
}
|
||||
|
||||
@@ -113,6 +119,7 @@ defineReplace(gnOS) {
|
||||
@@ -114,6 +120,7 @@ defineReplace(gnOS) {
|
||||
macos: return(mac)
|
||||
win32: return(win)
|
||||
linux: return(linux)
|
||||
|
@ -1,15 +1,15 @@
|
||||
--- src/3rdparty/chromium/BUILD.gn.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/BUILD.gn.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/BUILD.gn
|
||||
@@ -419,7 +419,7 @@ group("gn_all") {
|
||||
@@ -423,7 +423,7 @@ group("gn_all") {
|
||||
]
|
||||
}
|
||||
|
||||
- if (is_linux || is_android) {
|
||||
+ if ((is_linux && !is_bsd) || is_android) {
|
||||
- if (is_linux || is_chromeos || is_android) {
|
||||
+ if ((is_linux && !is_bsd) || is_chromeos || is_android) {
|
||||
deps += [
|
||||
"//third_party/breakpad:breakpad_unittests",
|
||||
"//third_party/breakpad:core-2-minidump",
|
||||
@@ -460,8 +460,6 @@ group("gn_all") {
|
||||
@@ -464,8 +464,6 @@ group("gn_all") {
|
||||
"//net:disk_cache_memory_test",
|
||||
"//net:quic_client",
|
||||
"//net:quic_server",
|
||||
@ -18,7 +18,7 @@
|
||||
"//testing:empty_main",
|
||||
]
|
||||
|
||||
@@ -516,10 +514,6 @@ group("gn_all") {
|
||||
@@ -520,10 +518,6 @@ group("gn_all") {
|
||||
"//chrome/test:load_library_perf_tests",
|
||||
"//chrome/test:sync_performance_tests",
|
||||
"//chrome/test/chromedriver:chromedriver",
|
||||
@ -29,7 +29,7 @@
|
||||
"//media/cast:generate_barcode_video",
|
||||
"//media/cast:generate_timecode_audio",
|
||||
"//net:crash_cache",
|
||||
@@ -592,10 +586,6 @@ group("gn_all") {
|
||||
@@ -595,10 +589,6 @@ group("gn_all") {
|
||||
"//mojo:mojo_perftests",
|
||||
"//services/service_manager/public/cpp",
|
||||
"//testing/gmock:gmock_main",
|
||||
@ -40,7 +40,7 @@
|
||||
]
|
||||
|
||||
if (!is_android) {
|
||||
@@ -669,7 +659,7 @@ group("gn_all") {
|
||||
@@ -676,7 +666,7 @@ group("gn_all") {
|
||||
host_os == "win" && !use_qt) {
|
||||
deps += [ "//chrome/test/mini_installer:mini_installer_tests" ]
|
||||
}
|
||||
@ -49,16 +49,25 @@
|
||||
deps += [ "//third_party/breakpad:symupload($host_toolchain)" ]
|
||||
}
|
||||
|
||||
@@ -802,7 +792,6 @@ group("gn_all") {
|
||||
@@ -691,7 +681,7 @@ group("gn_all") {
|
||||
}
|
||||
}
|
||||
|
||||
- if (is_mac || is_win || is_android || (is_linux && !is_chromeos)) {
|
||||
+ if (is_mac || is_win || is_android || (is_linux && !is_chromeos && !is_bsd)) {
|
||||
deps += [
|
||||
"//third_party/crashpad/crashpad:crashpad_tests",
|
||||
"//third_party/crashpad/crashpad/handler:crashpad_handler",
|
||||
@@ -810,7 +800,6 @@ group("gn_all") {
|
||||
"//chrome/browser/vr:vr_common_perftests",
|
||||
"//chrome/browser/vr:vr_common_unittests",
|
||||
"//chrome/browser/vr:vr_pixeltests",
|
||||
- "//tools/perf/contrib/vr_benchmarks:vr_perf_tests",
|
||||
]
|
||||
if (is_desktop_linux && use_ozone) {
|
||||
deps += [ "//chrome/browser/vr/testapp:vr_testapp" ]
|
||||
@@ -1085,7 +1074,7 @@ if (!is_ios && !use_qt) {
|
||||
]
|
||||
if (is_android) {
|
||||
deps += [ "//chrome/browser/android/vr:vr_android_unittests" ]
|
||||
@@ -1103,7 +1092,7 @@ if (!is_ios && !use_qt) {
|
||||
data_deps += [ "//content/web_test:web_test_common_mojom_js_data_deps" ]
|
||||
}
|
||||
|
||||
- if (!is_win && !is_android) {
|
||||
@ -66,16 +75,16 @@
|
||||
data_deps +=
|
||||
[ "//third_party/breakpad:minidump_stackwalk($host_toolchain)" ]
|
||||
}
|
||||
@@ -1094,7 +1083,7 @@ if (!is_ios && !use_qt) {
|
||||
@@ -1112,7 +1101,7 @@ if (!is_ios && !use_qt) {
|
||||
data_deps += [ "//third_party/breakpad:dump_syms($host_toolchain)" ]
|
||||
}
|
||||
|
||||
- if (is_linux) {
|
||||
+ if (is_linux && !is_bsd) {
|
||||
- if (is_linux || is_chromeos) {
|
||||
+ if ((is_linux && !is_bsd) || is_chromeos) {
|
||||
data_deps += [ "//third_party/breakpad:dump_syms($host_toolchain)" ]
|
||||
}
|
||||
|
||||
@@ -1286,9 +1275,6 @@ group("chromium_builder_perf") {
|
||||
@@ -1308,9 +1297,6 @@ group("chromium_builder_perf") {
|
||||
|
||||
if (is_win) {
|
||||
data_deps += [ "//chrome/installer/mini_installer:mini_installer" ]
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- src/3rdparty/chromium/base/BUILD.gn.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/base/BUILD.gn.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/BUILD.gn
|
||||
@@ -59,7 +59,7 @@ declare_args() {
|
||||
@@ -54,7 +54,7 @@ declare_args() {
|
||||
# replacement base::Location::Current(). On by default in non-official builds
|
||||
# for testing purposes.
|
||||
# TODO(https://crbug.com/974061): remove this eventually.
|
||||
@ -9,20 +9,19 @@
|
||||
|
||||
# Unsafe developer build. Has developer-friendly features that may weaken or
|
||||
# disable security measures like sandboxing or ASLR.
|
||||
@@ -929,7 +929,7 @@ jumbo_component("base") {
|
||||
@@ -886,7 +886,7 @@ jumbo_component("base") {
|
||||
"timer/hi_res_timer_manager_posix.cc",
|
||||
]
|
||||
|
||||
- if (!is_nacl && !is_mac && !is_ios) {
|
||||
+ if (!is_nacl && !is_mac && !is_ios && !is_bsd) {
|
||||
- if (!is_nacl && !is_apple) {
|
||||
+ if (!is_nacl && !is_apple && !is_bsd) {
|
||||
sources += [
|
||||
"profiler/stack_copier_signal.cc",
|
||||
"profiler/stack_copier_signal.h",
|
||||
@@ -938,6 +938,12 @@ jumbo_component("base") {
|
||||
"cpu_affinity_posix.cc",
|
||||
"cpu_affinity_posix.h",
|
||||
@@ -897,6 +897,11 @@ jumbo_component("base") {
|
||||
"profiler/thread_delegate_posix.h",
|
||||
]
|
||||
}
|
||||
+
|
||||
+ if (is_bsd) {
|
||||
+ sources += [
|
||||
+ "profiler/stack_sampler_posix.cc",
|
||||
@ -30,41 +29,34 @@
|
||||
+ }
|
||||
}
|
||||
|
||||
jumbo_excluded_sources = []
|
||||
@@ -1239,7 +1245,13 @@ jumbo_component("base") {
|
||||
jumbo_excluded_sources = [
|
||||
@@ -1213,7 +1218,6 @@ jumbo_component("base") {
|
||||
"process/process_metrics_linux.cc",
|
||||
"threading/platform_thread_linux.cc",
|
||||
]
|
||||
- jumbo_excluded_sources += [ "process/memory_linux.cc" ]
|
||||
+ # Omit this because it will be excluded via "is_bsd" further down in
|
||||
+ # this file
|
||||
+ # jumbo_excluded_sources += [ "process/memory_linux.cc" ]
|
||||
+ # ...but remove the following files from jumbo merge otherwise it will
|
||||
+ # emit errors of redefined variables
|
||||
+ jumbo_excluded_sources += [ "metrics/histogram.cc" ]
|
||||
+ jumbo_excluded_sources += [ "metrics/sparse_histogram.cc" ]
|
||||
}
|
||||
|
||||
if (!is_nacl) {
|
||||
@@ -1324,7 +1336,7 @@ jumbo_component("base") {
|
||||
# Needed for <atomic> if using newer C++ library than sysroot, except if
|
||||
# building inside the cros_sdk environment - use host_toolchain as a
|
||||
# more robust check for this.
|
||||
- if (!use_sysroot && (is_android || (is_linux && !is_chromecast && !use_qt)) &&
|
||||
+ if (!use_sysroot && (is_android || (is_linux && !is_chromecast && !use_qt) && !is_clang) &&
|
||||
host_toolchain != "//build/toolchain/cros:host") {
|
||||
libs += [ "atomic" ]
|
||||
}
|
||||
@@ -1350,7 +1362,7 @@ jumbo_component("base") {
|
||||
"allocator/allocator_shim_override_glibc_weak_symbols.h",
|
||||
]
|
||||
deps += [ "//base/allocator:tcmalloc" ]
|
||||
- } else if (is_linux && use_allocator == "none") {
|
||||
+ } else if ((is_linux && !is_bsd) && use_allocator == "none") {
|
||||
sources += [ "allocator/allocator_shim_default_dispatch_to_glibc.cc" ]
|
||||
} else if (is_android && use_allocator == "none") {
|
||||
sources += [
|
||||
@@ -1947,6 +1959,33 @@ jumbo_component("base") {
|
||||
@@ -1355,7 +1359,7 @@ jumbo_component("base") {
|
||||
"allocator/allocator_shim_default_dispatch_to_mac_zoned_malloc.cc",
|
||||
]
|
||||
}
|
||||
- if (is_chromeos || is_linux) {
|
||||
+ if ((is_chromeos || is_linux) && !is_bsd) {
|
||||
sources += [ "allocator/allocator_shim_default_dispatch_to_glibc.cc" ]
|
||||
}
|
||||
if (is_win) {
|
||||
@@ -1826,7 +1830,7 @@ jumbo_component("base") {
|
||||
]
|
||||
}
|
||||
|
||||
- if (is_linux || is_chromeos || is_android) {
|
||||
+ if ((is_linux || is_chromeos || is_android) && !is_bsd) {
|
||||
sources += [
|
||||
"allocator/partition_allocator/spinning_futex_linux.cc",
|
||||
"allocator/partition_allocator/spinning_futex_linux.h",
|
||||
@@ -1982,6 +1986,34 @@ jumbo_component("base") {
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,29 +86,26 @@
|
||||
+ "util" # process_metrics_freebsd
|
||||
+ ]
|
||||
+ }
|
||||
+
|
||||
+
|
||||
# iOS
|
||||
if (is_ios) {
|
||||
sources -= [
|
||||
@@ -2903,7 +2942,7 @@ test("base_unittests") {
|
||||
@@ -3095,7 +3127,7 @@ test("base_unittests") {
|
||||
]
|
||||
}
|
||||
|
||||
- if (is_linux || is_chromeos) {
|
||||
+ if ((is_linux || is_chromeos) && !is_bsd) {
|
||||
sources += [ "debug/proc_maps_linux_unittest.cc" ]
|
||||
}
|
||||
|
||||
@@ -3136,7 +3168,7 @@ test("base_unittests") {
|
||||
"posix/unix_domain_socket_unittest.cc",
|
||||
"task/thread_pool/task_tracker_posix_unittest.cc",
|
||||
]
|
||||
- if (!is_nacl && !is_mac && !is_ios) {
|
||||
+ if (!is_nacl && !is_mac && !is_ios && !is_bsd) {
|
||||
sources += [ "profiler/stack_copier_signal_unittest.cc" ]
|
||||
}
|
||||
}
|
||||
@@ -3092,6 +3131,12 @@ test("base_unittests") {
|
||||
|
||||
manifest = "//build/config/fuchsia/tests.cmx"
|
||||
}
|
||||
+
|
||||
+ if (is_bsd) {
|
||||
+ sources -= [
|
||||
+ "debug/proc_maps_linux_unittest.cc",
|
||||
+ ]
|
||||
+ }
|
||||
|
||||
if (!is_fuchsia && !is_ios) {
|
||||
sources += [ "files/file_locking_unittest.cc" ]
|
||||
- if (!is_nacl && !is_apple) {
|
||||
+ if (!is_nacl && !is_apple && !is_bsd) {
|
||||
sources += [
|
||||
"cpu_affinity_posix_unittest.cc",
|
||||
"profiler/stack_copier_signal_unittest.cc",
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- src/3rdparty/chromium/base/allocator/allocator_shim.cc.orig 2019-11-27 21:12:25 UTC
|
||||
+++ src/3rdparty/chromium/base/allocator/allocator_shim.cc
|
||||
@@ -70,7 +70,7 @@ inline const base::allocator::AllocatorDispatch* GetCh
|
||||
// Unfortunately due to that bug NoBarrier_Load() is mistakenly fully
|
||||
// barriered on Linux+Clang, and that causes visible perf regressons.
|
||||
return reinterpret_cast<const base::allocator::AllocatorDispatch*>(
|
||||
-#if defined(OS_LINUX) && defined(__clang__)
|
||||
+#if (defined(OS_BSD) || defined(OS_LINUX)) && defined(__clang__)
|
||||
*static_cast<const volatile base::subtle::AtomicWord*>(&g_chain_head)
|
||||
#else
|
||||
base::subtle::NoBarrier_Load(&g_chain_head)
|
@ -1,7 +1,7 @@
|
||||
--- src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc.orig 2019-11-27 21:12:25 UTC
|
||||
--- src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
|
||||
@@ -5,18 +5,28 @@
|
||||
#include "base/allocator/allocator_shim.h"
|
||||
@@ -6,18 +6,28 @@
|
||||
#include "base/compiler_specific.h"
|
||||
|
||||
#include <dlfcn.h>
|
||||
-#include <malloc.h>
|
||||
@ -36,7 +36,7 @@
|
||||
} // extern "C"
|
||||
|
||||
namespace {
|
||||
@@ -24,32 +34,32 @@ namespace {
|
||||
@@ -25,32 +35,32 @@ void* GlibcMalloc(const AllocatorDispatch*, size_t siz
|
||||
using base::allocator::AllocatorDispatch;
|
||||
|
||||
void* GlibcMalloc(const AllocatorDispatch*, size_t size, void* context) {
|
||||
@ -73,4 +73,4 @@
|
||||
+ __free(address);
|
||||
}
|
||||
|
||||
size_t GlibcGetSizeEstimate(const AllocatorDispatch*,
|
||||
NO_SANITIZE("cfi-icall")
|
||||
|
@ -1,45 +0,0 @@
|
||||
--- src/3rdparty/chromium/base/allocator/allocator_shim_unittest.cc.orig 2018-11-13 18:25:11 UTC
|
||||
+++ src/3rdparty/chromium/base/allocator/allocator_shim_unittest.cc
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "base/allocator/allocator_interception_mac.h"
|
||||
#include "base/mac/mac_util.h"
|
||||
#include "third_party/apple_apsl/malloc.h"
|
||||
-#else
|
||||
+#elif !defined(OS_BSD)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
@@ -294,7 +294,7 @@ TEST_F(AllocatorShimTest, InterceptLibcSymbols) {
|
||||
ASSERT_GE(aligned_allocs_intercepted_by_size[61], 1u);
|
||||
#endif // !OS_WIN
|
||||
|
||||
-#if !defined(OS_WIN) && !defined(OS_MACOSX)
|
||||
+#if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(OS_BSD)
|
||||
void* memalign_ptr = memalign(128, 53);
|
||||
ASSERT_NE(nullptr, memalign_ptr);
|
||||
ASSERT_EQ(0u, reinterpret_cast<uintptr_t>(memalign_ptr) % 128);
|
||||
@@ -307,7 +307,7 @@ TEST_F(AllocatorShimTest, InterceptLibcSymbols) {
|
||||
ASSERT_GE(aligned_allocs_intercepted_by_alignment[kPageSize], 1u);
|
||||
// pvalloc rounds the size up to the next page.
|
||||
ASSERT_GE(aligned_allocs_intercepted_by_size[kPageSize], 1u);
|
||||
-#endif // !OS_WIN && !OS_MACOSX
|
||||
+#endif // !OS_WIN && !OS_MACOSX && !OS_BSD
|
||||
|
||||
char* realloc_ptr = static_cast<char*>(malloc(10));
|
||||
strcpy(realloc_ptr, "foobar");
|
||||
@@ -323,13 +323,13 @@ TEST_F(AllocatorShimTest, InterceptLibcSymbols) {
|
||||
free(zero_alloc_ptr);
|
||||
ASSERT_GE(frees_intercepted_by_addr[Hash(zero_alloc_ptr)], 1u);
|
||||
|
||||
-#if !defined(OS_WIN) && !defined(OS_MACOSX)
|
||||
+#if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(OS_BSD)
|
||||
free(memalign_ptr);
|
||||
ASSERT_GE(frees_intercepted_by_addr[Hash(memalign_ptr)], 1u);
|
||||
|
||||
free(pvalloc_ptr);
|
||||
ASSERT_GE(frees_intercepted_by_addr[Hash(pvalloc_ptr)], 1u);
|
||||
-#endif // !OS_WIN && !OS_MACOSX
|
||||
+#endif // !OS_WIN && !OS_MACOSX && !OS_BSD
|
||||
|
||||
#if !defined(OS_WIN)
|
||||
free(posix_memalign_ptr);
|
@ -1,11 +1,11 @@
|
||||
--- src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_internals_posix.h.orig 2019-11-27 21:12:25 UTC
|
||||
--- src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_internals_posix.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_internals_posix.h
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include <mach/mach.h>
|
||||
@@ -24,7 +24,7 @@
|
||||
#if defined(OS_ANDROID)
|
||||
#include <sys/prctl.h>
|
||||
#endif
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_BSD) || defined(OS_LINUX)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
#include <sys/resource.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
@ -0,0 +1,12 @@
|
||||
--- src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
|
||||
@@ -202,6 +202,9 @@ void PartitionAllocGlobalInit(OomFunction on_out_of_me
|
||||
// Check that some of our zanier calculations worked out as expected.
|
||||
#if ENABLE_TAG_FOR_MTE_CHECKED_PTR
|
||||
static_assert(kSmallestBucket >= kAlignment, "generic smallest bucket");
|
||||
+#elif defined(__i386__) && defined(OS_FREEBSD)
|
||||
+ // alignof(std::max_align_t) is only 4 on FreeBSD/i386
|
||||
+ static_assert(kSmallestBucket >= kAlignment, "generic smallest bucket");
|
||||
#else
|
||||
static_assert(kSmallestBucket == kAlignment, "generic smallest bucket");
|
||||
#endif
|
@ -1,20 +1,20 @@
|
||||
--- src/3rdparty/chromium/base/base_switches.cc.orig 2019-11-27 21:12:25 UTC
|
||||
--- src/3rdparty/chromium/base/base_switches.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/base_switches.cc
|
||||
@@ -114,7 +114,7 @@ const char kWaitForDebugger[] = "wait-for-debugger";
|
||||
@@ -117,7 +117,7 @@ const char kDisableUsbKeyboardDetect[] = "disable
|
||||
const char kDisableUsbKeyboardDetect[] = "disable-usb-keyboard-detect";
|
||||
#endif
|
||||
|
||||
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
|
||||
+#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !BUILDFLAG(IS_LACROS)
|
||||
+#if (defined(OS_LINUX) && !defined(OS_CHROMEOS) && !BUILDFLAG(IS_LACROS)) || defined(OS_BSD)
|
||||
// The /dev/shm partition is too small in certain VM environments, causing
|
||||
// Chrome to fail or crash (see http://crbug.com/715363). Use this flag to
|
||||
// work-around this issue (a temporary directory will always be used to create
|
||||
@@ -135,7 +135,7 @@ const char kEnableCrashReporterForTesting[] =
|
||||
const char kEnableReachedCodeProfiler[] = "enable-reached-code-profiler";
|
||||
@@ -152,7 +152,7 @@ const char kForceFieldTrialParams[] = "force-fieldtria
|
||||
|
||||
#endif
|
||||
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
// Controls whether or not retired instruction counts are surfaced for threads
|
||||
// in trace events on Linux.
|
||||
//
|
||||
|
@ -1,20 +1,20 @@
|
||||
--- src/3rdparty/chromium/base/base_switches.h.orig 2019-11-27 21:12:25 UTC
|
||||
--- src/3rdparty/chromium/base/base_switches.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/base_switches.h
|
||||
@@ -37,7 +37,7 @@ extern const char kWaitForDebugger[];
|
||||
@@ -39,7 +39,7 @@ extern const char kDisableUsbKeyboardDetect[];
|
||||
extern const char kDisableUsbKeyboardDetect[];
|
||||
#endif
|
||||
|
||||
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
|
||||
+#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !BUILDFLAG(IS_LACROS)
|
||||
+#if (defined(OS_LINUX) && !defined(OS_CHROMEOS) && !BUILDFLAG(IS_LACROS)) || defined(OS_BSD)
|
||||
extern const char kDisableDevShmUsage[];
|
||||
#endif
|
||||
|
||||
@@ -50,7 +50,7 @@ extern const char kEnableReachedCodeProfiler[];
|
||||
extern const char kOrderfileMemoryOptimization[];
|
||||
@@ -55,7 +55,7 @@ extern const char kForceFieldTrialParams[];
|
||||
extern const char kForceFieldTrialParams[];
|
||||
#endif
|
||||
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
extern const char kEnableThreadInstructionCount[];
|
||||
#endif
|
||||
|
||||
|
@ -1,38 +1,44 @@
|
||||
--- src/3rdparty/chromium/base/cpu.cc.orig 2019-11-27 21:12:25 UTC
|
||||
--- src/3rdparty/chromium/base/cpu.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/cpu.cc
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "base/stl_util.h"
|
||||
#include "build/build_config.h"
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
-#if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX))
|
||||
+#if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_BSD))
|
||||
#include "base/stl_util.h"
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) || \
|
||||
defined(OS_AIX)
|
||||
#include "base/containers/flat_set.h"
|
||||
#include "base/files/file_util.h"
|
||||
@@ -31,7 +31,7 @@
|
||||
#endif
|
||||
|
||||
#if defined(ARCH_CPU_ARM_FAMILY) && \
|
||||
- (defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS))
|
||||
+ (defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS))
|
||||
#include "base/files/file_util.h"
|
||||
#endif
|
||||
|
||||
@@ -98,7 +98,7 @@ uint64_t xgetbv(uint32_t xcr) {
|
||||
@@ -182,6 +182,14 @@ std::string* CpuInfoBrand() {
|
||||
|
||||
#endif // ARCH_CPU_X86_FAMILY
|
||||
|
||||
-#if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX))
|
||||
+#if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_BSD))
|
||||
std::string* CpuInfoBrand() {
|
||||
static std::string* brand = []() {
|
||||
// This function finds the value from /proc/cpuinfo under the key "model
|
||||
@@ -128,7 +128,7 @@ std::string* CpuInfoBrand() {
|
||||
return brand;
|
||||
}
|
||||
+#elif defined(OS_BSD)
|
||||
+std::string* CpuInfoBrand() {
|
||||
+ static std::string* brand = []() {
|
||||
+ return new std::string(SysInfo::CPUModelName());
|
||||
+ }();
|
||||
+
|
||||
+ return brand;
|
||||
+}
|
||||
#endif // defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) ||
|
||||
- // defined(OS_LINUX))
|
||||
+ // defined(OS_LINUX) || defined(OS_BSD))
|
||||
// defined(OS_LINUX) || defined(OS_CHROMEOS))
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -252,7 +252,7 @@ void CPU::Initialize() {
|
||||
@@ -305,7 +313,7 @@ void CPU::Initialize() {
|
||||
}
|
||||
}
|
||||
#elif defined(ARCH_CPU_ARM_FAMILY)
|
||||
-#if (defined(OS_ANDROID) || defined(OS_LINUX))
|
||||
+#if (defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_BSD))
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
cpu_brand_ = *CpuInfoBrand();
|
||||
#elif defined(OS_WIN)
|
||||
// Windows makes high-resolution thread timing information available in
|
||||
|
@ -0,0 +1,20 @@
|
||||
--- src/3rdparty/chromium/base/cpu.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/cpu.h
|
||||
@@ -73,7 +73,7 @@ class BASE_EXPORT CPU final {
|
||||
IntelMicroArchitecture GetIntelMicroArchitecture() const;
|
||||
const std::string& cpu_brand() const { return cpu_brand_; }
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) || \
|
||||
defined(OS_AIX)
|
||||
enum class CoreType {
|
||||
kUnknown = 0,
|
||||
@@ -124,7 +124,7 @@ class BASE_EXPORT CPU final {
|
||||
// cpuidle driver.
|
||||
using CoreIdleTimes = std::vector<TimeDelta>;
|
||||
static bool GetCumulativeCoreIdleTimes(CoreIdleTimes&);
|
||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) ||
|
||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
// defined(OS_AIX)
|
||||
|
||||
private:
|
@ -1,6 +1,6 @@
|
||||
--- src/3rdparty/chromium/base/debug/debugger_posix.cc.orig 2019-05-23 12:39:34 UTC
|
||||
--- src/3rdparty/chromium/base/debug/debugger_posix.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/debug/debugger_posix.cc
|
||||
@@ -86,7 +86,7 @@ bool BeingDebugged() {
|
||||
@@ -98,7 +98,7 @@ bool BeingDebugged() {
|
||||
KERN_PROC,
|
||||
KERN_PROC_PID,
|
||||
getpid()
|
||||
@ -9,7 +9,7 @@
|
||||
, sizeof(struct kinfo_proc),
|
||||
0
|
||||
#endif
|
||||
@@ -94,33 +94,35 @@ bool BeingDebugged() {
|
||||
@@ -106,33 +106,35 @@ bool BeingDebugged() {
|
||||
|
||||
// Caution: struct kinfo_proc is marked __APPLE_API_UNSTABLE. The source and
|
||||
// binary interfaces may change.
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- src/3rdparty/chromium/base/debug/elf_reader.cc.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/base/debug/elf_reader.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/debug/elf_reader.cc
|
||||
@@ -35,7 +35,9 @@ using Nhdr = Elf64_Nhdr;
|
||||
@@ -38,7 +38,9 @@ using Word = Elf64_Word;
|
||||
using Word = Elf64_Word;
|
||||
#endif
|
||||
|
||||
@ -8,9 +8,9 @@
|
||||
constexpr char kGnuNoteName[] = "GNU";
|
||||
+#endif
|
||||
|
||||
// Returns a pointer to the header of the ELF binary mapped into memory,
|
||||
// or a null pointer if the header is invalid.
|
||||
@@ -98,6 +100,7 @@ size_t ReadElfBuildId(const void* elf_mapped_base,
|
||||
// Returns a pointer to the header of the ELF binary mapped into memory, or a
|
||||
// null pointer if the header is invalid. Here and below |elf_mapped_base| is a
|
||||
@@ -75,6 +77,7 @@ size_t ReadElfBuildId(const void* elf_mapped_base,
|
||||
bool found = false;
|
||||
while (current_section < section_end) {
|
||||
current_note = reinterpret_cast<const Nhdr*>(current_section);
|
||||
@ -18,7 +18,7 @@
|
||||
if (current_note->n_type == NT_GNU_BUILD_ID) {
|
||||
StringPiece note_name(current_section + sizeof(Nhdr),
|
||||
current_note->n_namesz);
|
||||
@@ -107,6 +110,7 @@ size_t ReadElfBuildId(const void* elf_mapped_base,
|
||||
@@ -84,6 +87,7 @@ size_t ReadElfBuildId(const void* elf_mapped_base,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,15 @@
|
||||
--- src/3rdparty/chromium/base/debug/proc_maps_linux.cc.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/base/debug/proc_maps_linux.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/debug/proc_maps_linux.cc
|
||||
@@ -12,7 +12,7 @@
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "base/strings/string_split.h"
|
||||
#include "build/build_config.h"
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_ANDROID)
|
||||
+#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_ANDROID)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
@@ -28,6 +28,11 @@
|
||||
@@ -29,6 +29,11 @@ namespace debug {
|
||||
namespace base {
|
||||
namespace debug {
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
// Scans |proc_maps| starting from |pos| returning true if the gate VMA was
|
||||
// found, otherwise returns false.
|
||||
static bool ContainsGateVMA(std::string* proc_maps, size_t pos) {
|
||||
@@ -43,15 +48,16 @@ static bool ContainsGateVMA(std::string* proc_maps, si
|
||||
@@ -44,15 +49,16 @@ static bool ContainsGateVMA(std::string* proc_maps, si
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
@ -40,7 +40,7 @@
|
||||
return false;
|
||||
}
|
||||
proc_maps->clear();
|
||||
@@ -65,7 +71,7 @@ bool ReadProcMaps(std::string* proc_maps) {
|
||||
@@ -66,7 +72,7 @@ bool ReadProcMaps(std::string* proc_maps) {
|
||||
|
||||
ssize_t bytes_read = HANDLE_EINTR(read(fd.get(), buffer, kReadSize));
|
||||
if (bytes_read < 0) {
|
||||
@ -49,7 +49,7 @@
|
||||
proc_maps->clear();
|
||||
return false;
|
||||
}
|
||||
@@ -76,6 +82,7 @@ bool ReadProcMaps(std::string* proc_maps) {
|
||||
@@ -77,6 +83,7 @@ bool ReadProcMaps(std::string* proc_maps) {
|
||||
if (bytes_read == 0)
|
||||
break;
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
// The gate VMA is handled as a special case after seq_file has finished
|
||||
// iterating through all entries in the virtual memory table.
|
||||
//
|
||||
@@ -86,6 +93,7 @@ bool ReadProcMaps(std::string* proc_maps) {
|
||||
@@ -87,6 +94,7 @@ bool ReadProcMaps(std::string* proc_maps) {
|
||||
// Avoid this by searching for the gate VMA and breaking early.
|
||||
if (ContainsGateVMA(proc_maps, pos))
|
||||
break;
|
||||
@ -65,7 +65,7 @@
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -114,10 +122,32 @@ bool ParseProcMaps(const std::string& input,
|
||||
@@ -115,10 +123,32 @@ bool ParseProcMaps(const std::string& input,
|
||||
MappedMemoryRegion region;
|
||||
const char* line = lines[i].c_str();
|
||||
char permissions[5] = {'\0'}; // Ensure NUL-terminated string.
|
||||
@ -99,7 +99,7 @@
|
||||
|
||||
// Sample format from man 5 proc:
|
||||
//
|
||||
@@ -133,6 +163,7 @@ bool ParseProcMaps(const std::string& input,
|
||||
@@ -134,6 +164,7 @@ bool ParseProcMaps(const std::string& input,
|
||||
DPLOG(WARNING) << "sscanf failed for line: " << line;
|
||||
return false;
|
||||
}
|
||||
@ -107,7 +107,7 @@
|
||||
|
||||
region.permissions = 0;
|
||||
|
||||
@@ -151,14 +182,31 @@ bool ParseProcMaps(const std::string& input,
|
||||
@@ -152,14 +183,31 @@ bool ParseProcMaps(const std::string& input,
|
||||
else if (permissions[2] != '-')
|
||||
return false;
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
--- src/3rdparty/chromium/base/debug/stack_trace.cc.orig 2019-05-23 12:39:34 UTC
|
||||
--- src/3rdparty/chromium/base/debug/stack_trace.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/debug/stack_trace.cc
|
||||
@@ -14,7 +14,7 @@
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#if BUILDFLAG(CAN_UNWIND_WITH_FRAME_POINTERS)
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_ANDROID)
|
||||
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
#include <pthread.h>
|
||||
#include "base/process/process_handle.h"
|
||||
#include "base/threading/platform_thread.h"
|
||||
|
@ -1,11 +1,11 @@
|
||||
--- src/3rdparty/chromium/base/debug/stack_trace_posix.cc.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/base/debug/stack_trace_posix.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/debug/stack_trace_posix.cc
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <AvailabilityMacros.h>
|
||||
#endif
|
||||
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
#include "base/debug/proc_maps_linux.h"
|
||||
#endif
|
||||
|
||||
|
@ -1,15 +0,0 @@
|
||||
--- src/3rdparty/chromium/base/files/file_path_watcher.cc.orig 2020-11-07 01:22:36 UTC
|
||||
+++ src/3rdparty/chromium/base/files/file_path_watcher.cc
|
||||
@@ -20,10 +20,10 @@ FilePathWatcher::~FilePathWatcher() {
|
||||
// static
|
||||
bool FilePathWatcher::RecursiveWatchAvailable() {
|
||||
#if (defined(OS_MACOSX) && !defined(OS_IOS)) || defined(OS_WIN) || \
|
||||
- defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_AIX)
|
||||
+ (defined(OS_LINUX) && !defined(OS_BSD)) || defined(OS_ANDROID) || defined(OS_AIX)
|
||||
return true;
|
||||
#else
|
||||
- // FSEvents isn't available on iOS.
|
||||
+ // FSEvents isn't available on iOS and the kqueue watcher.
|
||||
return false;
|
||||
#endif
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
--- src/3rdparty/chromium/base/files/file_path_watcher_unittest.cc.orig 2018-11-13 18:25:11 UTC
|
||||
+++ src/3rdparty/chromium/base/files/file_path_watcher_unittest.cc
|
||||
@@ -438,7 +438,7 @@ TEST_F(FilePathWatcherTest, WatchDirectory) {
|
||||
VLOG(1) << "Waiting for file1 creation";
|
||||
ASSERT_TRUE(WaitForEvents());
|
||||
|
||||
-#if !defined(OS_MACOSX)
|
||||
+#if !defined(OS_MACOSX) && !defined(OS_BSD)
|
||||
// Mac implementation does not detect files modified in a directory.
|
||||
ASSERT_TRUE(WriteFile(file1, "content v2"));
|
||||
VLOG(1) << "Waiting for file1 modification";
|
@ -1,11 +1,28 @@
|
||||
--- src/3rdparty/chromium/base/files/file_util.h.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/base/files/file_util.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/files/file_util.h
|
||||
@@ -445,7 +445,7 @@ BASE_EXPORT bool VerifyPathControlledByAdmin(const bas
|
||||
@@ -278,14 +278,14 @@ BASE_EXPORT bool ExecutableExistsInPath(Environment* e
|
||||
BASE_EXPORT bool ExecutableExistsInPath(Environment* env,
|
||||
const FilePath::StringType& executable);
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_AIX)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_AIX) || defined(OS_BSD)
|
||||
// Determine if files under a given |path| can be mapped and then mprotect'd
|
||||
// PROT_EXEC. This depends on the mount options used for |path|, which vary
|
||||
// among different Linux distributions and possibly local configuration. It also
|
||||
// depends on details of kernel--ChromeOS uses the noexec option for /dev/shm
|
||||
// but its kernel allows mprotect with PROT_EXEC anyway.
|
||||
BASE_EXPORT bool IsPathExecutable(const FilePath& path);
|
||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_AIX)
|
||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_AIX) || defined(OS_BSD)
|
||||
|
||||
#endif // OS_POSIX
|
||||
|
||||
@@ -592,7 +592,7 @@ BASE_EXPORT int GetMaximumPathComponentLength(const ba
|
||||
// the directory |path|, in the number of FilePath::CharType, or -1 on failure.
|
||||
BASE_EXPORT int GetMaximumPathComponentLength(const base::FilePath& path);
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_AIX)
|
||||
+#if defined(OS_LINUX) || defined(OS_AIX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_AIX)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_AIX) || defined(OS_BSD)
|
||||
// Broad categories of file systems as returned by statfs() on Linux.
|
||||
enum FileSystemType {
|
||||
FILE_SYSTEM_UNKNOWN, // statfs failed.
|
||||
|
@ -1,11 +1,60 @@
|
||||
--- src/3rdparty/chromium/base/files/file_util_posix.cc.orig 2019-05-23 12:39:34 UTC
|
||||
--- src/3rdparty/chromium/base/files/file_util_posix.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/files/file_util_posix.cc
|
||||
@@ -407,7 +407,7 @@ bool CopyDirectoryExcl(const FilePath& from_path,
|
||||
#endif // !defined(OS_NACL_NONSFI)
|
||||
@@ -412,7 +412,7 @@ bool CreateLocalNonBlockingPipe(int fds[2]) {
|
||||
}
|
||||
|
||||
bool CreateLocalNonBlockingPipe(int fds[2]) {
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
return pipe2(fds, O_CLOEXEC | O_NONBLOCK) == 0;
|
||||
#else
|
||||
int raw_fds[2];
|
||||
@@ -947,8 +947,12 @@ bool AllocateFileRegion(File* file, int64_t offset, si
|
||||
// space. It can fail because the filesystem doesn't support it. In that case,
|
||||
// use the manual method below.
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
+#if defined(OS_BSD)
|
||||
+ if (HANDLE_EINTR(posix_fallocate(file->GetPlatformFile(), offset, size)) != -1)
|
||||
+#else
|
||||
if (HANDLE_EINTR(fallocate(file->GetPlatformFile(), 0, offset, size)) != -1)
|
||||
+#endif
|
||||
return true;
|
||||
DPLOG(ERROR) << "fallocate";
|
||||
#elif defined(OS_APPLE)
|
||||
@@ -1172,7 +1176,7 @@ PrefetchResult PreReadFile(const FilePath& file_path,
|
||||
// posix_fadvise() is only available in the Android NDK in API 21+. Older
|
||||
// versions may have the required kernel support, but don't have enough usage
|
||||
// to justify backporting.
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || \
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) || \
|
||||
(defined(OS_ANDROID) && __ANDROID_API__ >= 21)
|
||||
File file(file_path, File::FLAG_OPEN | File::FLAG_READ);
|
||||
if (!file.IsValid())
|
||||
@@ -1208,7 +1212,7 @@ PrefetchResult PreReadFile(const FilePath& file_path,
|
||||
return internal::PreReadFileSlow(file_path, max_bytes)
|
||||
? PrefetchResult{PrefetchResultCode::kSlowSuccess}
|
||||
: PrefetchResult{PrefetchResultCode::kSlowFailed};
|
||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || (defined(OS_ANDROID) &&
|
||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) || (defined(OS_ANDROID) &&
|
||||
// __ANDROID_API__ >= 21)
|
||||
}
|
||||
|
||||
@@ -1243,7 +1247,7 @@ bool MoveUnsafe(const FilePath& from_path, const FileP
|
||||
|
||||
#endif // !defined(OS_NACL_NONSFI)
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_AIX)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_AIX) || defined(OS_BSD)
|
||||
BASE_EXPORT bool IsPathExecutable(const FilePath& path) {
|
||||
bool result = false;
|
||||
FilePath tmp_file_path;
|
||||
@@ -1264,6 +1268,6 @@ BASE_EXPORT bool IsPathExecutable(const FilePath& path
|
||||
}
|
||||
return result;
|
||||
}
|
||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_AIX)
|
||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_AIX) || defined(OS_BSD)
|
||||
|
||||
} // namespace base
|
||||
|
@ -1,11 +1,11 @@
|
||||
--- src/3rdparty/chromium/base/files/scoped_file.cc.orig 2019-11-27 21:12:25 UTC
|
||||
--- src/3rdparty/chromium/base/files/scoped_file.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/files/scoped_file.cc
|
||||
@@ -30,7 +30,7 @@ void ScopedFDCloseTraits::Free(int fd) {
|
||||
// a single open directory would bypass the entire security model.
|
||||
int ret = IGNORE_EINTR(close(fd));
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_FUCHSIA) || \
|
||||
+#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_FUCHSIA) || defined(OS_BSD) || \
|
||||
defined(OS_ANDROID)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_APPLE) || \
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) || defined(OS_APPLE) || \
|
||||
defined(OS_FUCHSIA) || defined(OS_ANDROID)
|
||||
// NB: Some file descriptors can return errors from close() e.g. network
|
||||
// filesystems such as NFS and Linux input devices. On Linux, macOS, and
|
||||
|
@ -1,20 +1,20 @@
|
||||
--- src/3rdparty/chromium/base/i18n/icu_util.cc.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/base/i18n/icu_util.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/i18n/icu_util.cc
|
||||
@@ -49,7 +49,7 @@
|
||||
@@ -48,7 +48,7 @@
|
||||
#include "third_party/icu/source/common/unicode/unistr.h"
|
||||
#endif
|
||||
|
||||
#if defined(OS_ANDROID) || defined(OS_FUCHSIA) || \
|
||||
- (defined(OS_LINUX) && !BUILDFLAG(IS_CHROMECAST))
|
||||
+ (defined(OS_LINUX) && !BUILDFLAG(IS_CHROMECAST)) || defined(OS_BSD)
|
||||
-#if defined(OS_ANDROID) || defined(OS_FUCHSIA) || \
|
||||
+#if defined(OS_ANDROID) || defined(OS_FUCHSIA) || defined(OS_BSD) || \
|
||||
((defined(OS_LINUX) || defined(OS_CHROMEOS)) && !BUILDFLAG(IS_CHROMECAST))
|
||||
#include "third_party/icu/source/i18n/unicode/timezone.h"
|
||||
#endif
|
||||
|
||||
@@ -345,7 +345,7 @@ void InitializeIcuTimeZone() {
|
||||
fuchsia::IntlProfileWatcher::GetPrimaryTimeZoneIdForIcuInitialization();
|
||||
icu::TimeZone::adoptDefault(
|
||||
icu::TimeZone::createTimeZone(icu::UnicodeString::fromUTF8(zone_id)));
|
||||
-#elif defined(OS_LINUX) && !BUILDFLAG(IS_CHROMECAST)
|
||||
+#elif (defined(OS_LINUX) || defined(OS_BSD)) && !BUILDFLAG(IS_CHROMECAST)
|
||||
-#elif (defined(OS_LINUX) || defined(OS_CHROMEOS)) && !BUILDFLAG(IS_CHROMECAST)
|
||||
+#elif (defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)) && !BUILDFLAG(IS_CHROMECAST)
|
||||
// To respond to the time zone change properly, the default time zone
|
||||
// cache in ICU has to be populated on starting up.
|
||||
// See TimeZoneMonitorLinux::NotifyClientsFromImpl().
|
||||
|
@ -1,6 +1,14 @@
|
||||
--- src/3rdparty/chromium/base/linux_util.cc.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/base/linux_util.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/linux_util.cc
|
||||
@@ -78,6 +78,9 @@ class DistroNameGetter {
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include <iomanip>
|
||||
#include <memory>
|
||||
+#include <sstream>
|
||||
|
||||
#include "base/files/dir_reader_posix.h"
|
||||
#include "base/files/file_util.h"
|
||||
@@ -78,6 +79,9 @@ class DistroNameGetter {
|
||||
public:
|
||||
DistroNameGetter() {
|
||||
static const char* const kFilesToCheck[] = {"/etc/os-release",
|
||||
@ -10,3 +18,21 @@
|
||||
"/usr/lib/os-release"};
|
||||
for (const char* file : kFilesToCheck) {
|
||||
if (ReadDistroFromOSReleaseFile(file))
|
||||
@@ -134,6 +138,9 @@ bool GetThreadsForProcess(pid_t pid, std::vector<pid_t
|
||||
}
|
||||
|
||||
bool GetThreadsForProcess(pid_t pid, std::vector<pid_t>* tids) {
|
||||
+#if defined(OS_BSD)
|
||||
+ return false;
|
||||
+#else
|
||||
// 25 > strlen("/proc//task") + strlen(std::to_string(INT_MAX)) + 1 = 22
|
||||
char buf[25];
|
||||
strings::SafeSPrintf(buf, "/proc/%d/task", pid);
|
||||
@@ -153,6 +160,7 @@ bool GetThreadsForProcess(pid_t pid, std::vector<pid_t
|
||||
}
|
||||
|
||||
return true;
|
||||
+#endif
|
||||
}
|
||||
|
||||
pid_t FindThreadIDWithSyscall(pid_t pid, const std::string& expected_data,
|
||||
|
@ -1,15 +0,0 @@
|
||||
--- src/3rdparty/chromium/base/logging_unittest.cc.orig 2018-11-13 18:25:11 UTC
|
||||
+++ src/3rdparty/chromium/base/logging_unittest.cc
|
||||
@@ -420,10 +420,10 @@ void CheckCrashTestSighandler(int, siginfo_t* info, vo
|
||||
// need the arch-specific boilerplate below, which is inspired by breakpad.
|
||||
// At the same time, on OSX, ucontext.h is deprecated but si_addr works fine.
|
||||
uintptr_t crash_addr = 0;
|
||||
-#if defined(OS_MACOSX)
|
||||
+#if defined(OS_MACOSX) || defined(OS_BSD)
|
||||
crash_addr = reinterpret_cast<uintptr_t>(info->si_addr);
|
||||
#else // OS_POSIX && !OS_MACOSX
|
||||
- ucontext_t* context = reinterpret_cast<ucontext_t*>(context_ptr);
|
||||
+ struct ucontext_t* context = reinterpret_cast<ucontext_t*>(context_ptr);
|
||||
#if defined(ARCH_CPU_X86)
|
||||
crash_addr = static_cast<uintptr_t>(context->uc_mcontext.gregs[REG_EIP]);
|
||||
#elif defined(ARCH_CPU_X86_64)
|
@ -1,11 +1,11 @@
|
||||
--- src/3rdparty/chromium/base/memory/discardable_memory.cc.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/base/memory/discardable_memory.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/memory/discardable_memory.cc
|
||||
@@ -23,7 +23,7 @@ const base::Feature kMadvFreeDiscardableMemory{
|
||||
"MadvFreeDiscardableMemory", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
#endif // defined(OS_POSIX)
|
||||
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX)
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
const base::Feature kDiscardableMemoryBackingTrial{
|
||||
"DiscardableMemoryBackingTrial", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
@ -13,15 +13,15 @@
|
||||
DiscardableMemoryTrialGroup::kEmulatedSharedMemory,
|
||||
&kDiscardableMemoryBackingParamOptions};
|
||||
|
||||
-#endif // defined(OS_ANDROID) || defined(OS_LINUX)
|
||||
+#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
|
||||
} // namespace features
|
||||
|
||||
namespace {
|
||||
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX)
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
|
||||
DiscardableMemoryBacking GetBackingForFieldTrial() {
|
||||
DiscardableMemoryTrialGroup trial_group =
|
||||
@ -29,13 +29,13 @@
|
||||
}
|
||||
NOTREACHED();
|
||||
}
|
||||
-#endif // defined(OS_ANDROID) || defined(OS_LINUX)
|
||||
+#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
|
||||
} // namespace
|
||||
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX)
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
|
||||
// Probe capabilities of this device to determine whether we should participate
|
||||
// in the discardable memory backing trial.
|
||||
@ -43,21 +43,21 @@
|
||||
DCHECK(DiscardableMemoryBackingFieldTrialIsEnabled());
|
||||
return features::kDiscardableMemoryBackingParam.Get();
|
||||
}
|
||||
-#endif // defined(OS_ANDROID) || defined(OS_LINUX)
|
||||
+#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
|
||||
DiscardableMemory::DiscardableMemory() = default;
|
||||
|
||||
DiscardableMemory::~DiscardableMemory() = default;
|
||||
|
||||
DiscardableMemoryBacking GetDiscardableMemoryBacking() {
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX)
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
if (DiscardableMemoryBackingFieldTrialIsEnabled()) {
|
||||
return GetBackingForFieldTrial();
|
||||
}
|
||||
-#endif // defined(OS_ANDROID) || defined(OS_LINUX)
|
||||
+#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
if (ashmem_device_is_supported())
|
||||
|
@ -1,11 +1,11 @@
|
||||
--- src/3rdparty/chromium/base/memory/discardable_memory_internal.h.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/base/memory/discardable_memory_internal.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/memory/discardable_memory_internal.h
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "base/metrics/field_trial_params.h"
|
||||
#include "build/build_config.h"
|
||||
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX)
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
|
||||
namespace base {
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
} // namespace base
|
||||
|
||||
-#endif // defined(OS_LINUX) || defined(OS_ANDROID)
|
||||
+#endif // defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
|
||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
|
||||
#endif // BASE_MEMORY_DISCARDABLE_MEMORY_INTERNAL_H_
|
||||
|
@ -1,11 +1,11 @@
|
||||
--- src/3rdparty/chromium/base/memory/madv_free_discardable_memory_posix.cc.orig 2020-04-08 09:41:36 UTC
|
||||
--- src/3rdparty/chromium/base/memory/madv_free_discardable_memory_posix.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/memory/madv_free_discardable_memory_posix.cc
|
||||
@@ -271,7 +271,7 @@ void MadvFreeDiscardableMemoryPosix::SetKeepMemoryForT
|
||||
@@ -296,7 +296,7 @@ bool MadvFreeDiscardableMemoryPosix::IsResident() cons
|
||||
|
||||
bool MadvFreeDiscardableMemoryPosix::IsResident() const {
|
||||
DFAKE_SCOPED_RECURSIVE_LOCK(thread_collision_warner_);
|
||||
-#ifdef OS_MACOSX
|
||||
+#if defined(OS_MACOSX) || defined(OS_BSD)
|
||||
-#if defined(OS_APPLE)
|
||||
+#if defined(OS_APPLE) || defined(OS_BSD)
|
||||
std::vector<char> vec(allocated_pages_);
|
||||
#else
|
||||
std::vector<unsigned char> vec(allocated_pages_);
|
||||
|
@ -1,29 +1,29 @@
|
||||
--- src/3rdparty/chromium/base/memory/platform_shared_memory_region.h.orig 2019-11-27 21:12:25 UTC
|
||||
--- src/3rdparty/chromium/base/memory/platform_shared_memory_region.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/memory/platform_shared_memory_region.h
|
||||
@@ -28,7 +28,7 @@
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "base/files/scoped_file.h"
|
||||
#endif
|
||||
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
namespace content {
|
||||
class SandboxIPCHandler;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ class BASE_EXPORT PlatformSharedMemoryRegion {
|
||||
@@ -120,7 +120,7 @@ class BASE_EXPORT PlatformSharedMemoryRegion {
|
||||
kMaxValue = GET_SHMEM_TEMP_DIR_FAILURE
|
||||
};
|
||||
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
// Structure to limit access to executable region creation.
|
||||
struct ExecutableRegion {
|
||||
private:
|
||||
@@ -276,7 +276,7 @@ class BASE_EXPORT PlatformSharedMemoryRegion {
|
||||
@@ -264,7 +264,7 @@ class BASE_EXPORT PlatformSharedMemoryRegion {
|
||||
CheckPlatformHandlePermissionsCorrespondToMode);
|
||||
static PlatformSharedMemoryRegion Create(Mode mode,
|
||||
size_t size
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
,
|
||||
bool executable = false
|
||||
#endif
|
||||
|
@ -1,38 +1,38 @@
|
||||
--- src/3rdparty/chromium/base/memory/platform_shared_memory_region_posix.cc.orig 2019-11-27 21:12:25 UTC
|
||||
--- src/3rdparty/chromium/base/memory/platform_shared_memory_region_posix.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/memory/platform_shared_memory_region_posix.cc
|
||||
@@ -76,7 +76,7 @@ FDPair ScopedFDPair::get() const {
|
||||
@@ -70,7 +70,7 @@ FDPair ScopedFDPair::get() const {
|
||||
return {fd.get(), readonly_fd.get()};
|
||||
}
|
||||
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
// static
|
||||
ScopedFD PlatformSharedMemoryRegion::ExecutableRegion::CreateFD(size_t size) {
|
||||
PlatformSharedMemoryRegion region =
|
||||
@@ -85,7 +85,7 @@ ScopedFD PlatformSharedMemoryRegion::ExecutableRegion:
|
||||
@@ -79,7 +79,7 @@ ScopedFD PlatformSharedMemoryRegion::ExecutableRegion:
|
||||
return region.PassPlatformHandle().fd;
|
||||
return ScopedFD();
|
||||
}
|
||||
-#endif // defined(OS_LINUX)
|
||||
+#endif // defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
|
||||
// static
|
||||
PlatformSharedMemoryRegion PlatformSharedMemoryRegion::Take(
|
||||
@@ -224,7 +224,7 @@ bool PlatformSharedMemoryRegion::MapAtInternal(off_t o
|
||||
@@ -204,7 +204,7 @@ PlatformSharedMemoryRegion PlatformSharedMemoryRegion:
|
||||
// static
|
||||
PlatformSharedMemoryRegion PlatformSharedMemoryRegion::Create(Mode mode,
|
||||
size_t size
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
,
|
||||
bool executable
|
||||
#endif
|
||||
@@ -255,7 +255,7 @@ PlatformSharedMemoryRegion PlatformSharedMemoryRegion:
|
||||
@@ -233,7 +233,7 @@ PlatformSharedMemoryRegion PlatformSharedMemoryRegion:
|
||||
// flag.
|
||||
FilePath directory;
|
||||
if (!GetShmemTempDir(
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
executable,
|
||||
#else
|
||||
false /* executable */,
|
||||
|
@ -1,39 +0,0 @@
|
||||
--- src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc.orig 2019-05-23 12:39:34 UTC
|
||||
+++ src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "base/containers/span.h"
|
||||
#include "base/memory/read_only_shared_memory_region.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
+#include "base/sys_byteorder.h"
|
||||
|
||||
namespace base {
|
||||
|
||||
@@ -69,8 +70,8 @@ TEST_F(SharedMemoryMappingTest, SpanWithAutoDeducedEle
|
||||
|
||||
for (size_t i = 0; i < write_span.size(); ++i)
|
||||
write_span[i] = i + 1;
|
||||
- EXPECT_EQ(0x04030201u, read_span[0]);
|
||||
- EXPECT_EQ(0x08070605u, read_span[1]);
|
||||
+ EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
|
||||
+ EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
|
||||
}
|
||||
|
||||
TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
|
||||
@@ -95,13 +96,13 @@ TEST_F(SharedMemoryMappingTest, SpanWithExplicitElemen
|
||||
|
||||
for (size_t i = 0; i < write_span.size(); ++i)
|
||||
write_span[i] = i + 1;
|
||||
- EXPECT_EQ(0x04030201u, read_span[0]);
|
||||
- EXPECT_EQ(0x08070605u, read_span[1]);
|
||||
- EXPECT_EQ(0x04030201u, read_span_2[0]);
|
||||
+ EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
|
||||
+ EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
|
||||
+ EXPECT_EQ(HostToNet32(0x01020304u), read_span_2[0]);
|
||||
|
||||
std::fill(write_span_2.begin(), write_span_2.end(), 0);
|
||||
EXPECT_EQ(0u, read_span[0]);
|
||||
- EXPECT_EQ(0x08070605u, read_span[1]);
|
||||
+ EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
|
||||
EXPECT_EQ(0u, read_span_2[0]);
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
--- src/3rdparty/chromium/base/message_loop/message_pump_glib.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/message_loop/message_pump_glib.cc
|
||||
@@ -8,6 +8,11 @@
|
||||
#include <glib.h>
|
||||
#include <math.h>
|
||||
|
||||
+#if defined(OS_BSD)
|
||||
+#include <pthread.h>
|
||||
+#include <pthread_np.h>
|
||||
+#endif
|
||||
+
|
||||
#include "base/logging.h"
|
||||
#include "base/numerics/safe_conversions.h"
|
||||
#include "base/posix/eintr_wrapper.h"
|
||||
@@ -48,9 +53,13 @@ bool RunningOnMainThread() {
|
||||
}
|
||||
|
||||
bool RunningOnMainThread() {
|
||||
+#if defined(OS_BSD)
|
||||
+ return pthread_main_np();
|
||||
+#else
|
||||
auto pid = getpid();
|
||||
auto tid = PlatformThread::CurrentId();
|
||||
return pid > 0 && tid > 0 && pid == tid;
|
||||
+#endif
|
||||
}
|
||||
|
||||
// A brief refresher on GLib:
|
@ -1,32 +0,0 @@
|
||||
--- src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc.orig 2019-05-23 12:39:34 UTC
|
||||
+++ src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
+#include "base/sys_byteorder.h"
|
||||
|
||||
namespace base {
|
||||
namespace {
|
||||
@@ -64,13 +65,21 @@ TEST(BucketRangesTest, Checksum) {
|
||||
ranges.set_range(2, 2);
|
||||
|
||||
ranges.ResetChecksum();
|
||||
+#if defined(ARCH_CPU_LITTLE_ENDIAN)
|
||||
EXPECT_EQ(289217253u, ranges.checksum());
|
||||
+#else
|
||||
+ EXPECT_EQ(2767231596u, ranges.checksum());
|
||||
+#endif
|
||||
|
||||
ranges.set_range(2, 3);
|
||||
EXPECT_FALSE(ranges.HasValidChecksum());
|
||||
|
||||
ranges.ResetChecksum();
|
||||
+#if defined(ARCH_CPU_LITTLE_ENDIAN)
|
||||
EXPECT_EQ(2843835776u, ranges.checksum());
|
||||
+#else
|
||||
+ EXPECT_EQ(3556223738u, ranges.checksum());
|
||||
+#endif
|
||||
EXPECT_TRUE(ranges.HasValidChecksum());
|
||||
}
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- src/3rdparty/chromium/base/native_library_unittest.cc.orig 2018-11-13 18:25:11 UTC
|
||||
+++ src/3rdparty/chromium/base/native_library_unittest.cc
|
||||
@@ -120,7 +120,7 @@ TEST(NativeLibraryTest, LoadLibrary) {
|
||||
// Android dlopen() requires further investigation, as it might vary across
|
||||
// versions with respect to symbol resolution scope.
|
||||
// TSan and MSan error out on RTLD_DEEPBIND, https://crbug.com/705255
|
||||
-#if !defined(OS_ANDROID) && !defined(THREAD_SANITIZER) && \
|
||||
+#if !defined(OS_ANDROID) && !defined(OS_BSD) && !defined(THREAD_SANITIZER) && \
|
||||
!defined(MEMORY_SANITIZER)
|
||||
|
||||
// Verifies that the |prefer_own_symbols| option satisfies its guarantee that
|
@ -1,6 +1,6 @@
|
||||
--- src/3rdparty/chromium/base/numerics/safe_math_shared_impl.h.orig 2019-11-27 21:12:25 UTC
|
||||
--- src/3rdparty/chromium/base/numerics/safe_math_shared_impl.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/numerics/safe_math_shared_impl.h
|
||||
@@ -23,8 +23,7 @@
|
||||
@@ -24,8 +24,7 @@
|
||||
// Where available use builtin math overflow support on Clang and GCC.
|
||||
#elif !defined(__native_client__) && \
|
||||
((defined(__clang__) && \
|
||||
|
@ -1,4 +1,4 @@
|
||||
--- src/3rdparty/chromium/base/posix/unix_domain_socket.cc.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/base/posix/unix_domain_socket.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/posix/unix_domain_socket.cc
|
||||
@@ -5,7 +5,10 @@
|
||||
#include "base/posix/unix_domain_socket.h"
|
||||
@ -7,11 +7,11 @@
|
||||
+#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/ucred.h>
|
||||
+#include <sys/ucred.h>a
|
||||
#if !defined(OS_NACL_NONSFI)
|
||||
#include <sys/un.h>
|
||||
#endif
|
||||
@@ -28,6 +31,14 @@ namespace base {
|
||||
@@ -29,6 +32,14 @@ const size_t UnixDomainSocket::kMaxFileDescriptors = 1
|
||||
|
||||
const size_t UnixDomainSocket::kMaxFileDescriptors = 16;
|
||||
|
||||
@ -26,16 +26,16 @@
|
||||
#if !defined(OS_NACL_NONSFI)
|
||||
bool CreateSocketPair(ScopedFD* one, ScopedFD* two) {
|
||||
int raw_socks[2];
|
||||
@@ -150,7 +161,7 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd,
|
||||
#if !defined(OS_NACL_NONSFI) && !defined(OS_MACOSX)
|
||||
@@ -151,7 +162,7 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd,
|
||||
#if !defined(OS_NACL_NONSFI) && !defined(OS_APPLE)
|
||||
// The PNaCl toolchain for Non-SFI binary build and macOS do not support
|
||||
// ucred. macOS supports xucred, but this structure is insufficient.
|
||||
- + CMSG_SPACE(sizeof(struct ucred))
|
||||
+ + CMSG_SPACE(sizeof(struct cmsgcred))
|
||||
#endif // OS_NACL_NONSFI or OS_MACOSX
|
||||
#endif // !defined(OS_NACL_NONSFI) && !defined(OS_APPLE)
|
||||
;
|
||||
char control_buffer[kControlBufferSize];
|
||||
@@ -180,9 +191,9 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd,
|
||||
@@ -181,9 +192,9 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd,
|
||||
// SCM_CREDENTIALS.
|
||||
if (cmsg->cmsg_level == SOL_SOCKET &&
|
||||
cmsg->cmsg_type == SCM_CREDENTIALS) {
|
||||
@ -43,7 +43,7 @@
|
||||
+ DCHECK_EQ(payload_len, sizeof(struct cmsgcred));
|
||||
DCHECK_EQ(pid, -1);
|
||||
- pid = reinterpret_cast<struct ucred*>(CMSG_DATA(cmsg))->pid;
|
||||
+ pid = getpid();
|
||||
+ pid = getpid();
|
||||
}
|
||||
#endif // !defined(OS_NACL_NONSFI) && !defined(OS_MACOSX)
|
||||
#endif // !defined(OS_NACL_NONSFI) && !defined(OS_APPLE)
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
--- src/3rdparty/chromium/base/posix/unix_domain_socket_unittest.cc.orig 2018-11-13 18:25:11 UTC
|
||||
+++ src/3rdparty/chromium/base/posix/unix_domain_socket_unittest.cc
|
||||
@@ -8,6 +8,9 @@
|
||||
#include <stdint.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
+#if defined(OS_BSD)
|
||||
+#include <signal.h>
|
||||
+#endif
|
||||
#include <unistd.h>
|
||||
|
||||
#include "base/bind.h"
|
@ -1,6 +1,6 @@
|
||||
--- src/3rdparty/chromium/base/process/internal_linux.cc.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/base/process/internal_linux.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/process/internal_linux.cc
|
||||
@@ -29,7 +29,11 @@ namespace internal {
|
||||
@@ -30,7 +30,11 @@ const char kProcDir[] = "/proc";
|
||||
|
||||
const char kProcDir[] = "/proc";
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
FilePath GetProcPidDir(pid_t pid) {
|
||||
return FilePath(kProcDir).Append(NumberToString(pid));
|
||||
@@ -64,6 +68,7 @@ bool ReadProcFile(const FilePath& file, std::string* b
|
||||
@@ -66,6 +70,7 @@ bool ReadProcFile(const FilePath& file, std::string* b
|
||||
DLOG(WARNING) << "Failed to read " << file.MaybeAsASCII();
|
||||
return false;
|
||||
}
|
||||
@ -20,7 +20,7 @@
|
||||
return !buffer->empty();
|
||||
}
|
||||
|
||||
@@ -79,6 +84,22 @@ bool ParseProcStats(const std::string& stats_data,
|
||||
@@ -81,6 +86,22 @@ bool ParseProcStats(const std::string& stats_data,
|
||||
if (stats_data.empty())
|
||||
return false;
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
// The stat file is formatted as:
|
||||
// pid (process name) data1 data2 .... dataN
|
||||
// Look for the closing paren by scanning backwards, to avoid being fooled by
|
||||
@@ -108,6 +129,7 @@ bool ParseProcStats(const std::string& stats_data,
|
||||
@@ -110,6 +131,7 @@ bool ParseProcStats(const std::string& stats_data,
|
||||
base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
|
||||
for (const auto& i : other_stats)
|
||||
proc_stats->push_back(i);
|
||||
@ -51,7 +51,7 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -155,7 +177,11 @@ int64_t ReadProcStatsAndGetFieldAsInt64(pid_t pid, Pro
|
||||
@@ -157,7 +179,11 @@ int64_t ReadProcSelfStatsAndGetFieldAsInt64(ProcStatsF
|
||||
}
|
||||
|
||||
int64_t ReadProcSelfStatsAndGetFieldAsInt64(ProcStatsFields field_num) {
|
||||
@ -63,7 +63,7 @@
|
||||
return ReadStatFileAndGetFieldAsInt64(stat_file, field_num);
|
||||
}
|
||||
|
||||
@@ -171,6 +197,9 @@ size_t ReadProcStatsAndGetFieldAsSizeT(pid_t pid,
|
||||
@@ -173,6 +199,9 @@ Time GetBootTime() {
|
||||
}
|
||||
|
||||
Time GetBootTime() {
|
||||
@ -73,7 +73,7 @@
|
||||
FilePath path("/proc/stat");
|
||||
std::string contents;
|
||||
if (!ReadProcFile(path, &contents))
|
||||
@@ -184,9 +213,13 @@ Time GetBootTime() {
|
||||
@@ -186,9 +215,13 @@ Time GetBootTime() {
|
||||
if (!StringToInt(btime_it->second, &btime))
|
||||
return Time();
|
||||
return Time::FromTimeT(btime);
|
||||
@ -87,7 +87,7 @@
|
||||
FilePath path("/proc/stat");
|
||||
std::string contents;
|
||||
if (!ReadProcFile(path, &contents))
|
||||
@@ -210,6 +243,7 @@ TimeDelta GetUserCpuTimeSinceBoot() {
|
||||
@@ -212,6 +245,7 @@ TimeDelta GetUserCpuTimeSinceBoot() {
|
||||
return TimeDelta();
|
||||
|
||||
return ClockTicksToTimeDelta(user + nice);
|
||||
|
@ -1,15 +1,15 @@
|
||||
--- src/3rdparty/chromium/base/process/internal_linux.h.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/base/process/internal_linux.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/process/internal_linux.h
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "base/files/file_path.h"
|
||||
@@ -18,6 +18,8 @@
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/threading/platform_thread.h"
|
||||
|
||||
+#include <unistd.h> /* pid_t */
|
||||
+
|
||||
namespace base {
|
||||
|
||||
class Time;
|
||||
@@ -50,6 +52,14 @@ bool ParseProcStats(const std::string& stats_data,
|
||||
@@ -59,6 +61,14 @@ enum ProcStatsFields {
|
||||
// If the ordering ever changes, carefully review functions that use these
|
||||
// values.
|
||||
enum ProcStatsFields {
|
||||
@ -24,7 +24,7 @@
|
||||
VM_COMM = 1, // Filename of executable, without parentheses.
|
||||
VM_STATE = 2, // Letter indicating the state of the process.
|
||||
VM_PPID = 3, // PID of the parent.
|
||||
@@ -62,6 +72,7 @@ enum ProcStatsFields {
|
||||
@@ -71,6 +81,7 @@ enum ProcStatsFields {
|
||||
VM_STARTTIME = 21, // The time the process started in clock ticks.
|
||||
VM_VSIZE = 22, // Virtual memory size in bytes.
|
||||
VM_RSS = 23, // Resident Set Size in pages.
|
||||
|
@ -1,11 +1,16 @@
|
||||
--- src/3rdparty/chromium/base/process/kill.h.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/base/process/kill.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/process/kill.h
|
||||
@@ -111,7 +111,7 @@ BASE_EXPORT TerminationStatus GetTerminationStatus(Pro
|
||||
@@ -113,11 +113,11 @@ BASE_EXPORT TerminationStatus GetKnownDeadTerminationS
|
||||
BASE_EXPORT TerminationStatus GetKnownDeadTerminationStatus(
|
||||
ProcessHandle handle, int* exit_code);
|
||||
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
// Spawns a thread to wait asynchronously for the child |process| to exit
|
||||
// and then reaps it.
|
||||
BASE_EXPORT void EnsureProcessGetsReaped(Process process);
|
||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
#endif // defined(OS_POSIX)
|
||||
|
||||
// Registers |process| to be asynchronously monitored for termination, forcibly
|
||||
|
@ -1,11 +1,20 @@
|
||||
--- src/3rdparty/chromium/base/process/kill_posix.cc.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/base/process/kill_posix.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/process/kill_posix.cc
|
||||
@@ -167,7 +167,7 @@ void EnsureProcessTerminated(Process process) {
|
||||
@@ -160,7 +160,7 @@ void EnsureProcessTerminated(Process process) {
|
||||
0, new BackgroundReaper(std::move(process), TimeDelta::FromSeconds(2)));
|
||||
}
|
||||
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
void EnsureProcessGetsReaped(Process process) {
|
||||
DCHECK(!process.is_current());
|
||||
|
||||
@@ -171,7 +171,7 @@ void EnsureProcessGetsReaped(Process process) {
|
||||
PlatformThread::CreateNonJoinable(
|
||||
0, new BackgroundReaper(std::move(process), TimeDelta()));
|
||||
}
|
||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
|
||||
#endif // !defined(OS_APPLE)
|
||||
#endif // !defined(OS_NACL_NONSFI)
|
||||
|
@ -1,11 +1,11 @@
|
||||
--- src/3rdparty/chromium/base/process/launch.cc.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/base/process/launch.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/process/launch.cc
|
||||
@@ -15,7 +15,7 @@ LaunchOptions::~LaunchOptions() = default;
|
||||
@@ -15,7 +15,7 @@ LaunchOptions LaunchOptionsForTest() {
|
||||
|
||||
LaunchOptions LaunchOptionsForTest() {
|
||||
LaunchOptions options;
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
// To prevent accidental privilege sharing to an untrusted child, processes
|
||||
// are started with PR_SET_NO_NEW_PRIVS. Do not set that here, since this
|
||||
// new child will be used for testing only.
|
||||
|
@ -1,20 +1,29 @@
|
||||
--- src/3rdparty/chromium/base/process/launch.h.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/base/process/launch.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/process/launch.h
|
||||
@@ -171,7 +171,7 @@ struct BASE_EXPORT LaunchOptions {
|
||||
FileHandleMappingVector fds_to_remap;
|
||||
#endif // defined(OS_WIN)
|
||||
@@ -180,7 +180,7 @@ struct BASE_EXPORT LaunchOptions {
|
||||
bool clear_environment = false;
|
||||
#endif // OS_WIN || OS_POSIX || OS_FUCHSIA
|
||||
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
// If non-zero, start the process using clone(), using flags as provided.
|
||||
// Unlike in clone, clone_flags may not contain a custom termination signal
|
||||
// that is sent to the parent when the child dies. The termination signal will
|
||||
@@ -184,7 +184,7 @@ struct BASE_EXPORT LaunchOptions {
|
||||
@@ -193,7 +193,7 @@ struct BASE_EXPORT LaunchOptions {
|
||||
|
||||
// Sets parent process death signal to SIGKILL.
|
||||
bool kill_on_parent_death = false;
|
||||
-#endif // defined(OS_LINUX)
|
||||
+#endif // defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
|
||||
#if defined(OS_FUCHSIA)
|
||||
// If valid, launches the application in that job object.
|
||||
#if defined(OS_MAC)
|
||||
// Mach ports that will be accessible to the child process. These are not
|
||||
@@ -408,7 +408,7 @@ BASE_EXPORT LaunchOptions LaunchOptionsForTest();
|
||||
// binary. This should not be called in production/released code.
|
||||
BASE_EXPORT LaunchOptions LaunchOptionsForTest();
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_NACL_NONSFI)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_NACL_NONSFI) || defined(OS_BSD)
|
||||
// A wrapper for clone with fork-like behavior, meaning that it returns the
|
||||
// child's pid in the parent and 0 in the child. |flags|, |ptid|, and |ctid| are
|
||||
// as in the clone system call (the CLONE_VM flag is not supported).
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- src/3rdparty/chromium/base/process/launch_posix.cc.orig 2019-05-23 12:39:34 UTC
|
||||
--- src/3rdparty/chromium/base/process/launch_posix.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/process/launch_posix.cc
|
||||
@@ -64,6 +64,7 @@
|
||||
@@ -65,6 +65,7 @@
|
||||
#error "macOS should use launch_mac.cc"
|
||||
#endif
|
||||
|
||||
@ -8,3 +8,32 @@
|
||||
extern char** environ;
|
||||
|
||||
namespace base {
|
||||
@@ -228,6 +229,28 @@ void CloseSuperfluousFds(const base::InjectiveMultimap
|
||||
DirReaderPosix fd_dir(kFDDir);
|
||||
if (!fd_dir.IsValid()) {
|
||||
// Fallback case: Try every possible fd.
|
||||
+
|
||||
+#if defined(OS_FREEBSD)
|
||||
+ // CEM: blast away most of the range with closefrom(). A common use case
|
||||
+ // of this function only maps STDIN/STDOUT/STDERR and closefrom(3) is much
|
||||
+ // cheaper than x00,000 close(2) invocations with a high RLIMIT_NOFILE.
|
||||
+ //
|
||||
+ // In the other caller, it is still very likely that the fds we care about
|
||||
+ // are in relatively low number space and we can save hundreds of thousands
|
||||
+ // of syscalls.
|
||||
+ int max_valid_fd = -1;
|
||||
+ for (size_t j = 0; j < saved_mapping.size(); j++) {
|
||||
+ int fd = saved_mapping[j].dest;
|
||||
+ if (fd > max_valid_fd)
|
||||
+ max_valid_fd = fd;
|
||||
+ }
|
||||
+ if (max_valid_fd < STDERR_FILENO)
|
||||
+ max_valid_fd = STDERR_FILENO;
|
||||
+
|
||||
+ closefrom(max_valid_fd + 1);
|
||||
+ max_fds = static_cast<size_t>(max_valid_fd) + 1;
|
||||
+#endif
|
||||
+
|
||||
for (size_t i = 0; i < max_fds; ++i) {
|
||||
const int fd = static_cast<int>(i);
|
||||
if (fd == STDIN_FILENO || fd == STDOUT_FILENO || fd == STDERR_FILENO)
|
||||
|
@ -1,7 +1,7 @@
|
||||
--- src/3rdparty/chromium/base/process/memory.cc.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/base/process/memory.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/process/memory.cc
|
||||
@@ -10,7 +10,7 @@
|
||||
namespace base {
|
||||
@@ -55,7 +55,7 @@ NOINLINE void OnNoMemoryInternal(size_t size) {
|
||||
} // namespace internal
|
||||
|
||||
// Defined in memory_win.cc for Windows.
|
||||
-#if !defined(OS_WIN)
|
||||
@ -9,12 +9,12 @@
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -31,7 +31,7 @@ void TerminateBecauseOutOfMemory(size_t size) {
|
||||
#endif
|
||||
@@ -74,7 +74,7 @@ void TerminateBecauseOutOfMemory(size_t size) {
|
||||
#endif // !defined(OS_WIN)
|
||||
|
||||
// Defined in memory_mac.mm for Mac.
|
||||
-#if !defined(OS_MACOSX)
|
||||
+#if !defined(OS_MACOSX) && !defined(OS_BSD)
|
||||
-#if !defined(OS_APPLE)
|
||||
+#if !defined(OS_APPLE) && !defined(OS_BSD)
|
||||
|
||||
bool UncheckedCalloc(size_t num_items, size_t size, void** result) {
|
||||
const size_t alloc_size = num_items * size;
|
||||
|
@ -1,11 +1,11 @@
|
||||
--- src/3rdparty/chromium/base/process/memory.h.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/base/process/memory.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/process/memory.h
|
||||
@@ -32,7 +32,7 @@ BASE_EXPORT void EnableTerminationOnOutOfMemory();
|
||||
@@ -24,7 +24,7 @@ BASE_EXPORT void TerminateBecauseOutOfMemory(size_t si
|
||||
// Crash reporting classifies such crashes as OOM.
|
||||
BASE_EXPORT void TerminateBecauseOutOfMemory(size_t size);
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_AIX)
|
||||
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_AIX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) || \
|
||||
defined(OS_AIX)
|
||||
BASE_EXPORT extern size_t g_oom_size;
|
||||
|
||||
// The maximum allowed value for the OOM score.
|
||||
|
@ -1,18 +0,0 @@
|
||||
--- src/3rdparty/chromium/base/process/memory_unittest.cc.orig 2018-11-13 18:25:11 UTC
|
||||
+++ src/3rdparty/chromium/base/process/memory_unittest.cc
|
||||
@@ -104,7 +104,7 @@ TEST(MemoryTest, AllocatorShimWorking) {
|
||||
// OpenBSD does not support these tests. Don't test these on ASan/TSan/MSan
|
||||
// configurations: only test the real allocator.
|
||||
// Windows only supports these tests with the allocator shim in place.
|
||||
-#if !defined(OS_OPENBSD) && BUILDFLAG(USE_ALLOCATOR_SHIM) && \
|
||||
+#if !defined(OS_BSD) && BUILDFLAG(USE_ALLOCATOR_SHIM) && \
|
||||
!defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
|
||||
|
||||
namespace {
|
||||
@@ -529,5 +529,5 @@ TEST_F(OutOfMemoryHandledTest, UncheckedCalloc) {
|
||||
EXPECT_FALSE(base::UncheckedCalloc(1, test_size_, &value_));
|
||||
EXPECT_TRUE(value_ == nullptr);
|
||||
}
|
||||
-#endif // !defined(OS_OPENBSD) && BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) &&
|
||||
+#endif // !defined(OS_BSD) && BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) &&
|
||||
// !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
|
@ -1,11 +1,11 @@
|
||||
--- src/3rdparty/chromium/base/process/process_handle.cc.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/base/process/process_handle.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/process/process_handle.cc
|
||||
@@ -39,7 +39,7 @@ uint32_t GetUniqueIdForProcess() {
|
||||
return g_unique_id;
|
||||
@@ -30,7 +30,7 @@ UniqueProcId GetUniqueIdForProcess() {
|
||||
: UniqueProcId(GetCurrentProcId());
|
||||
}
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_AIX)
|
||||
+#if defined(OS_LINUX) || defined(OS_AIX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_AIX)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_AIX) || defined(OS_BSD)
|
||||
|
||||
void InitUniqueIdForProcessInPidNamespace(ProcessId pid_outside_of_namespace) {
|
||||
g_unique_id = MangleProcessId(pid_outside_of_namespace);
|
||||
DCHECK(pid_outside_of_namespace != kNullProcessId);
|
||||
|
@ -1,11 +1,11 @@
|
||||
--- src/3rdparty/chromium/base/process/process_handle.h.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/base/process/process_handle.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/process/process_handle.h
|
||||
@@ -64,7 +64,7 @@ BASE_EXPORT ProcessId GetCurrentProcId();
|
||||
// a process's PID.
|
||||
BASE_EXPORT uint32_t GetUniqueIdForProcess();
|
||||
@@ -103,7 +103,7 @@ BASE_EXPORT UniqueProcId GetUniqueIdForProcess();
|
||||
// processes may be reused.
|
||||
BASE_EXPORT UniqueProcId GetUniqueIdForProcess();
|
||||
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
// When a process is started in a different PID namespace from the browser
|
||||
// process, this function must be called with the process's PID in the browser's
|
||||
// PID namespace in order to initialize its unique ID. Not thread safe.
|
||||
|
@ -1,16 +1,33 @@
|
||||
--- src/3rdparty/chromium/base/process/process_linux.cc.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/base/process/process_linux.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/process/process_linux.cc
|
||||
@@ -79,6 +79,9 @@ Time Process::CreationTime() const {
|
||||
internal::VM_STARTTIME)
|
||||
: internal::ReadProcStatsAndGetFieldAsInt64(
|
||||
Pid(), internal::VM_STARTTIME);
|
||||
@@ -24,7 +24,9 @@ namespace {
|
||||
|
||||
namespace {
|
||||
|
||||
+#if !defined(OS_BSD)
|
||||
const int kForegroundPriority = 0;
|
||||
+#endif
|
||||
|
||||
#if defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS)
|
||||
// We are more aggressive in our lowering of background process priority
|
||||
@@ -69,7 +71,7 @@ struct CGroups {
|
||||
return groups;
|
||||
}
|
||||
};
|
||||
-#else
|
||||
+#elif !defined(OS_BSD)
|
||||
const int kBackgroundPriority = 5;
|
||||
#endif // defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS)
|
||||
|
||||
@@ -96,13 +98,18 @@ Time Process::CreationTime() const {
|
||||
if (!start_ticks)
|
||||
return Time();
|
||||
|
||||
+#if defined(OS_BSD)
|
||||
+ return Time::FromTimeT(start_ticks);
|
||||
+#else
|
||||
if (!start_ticks)
|
||||
return Time();
|
||||
TimeDelta start_offset = internal::ClockTicksToTimeDelta(start_ticks);
|
||||
@@ -86,8 +89,10 @@ Time Process::CreationTime() const {
|
||||
Time boot_time = internal::GetBootTime();
|
||||
if (boot_time.is_null())
|
||||
return Time();
|
||||
return Time(boot_time + start_offset);
|
||||
@ -20,12 +37,12 @@
|
||||
+#if !defined(OS_BSD)
|
||||
// static
|
||||
bool Process::CanBackgroundProcesses() {
|
||||
#if defined(OS_CHROMEOS)
|
||||
@@ -139,6 +144,7 @@ bool Process::SetProcessBackgrounded(bool background)
|
||||
#if defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS)
|
||||
@@ -154,6 +161,7 @@ bool Process::SetProcessBackgrounded(bool background)
|
||||
DPCHECK(result == 0);
|
||||
return result == 0;
|
||||
}
|
||||
+#endif // !defined(OS_BSD)
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
#if defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS)
|
||||
bool IsProcessBackgroundedCGroup(const StringPiece& cgroup_contents) {
|
||||
|
@ -1,38 +1,38 @@
|
||||
--- src/3rdparty/chromium/base/process/process_metrics.cc.orig 2019-11-27 21:12:25 UTC
|
||||
--- src/3rdparty/chromium/base/process/process_metrics.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/process/process_metrics.cc
|
||||
@@ -57,7 +57,7 @@ SystemMetrics SystemMetrics::Sample() {
|
||||
@@ -49,7 +49,7 @@ SystemMetrics SystemMetrics::Sample() {
|
||||
SystemMetrics system_metrics;
|
||||
|
||||
system_metrics.committed_memory_ = GetSystemCommitCharge();
|
||||
-#if defined(OS_LINUX) || defined(OS_ANDROID)
|
||||
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
GetSystemMemoryInfo(&system_metrics.memory_info_);
|
||||
GetVmStatInfo(&system_metrics.vmstat_info_);
|
||||
GetSystemDiskInfo(&system_metrics.disk_info_);
|
||||
@@ -75,7 +75,7 @@ std::unique_ptr<Value> SystemMetrics::ToValue() const
|
||||
@@ -68,7 +68,7 @@ std::unique_ptr<Value> SystemMetrics::ToValue() const
|
||||
std::unique_ptr<DictionaryValue> res(new DictionaryValue());
|
||||
|
||||
res->SetIntKey("committed_memory", static_cast<int>(committed_memory_));
|
||||
-#if defined(OS_LINUX) || defined(OS_ANDROID)
|
||||
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
std::unique_ptr<DictionaryValue> meminfo = memory_info_.ToValue();
|
||||
std::unique_ptr<DictionaryValue> vmstat = vmstat_info_.ToValue();
|
||||
meminfo->MergeDictionary(vmstat.get());
|
||||
@@ -126,7 +126,7 @@ double ProcessMetrics::GetPlatformIndependentCPUUsage(
|
||||
@@ -119,7 +119,7 @@ double ProcessMetrics::GetPlatformIndependentCPUUsage(
|
||||
}
|
||||
#endif
|
||||
|
||||
-#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_AIX)
|
||||
+#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_AIX) || defined(OS_BSD)
|
||||
-#if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \
|
||||
+#if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) || \
|
||||
defined(OS_AIX)
|
||||
int ProcessMetrics::CalculateIdleWakeupsPerSecond(
|
||||
uint64_t absolute_idle_wakeups) {
|
||||
return CalculateEventsPerSecond(absolute_idle_wakeups,
|
||||
@@ -138,7 +138,7 @@ int ProcessMetrics::GetIdleWakeupsPerSecond() {
|
||||
@@ -132,7 +132,7 @@ int ProcessMetrics::GetIdleWakeupsPerSecond() {
|
||||
NOTIMPLEMENTED(); // http://crbug.com/120488
|
||||
return 0;
|
||||
}
|
||||
-#endif // defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_AIX)
|
||||
+#endif // defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_AIX) || defined(OS_BSD)
|
||||
-#endif // defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_CHROMEOS) ||
|
||||
+#endif // defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) ||
|
||||
// defined(OS_AIX)
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
int ProcessMetrics::CalculatePackageIdleWakeupsPerSecond(
|
||||
#if defined(OS_APPLE)
|
||||
|
@ -1,131 +1,163 @@
|
||||
--- src/3rdparty/chromium/base/process/process_metrics.h.orig 2019-11-27 21:12:25 UTC
|
||||
--- src/3rdparty/chromium/base/process/process_metrics.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/process/process_metrics.h
|
||||
@@ -41,7 +41,7 @@ namespace base {
|
||||
@@ -47,7 +47,7 @@ struct IoCounters;
|
||||
// Full declaration is in process_metrics_iocounters.h.
|
||||
struct IoCounters;
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_ANDROID)
|
||||
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
// Minor and major page fault counts since the process creation.
|
||||
// Both counts are process-wide, and exclude child processes.
|
||||
//
|
||||
@@ -51,7 +51,7 @@ struct PageFaultCounts {
|
||||
@@ -57,7 +57,7 @@ struct PageFaultCounts {
|
||||
int64_t minor;
|
||||
int64_t major;
|
||||
};
|
||||
-#endif // defined(OS_LINUX) || defined(OS_ANDROID)
|
||||
+#endif // defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
|
||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
|
||||
// Convert a POSIX timeval to microseconds.
|
||||
BASE_EXPORT int64_t TimeValToMicroseconds(const struct timeval& tv);
|
||||
@@ -92,7 +92,7 @@ class BASE_EXPORT ProcessMetrics {
|
||||
@@ -98,7 +98,7 @@ class BASE_EXPORT ProcessMetrics {
|
||||
// convenience wrapper for CreateProcessMetrics().
|
||||
static std::unique_ptr<ProcessMetrics> CreateCurrentProcessMetrics();
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_ANDROID)
|
||||
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
// Resident Set Size is a Linux/Android specific memory concept. Do not
|
||||
// attempt to extend this to other platforms.
|
||||
BASE_EXPORT size_t GetResidentSetSize() const;
|
||||
@@ -168,14 +168,14 @@ class BASE_EXPORT ProcessMetrics {
|
||||
@@ -124,7 +124,7 @@ class BASE_EXPORT ProcessMetrics {
|
||||
// will result in a time delta of 2 seconds/per 1 wall-clock second.
|
||||
TimeDelta GetCumulativeCPUUsage();
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) || \
|
||||
defined(OS_AIX)
|
||||
// Emits the cumulative CPU usage for all currently active threads since they
|
||||
// were started into the output parameter (replacing its current contents).
|
||||
@@ -159,7 +159,7 @@ class BASE_EXPORT ProcessMetrics {
|
||||
bool ParseProcTimeInState(const std::string& content,
|
||||
PlatformThreadId tid,
|
||||
TimeInStatePerThread& time_in_state_per_thread);
|
||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) ||
|
||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) ||
|
||||
// defined(OS_AIX)
|
||||
|
||||
// Returns the number of average idle cpu wakeups per second since the last
|
||||
@@ -216,14 +216,14 @@ class BASE_EXPORT ProcessMetrics {
|
||||
int GetOpenFdSoftLimit() const;
|
||||
#endif // defined(OS_POSIX)
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_ANDROID)
|
||||
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
// Bytes of swap as reported by /proc/[pid]/status.
|
||||
uint64_t GetVmSwapBytes() const;
|
||||
|
||||
// Minor and major page fault count as reported by /proc/[pid]/stat.
|
||||
// Returns true for success.
|
||||
bool GetPageFaultCounts(PageFaultCounts* counts) const;
|
||||
-#endif // defined(OS_LINUX) || defined(OS_ANDROID)
|
||||
+#endif // defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
|
||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
|
||||
// Returns total memory usage of malloc.
|
||||
size_t GetMallocUsage();
|
||||
@@ -187,7 +187,7 @@ class BASE_EXPORT ProcessMetrics {
|
||||
@@ -235,7 +235,7 @@ class BASE_EXPORT ProcessMetrics {
|
||||
ProcessMetrics(ProcessHandle process, PortProvider* port_provider);
|
||||
#endif // !defined(OS_MACOSX) || defined(OS_IOS)
|
||||
#endif // !defined(OS_MAC)
|
||||
|
||||
-#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_AIX)
|
||||
+#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_AIX) || defined(OS_BSD)
|
||||
-#if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \
|
||||
+#if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) || \
|
||||
defined(OS_AIX)
|
||||
int CalculateIdleWakeupsPerSecond(uint64_t absolute_idle_wakeups);
|
||||
#endif
|
||||
#if defined(OS_MACOSX)
|
||||
@@ -216,7 +216,7 @@ class BASE_EXPORT ProcessMetrics {
|
||||
@@ -246,10 +246,10 @@ class BASE_EXPORT ProcessMetrics {
|
||||
uint64_t absolute_package_idle_wakeups);
|
||||
#endif
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) || \
|
||||
defined(OS_AIX)
|
||||
CPU::CoreType GetCoreType(int core_index);
|
||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) ||
|
||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) ||
|
||||
// defined(OS_AIX)
|
||||
|
||||
#if defined(OS_WIN)
|
||||
@@ -271,7 +271,7 @@ class BASE_EXPORT ProcessMetrics {
|
||||
// Number of bytes transferred to/from disk in bytes.
|
||||
uint64_t last_cumulative_disk_usage_ = 0;
|
||||
|
||||
-#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_AIX)
|
||||
+#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_AIX) || defined(OS_BSD)
|
||||
-#if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \
|
||||
+#if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) || \
|
||||
defined(OS_AIX)
|
||||
// Same thing for idle wakeups.
|
||||
TimeTicks last_idle_wakeups_time_;
|
||||
uint64_t last_absolute_idle_wakeups_;
|
||||
@@ -264,7 +264,7 @@ BASE_EXPORT size_t GetHandleLimit();
|
||||
@@ -323,7 +323,7 @@ BASE_EXPORT void IncreaseFdLimitTo(unsigned int max_de
|
||||
BASE_EXPORT void IncreaseFdLimitTo(unsigned int max_descriptors);
|
||||
#endif // defined(OS_POSIX)
|
||||
|
||||
-#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \
|
||||
+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || \
|
||||
defined(OS_ANDROID) || defined(OS_AIX) || defined(OS_FUCHSIA)
|
||||
-#if defined(OS_WIN) || defined(OS_APPLE) || defined(OS_LINUX) || \
|
||||
+#if defined(OS_WIN) || defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_BSD) || \
|
||||
defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_AIX) || \
|
||||
defined(OS_FUCHSIA)
|
||||
// Data about system-wide memory consumption. Values are in KB. Available on
|
||||
// Windows, Mac, Linux, Android and Chrome OS.
|
||||
@@ -298,7 +298,7 @@ struct BASE_EXPORT SystemMemoryInfoKB {
|
||||
@@ -358,7 +358,7 @@ struct BASE_EXPORT SystemMemoryInfoKB {
|
||||
int avail_phys = 0;
|
||||
#endif
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_AIX)
|
||||
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_AIX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) || \
|
||||
defined(OS_AIX)
|
||||
// This provides an estimate of available memory as described here:
|
||||
// https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
|
||||
// NOTE: this is ONLY valid in kernels 3.14 and up. Its value will always
|
||||
@@ -312,7 +312,7 @@ struct BASE_EXPORT SystemMemoryInfoKB {
|
||||
@@ -373,7 +373,7 @@ struct BASE_EXPORT SystemMemoryInfoKB {
|
||||
int swap_free = 0;
|
||||
#endif
|
||||
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_AIX) || \
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_AIX) || defined(OS_BSD) || \
|
||||
defined(OS_FUCHSIA)
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) || \
|
||||
defined(OS_AIX) || defined(OS_FUCHSIA)
|
||||
int buffers = 0;
|
||||
int cached = 0;
|
||||
@@ -322,7 +322,7 @@ struct BASE_EXPORT SystemMemoryInfoKB {
|
||||
@@ -383,7 +383,7 @@ struct BASE_EXPORT SystemMemoryInfoKB {
|
||||
int inactive_file = 0;
|
||||
int dirty = 0;
|
||||
int reclaimable = 0;
|
||||
-#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_AIX) ||
|
||||
+#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_AIX) || defined(OS_BSD) ||
|
||||
// defined(OS_FUCHSIA)
|
||||
-#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) ||
|
||||
+#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) ||
|
||||
// defined(OS_AIX) defined(OS_FUCHSIA)
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
@@ -348,10 +348,10 @@ struct BASE_EXPORT SystemMemoryInfoKB {
|
||||
#if defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS)
|
||||
@@ -406,11 +406,11 @@ BASE_EXPORT bool GetSystemMemoryInfo(SystemMemoryInfoK
|
||||
// Exposed for memory debugging widget.
|
||||
BASE_EXPORT bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo);
|
||||
|
||||
-#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) ||
|
||||
+#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD)
|
||||
// defined(OS_ANDROID) || defined(OS_AIX) || defined(OS_FUCHSIA)
|
||||
-#endif // defined(OS_WIN) || defined(OS_APPLE) || defined(OS_LINUX) ||
|
||||
+#endif // defined(OS_WIN) || defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_BSD) ||
|
||||
// defined(OS_CHROMEOS) defined(OS_ANDROID) || defined(OS_AIX) ||
|
||||
// defined(OS_FUCHSIA)
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_AIX)
|
||||
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_AIX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) || \
|
||||
defined(OS_AIX)
|
||||
// Parse the data found in /proc/<pid>/stat and return the sum of the
|
||||
// CPU-related ticks. Returns -1 on parse error.
|
||||
// Exposed for testing.
|
||||
@@ -424,7 +424,7 @@ BASE_EXPORT bool GetSystemDiskInfo(SystemDiskInfo* dis
|
||||
@@ -485,7 +485,7 @@ BASE_EXPORT TimeDelta GetUserCpuTimeSinceBoot();
|
||||
// Returns the amount of time spent in user space since boot across all CPUs.
|
||||
BASE_EXPORT TimeDelta GetUserCpuTimeSinceBoot();
|
||||
|
||||
-#endif // defined(OS_LINUX) || defined(OS_ANDROID)
|
||||
+#endif // defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) ||
|
||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) ||
|
||||
// defined(OS_AIX)
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
// Data from files in directory /sys/block/zram0 about ZRAM usage.
|
||||
@@ -519,7 +519,7 @@ class BASE_EXPORT SystemMetrics {
|
||||
#if defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS)
|
||||
@@ -597,7 +597,7 @@ class BASE_EXPORT SystemMetrics {
|
||||
FRIEND_TEST_ALL_PREFIXES(SystemMetricsTest, SystemMetrics);
|
||||
|
||||
size_t committed_memory_;
|
||||
-#if defined(OS_LINUX) || defined(OS_ANDROID)
|
||||
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD)
|
||||
SystemMemoryInfoKB memory_info_;
|
||||
VmStatInfo vmstat_info_;
|
||||
SystemDiskInfo disk_info_;
|
||||
|
@ -1,14 +1,17 @@
|
||||
--- src/3rdparty/chromium/base/process/process_metrics_freebsd.cc.orig 2019-11-27 21:12:25 UTC
|
||||
--- src/3rdparty/chromium/base/process/process_metrics_freebsd.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/process/process_metrics_freebsd.cc
|
||||
@@ -5,6 +5,7 @@
|
||||
@@ -3,8 +3,10 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "base/process/process_metrics.h"
|
||||
+#include "base/notreached.h"
|
||||
|
||||
#include <stddef.h>
|
||||
+#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/user.h>
|
||||
#include <unistd.h>
|
||||
@@ -14,11 +15,29 @@
|
||||
@@ -14,11 +16,29 @@
|
||||
#include "base/process/process_metrics_iocounters.h"
|
||||
#include "base/stl_util.h"
|
||||
|
||||
@ -40,7 +43,7 @@
|
||||
|
||||
// static
|
||||
std::unique_ptr<ProcessMetrics> ProcessMetrics::CreateProcessMetrics(
|
||||
@@ -69,4 +88,216 @@ size_t GetSystemCommitCharge() {
|
||||
@@ -69,4 +89,216 @@ size_t GetSystemCommitCharge() {
|
||||
return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize);
|
||||
}
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
--- src/3rdparty/chromium/base/process/process_metrics_posix.cc.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/base/process/process_metrics_posix.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/process/process_metrics_posix.cc
|
||||
@@ -19,6 +19,8 @@
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_APPLE)
|
||||
#include <malloc/malloc.h>
|
||||
+#elif defined(OS_FREEBSD)
|
||||
+#include <stdlib.h>
|
||||
#else
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
@@ -107,7 +109,7 @@ size_t ProcessMetrics::GetMallocUsage() {
|
||||
@@ -126,7 +128,7 @@ size_t ProcessMetrics::GetMallocUsage() {
|
||||
#else
|
||||
return minfo.hblkhd + minfo.arena;
|
||||
#endif
|
||||
|
@ -1,15 +1,15 @@
|
||||
--- src/3rdparty/chromium/base/profiler/register_context.h.orig 2020-04-08 09:41:36 UTC
|
||||
--- src/3rdparty/chromium/base/profiler/register_context.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/profiler/register_context.h
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <windows.h>
|
||||
#elif defined(OS_MACOSX)
|
||||
#elif defined(OS_APPLE)
|
||||
#include <mach/machine/thread_status.h>
|
||||
-#elif defined(OS_ANDROID) || defined(OS_LINUX)
|
||||
+#elif defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#elif defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#elif defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
#include <sys/ucontext.h>
|
||||
#endif
|
||||
|
||||
@@ -152,6 +152,48 @@ inline uintptr_t& RegisterContextInstructionPointer(mc
|
||||
@@ -190,6 +190,48 @@ inline uintptr_t& RegisterContextInstructionPointer(mc
|
||||
}
|
||||
|
||||
#endif // #if defined(ARCH_CPU_ARM_FAMILY) && defined(ARCH_CPU_32_BITS)
|
||||
|
@ -1,11 +1,11 @@
|
||||
--- src/3rdparty/chromium/base/profiler/sampling_profiler_thread_token.cc.orig 2020-04-08 09:41:36 UTC
|
||||
--- src/3rdparty/chromium/base/profiler/sampling_profiler_thread_token.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/profiler/sampling_profiler_thread_token.cc
|
||||
@@ -7,7 +7,7 @@
|
||||
@@ -7,7 +7,7 @@ SamplingProfilerThreadToken GetSamplingProfilerCurrent
|
||||
namespace base {
|
||||
|
||||
SamplingProfilerThreadToken GetSamplingProfilerCurrentThreadToken() {
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX)
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
return {PlatformThread::CurrentId(), pthread_self()};
|
||||
#else
|
||||
return {PlatformThread::CurrentId()};
|
||||
|
@ -1,20 +1,20 @@
|
||||
--- src/3rdparty/chromium/base/profiler/sampling_profiler_thread_token.h.orig 2020-04-08 09:41:36 UTC
|
||||
--- src/3rdparty/chromium/base/profiler/sampling_profiler_thread_token.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/profiler/sampling_profiler_thread_token.h
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "base/threading/platform_thread.h"
|
||||
#include "build/build_config.h"
|
||||
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX)
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace base {
|
||||
@@ -21,7 +21,7 @@ struct SamplingProfilerThreadToken {
|
||||
// functions used to obtain the stack base address.
|
||||
struct SamplingProfilerThreadToken {
|
||||
PlatformThreadId id;
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX)
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
pthread_t pthread_id;
|
||||
#endif
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
--- src/3rdparty/chromium/base/profiler/stack_copier_signal.cc.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/base/profiler/stack_copier_signal.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/profiler/stack_copier_signal.cc
|
||||
@@ -4,7 +4,14 @@
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
#include <signal.h>
|
||||
#include <sys/ucontext.h>
|
||||
#include <syscall.h>
|
||||
@@ -33,8 +40,13 @@ class AsyncSafeWaitableEvent {
|
||||
@@ -34,8 +41,13 @@ class AsyncSafeWaitableEvent {
|
||||
// for a pthread mutex. So, also check the condition.
|
||||
while (true) {
|
||||
int res =
|
||||
@ -29,7 +29,7 @@
|
||||
if (futex_.load(std::memory_order_acquire) != 0)
|
||||
return true;
|
||||
if (res != 0)
|
||||
@@ -44,8 +56,12 @@ class AsyncSafeWaitableEvent {
|
||||
@@ -45,8 +57,12 @@ class AsyncSafeWaitableEvent {
|
||||
|
||||
void Signal() {
|
||||
futex_.store(1, std::memory_order_release);
|
||||
@ -42,7 +42,7 @@
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -215,11 +231,18 @@ bool StackCopierSignal::CopyStack(StackBuffer* stack_b
|
||||
@@ -216,11 +232,18 @@ bool StackCopierSignal::CopyStack(StackBuffer* stack_b
|
||||
if (!scoped_sigaction.succeeded())
|
||||
return false;
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
--- src/3rdparty/chromium/base/profiler/stack_sampling_profiler_unittest.cc.orig 2018-11-13 18:25:11 UTC
|
||||
+++ src/3rdparty/chromium/base/profiler/stack_sampling_profiler_unittest.cc
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <intrin.h>
|
||||
--- src/3rdparty/chromium/base/profiler/stack_sampling_profiler_test_util.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/profiler/stack_sampling_profiler_test_util.cc
|
||||
@@ -32,7 +32,7 @@
|
||||
// Fortunately, it provides _alloca, which functions identically.
|
||||
#include <malloc.h>
|
||||
#include <windows.h>
|
||||
#define alloca _alloca
|
||||
-#else
|
||||
+#elif !defined(OS_BSD)
|
||||
#include <alloca.h>
|
@ -1,16 +1,16 @@
|
||||
--- src/3rdparty/chromium/base/profiler/thread_delegate_posix.cc.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/base/profiler/thread_delegate_posix.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/profiler/thread_delegate_posix.cc
|
||||
@@ -9,6 +9,9 @@
|
||||
@@ -12,6 +12,9 @@
|
||||
#include "base/profiler/thread_delegate_posix.h"
|
||||
#include "base/stl_util.h"
|
||||
|
||||
#include "build/build_config.h"
|
||||
+#if defined(OS_FREEBSD)
|
||||
+#include <pthread_np.h>
|
||||
+#endif
|
||||
|
||||
namespace base {
|
||||
|
||||
@@ -17,7 +20,12 @@ namespace {
|
||||
#if defined(OS_ANDROID)
|
||||
#include "base/files/file_util.h"
|
||||
@@ -43,7 +46,12 @@ uintptr_t GetThreadStackBaseAddressImpl(
|
||||
uintptr_t GetThreadStackBaseAddressImpl(
|
||||
SamplingProfilerThreadToken thread_token) {
|
||||
pthread_attr_t attr;
|
||||
@ -23,7 +23,7 @@
|
||||
// See crbug.com/617730 for limitations of this approach on Linux.
|
||||
void* address;
|
||||
size_t size;
|
||||
@@ -93,16 +101,33 @@ std::vector<uintptr_t*> ThreadDelegatePosix::GetRegist
|
||||
@@ -130,16 +138,33 @@ std::vector<uintptr_t*> ThreadDelegatePosix::GetRegist
|
||||
return {
|
||||
// Return the set of callee-save registers per the i386 System V ABI
|
||||
// section 2.2.3, plus the stack pointer.
|
||||
@ -57,7 +57,7 @@
|
||||
reinterpret_cast<uintptr_t*>(&thread_context->gregs[REG_RBP]),
|
||||
reinterpret_cast<uintptr_t*>(&thread_context->gregs[REG_RBX]),
|
||||
reinterpret_cast<uintptr_t*>(&thread_context->gregs[REG_R12]),
|
||||
@@ -110,6 +135,7 @@ std::vector<uintptr_t*> ThreadDelegatePosix::GetRegist
|
||||
@@ -147,6 +172,7 @@ std::vector<uintptr_t*> ThreadDelegatePosix::GetRegist
|
||||
reinterpret_cast<uintptr_t*>(&thread_context->gregs[REG_R14]),
|
||||
reinterpret_cast<uintptr_t*>(&thread_context->gregs[REG_R15]),
|
||||
reinterpret_cast<uintptr_t*>(&thread_context->gregs[REG_RSP]),
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- src/3rdparty/chromium/base/sampling_heap_profiler/sampling_heap_profiler.cc.orig 2019-11-27 21:12:25 UTC
|
||||
--- src/3rdparty/chromium/base/sampling_heap_profiler/sampling_heap_profiler.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/sampling_heap_profiler/sampling_heap_profiler.cc
|
||||
@@ -29,6 +29,10 @@
|
||||
@@ -30,6 +30,10 @@
|
||||
#include <sys/prctl.h>
|
||||
#endif
|
||||
|
||||
@ -10,9 +10,9 @@
|
||||
+
|
||||
#if defined(OS_ANDROID) && BUILDFLAG(CAN_UNWIND_WITH_CFI_TABLE) && \
|
||||
defined(OFFICIAL_BUILD)
|
||||
#include "base/trace_event/cfi_backtrace_android.h"
|
||||
@@ -64,6 +68,10 @@ const char* GetAndLeakThreadName() {
|
||||
#elif defined(OS_MACOSX)
|
||||
#include "base/trace_event/cfi_backtrace_android.h" // no-presubmit-check
|
||||
@@ -65,6 +69,10 @@ const char* GetAndLeakThreadName() {
|
||||
#elif defined(OS_APPLE)
|
||||
int err = pthread_getname_np(pthread_self(), name, kBufferLen);
|
||||
if (err == 0 && *name != '\0')
|
||||
+ return strdup(name);
|
||||
@ -20,5 +20,5 @@
|
||||
+ pthread_get_name_np(pthread_self(), name, kBufferLen);
|
||||
+ if (*name != '\0')
|
||||
return strdup(name);
|
||||
#endif // defined(OS_LINUX) || defined(OS_ANDROID)
|
||||
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
|
||||
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- src/3rdparty/chromium/base/security_unittest.cc.orig 2020-04-08 09:41:36 UTC
|
||||
+++ src/3rdparty/chromium/base/security_unittest.cc
|
||||
@@ -60,7 +60,7 @@ NOINLINE Type HideValueFromCompiler(volatile Type valu
|
||||
// FAILS_ is too clunky.
|
||||
void OverflowTestsSoftExpectTrue(bool overflow_detected) {
|
||||
if (!overflow_detected) {
|
||||
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_MACOSX)
|
||||
+#if defined(OS_POSIX) && !defined(OS_NACL)
|
||||
// Sadly, on Linux, Android, and OSX we don't have a good story yet. Don't
|
||||
// fail the test, but report.
|
||||
printf("Platform has overflow: %s\n",
|
@ -1,12 +1,15 @@
|
||||
--- src/3rdparty/chromium/base/synchronization/lock_impl.h.orig 2020-04-08 09:41:36 UTC
|
||||
--- src/3rdparty/chromium/base/synchronization/lock_impl.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/synchronization/lock_impl.h
|
||||
@@ -67,10 +67,13 @@ void LockImpl::Unlock() {
|
||||
::ReleaseSRWLockExclusive(reinterpret_cast<PSRWLOCK>(&native_handle_));
|
||||
@@ -105,6 +105,8 @@ void LockImpl::Unlock() {
|
||||
}
|
||||
|
||||
#elif defined(OS_POSIX) || defined(OS_FUCHSIA)
|
||||
+#pragma GCC diagnostic push
|
||||
+#pragma GCC diagnostic ignored "-Wthread-safety-analysis"
|
||||
void LockImpl::Unlock() {
|
||||
|
||||
bool LockImpl::Try() {
|
||||
int rv = pthread_mutex_trylock(&native_handle_);
|
||||
@@ -116,6 +118,7 @@ void LockImpl::Unlock() {
|
||||
int rv = pthread_mutex_unlock(&native_handle_);
|
||||
DCHECK_EQ(rv, 0) << ". " << strerror(rv);
|
||||
}
|
||||
|
@ -1,20 +1,20 @@
|
||||
--- src/3rdparty/chromium/base/syslog_logging.cc.orig 2019-11-27 21:12:25 UTC
|
||||
--- src/3rdparty/chromium/base/syslog_logging.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/syslog_logging.cc
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "base/callback_helpers.h"
|
||||
#include "base/debug/stack_trace.h"
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/win/scoped_handle.h"
|
||||
#include "base/win/win_util.h"
|
||||
-#elif defined(OS_LINUX)
|
||||
+#elif defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#elif defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
// <syslog.h> defines LOG_INFO, LOG_WARNING macros that could conflict with
|
||||
// base::LOG_INFO, base::LOG_WARNING.
|
||||
#include <syslog.h>
|
||||
@@ -110,7 +110,7 @@ EventLogMessage::~EventLogMessage() {
|
||||
@@ -134,7 +134,7 @@ EventLogMessage::~EventLogMessage() {
|
||||
|
||||
if (user_sid != nullptr)
|
||||
::LocalFree(user_sid);
|
||||
-#elif defined(OS_LINUX)
|
||||
+#elif defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#elif defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
const char kEventSource[] = "chrome";
|
||||
openlog(kEventSource, LOG_NOWAIT | LOG_PID, LOG_USER);
|
||||
// We can't use the defined names for the logging severity from syslog.h
|
||||
|
@ -1,11 +1,11 @@
|
||||
--- src/3rdparty/chromium/base/system/sys_info.cc.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/base/system/sys_info.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/system/sys_info.cc
|
||||
@@ -102,7 +102,7 @@ void SysInfo::GetHardwareInfo(base::OnceCallback<void(
|
||||
#elif defined(OS_ANDROID) || defined(OS_MACOSX)
|
||||
@@ -104,7 +104,7 @@ void SysInfo::GetHardwareInfo(base::OnceCallback<void(
|
||||
#elif defined(OS_ANDROID) || defined(OS_APPLE)
|
||||
base::ThreadPool::PostTaskAndReplyWithResult(
|
||||
FROM_HERE, {}, base::BindOnce(&GetHardwareInfoSync), std::move(callback));
|
||||
-#elif defined(OS_LINUX)
|
||||
+#elif defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#elif defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
base::ThreadPool::PostTaskAndReplyWithResult(
|
||||
FROM_HERE, {base::MayBlock()}, base::BindOnce(&GetHardwareInfoSync),
|
||||
std::move(callback));
|
||||
|
@ -1,7 +1,7 @@
|
||||
--- src/3rdparty/chromium/base/system/sys_info.h.orig 2020-03-16 14:04:24 UTC
|
||||
--- src/3rdparty/chromium/base/system/sys_info.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/system/sys_info.h
|
||||
@@ -188,6 +188,8 @@ class BASE_EXPORT SysInfo {
|
||||
// See also SysUtils.java, method isLowEndDevice.
|
||||
@@ -202,6 +202,8 @@ class BASE_EXPORT SysInfo {
|
||||
// On Desktop this returns true when memory <= 512MB.
|
||||
static bool IsLowEndDevice();
|
||||
|
||||
+ static uint64_t MaxSharedMemorySize();
|
||||
@ -9,12 +9,12 @@
|
||||
private:
|
||||
FRIEND_TEST_ALL_PREFIXES(SysInfoTest, AmountOfAvailablePhysicalMemory);
|
||||
FRIEND_TEST_ALL_PREFIXES(debug::SystemMetricsTest, ParseMeminfo);
|
||||
@@ -197,7 +199,7 @@ class BASE_EXPORT SysInfo {
|
||||
@@ -211,7 +213,7 @@ class BASE_EXPORT SysInfo {
|
||||
static bool IsLowEndDeviceImpl();
|
||||
static HardwareInfo GetHardwareInfoSync();
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_AIX)
|
||||
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_AIX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) || \
|
||||
defined(OS_AIX)
|
||||
static int64_t AmountOfAvailablePhysicalMemory(
|
||||
const SystemMemoryInfoKB& meminfo);
|
||||
#endif
|
||||
|
@ -1,9 +1,10 @@
|
||||
--- src/3rdparty/chromium/base/system/sys_info_freebsd.cc.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/base/system/sys_info_freebsd.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/system/sys_info_freebsd.cc
|
||||
@@ -9,30 +9,76 @@
|
||||
@@ -9,30 +9,95 @@
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/notreached.h"
|
||||
+#include "base/process/process_metrics.h"
|
||||
+#include "base/strings/string_util.h"
|
||||
|
||||
namespace base {
|
||||
@ -15,44 +16,61 @@
|
||||
- sysctlbyname("vm.stats.vm.v_page_count", &pages, &size, NULL, 0);
|
||||
- sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
|
||||
- if (pages == -1 || page_size == -1) {
|
||||
+ if(r == 0)
|
||||
+
|
||||
+ if (r == 0)
|
||||
+ r = sysctlbyname("vm.stats.vm.v_page_count", &pages, &size, NULL, 0);
|
||||
+ if(r == 0)
|
||||
+ r =sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
|
||||
+ if(r == -1) {
|
||||
+ if (r == 0)
|
||||
+ r = sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
|
||||
+
|
||||
+ if (r == -1) {
|
||||
NOTREACHED();
|
||||
return 0;
|
||||
}
|
||||
+
|
||||
return static_cast<int64_t>(pages) * page_size;
|
||||
}
|
||||
|
||||
+int64_t SysInfo::AmountOfAvailablePhysicalMemoryImpl() {
|
||||
+ int page_size, r = 0;
|
||||
+ unsigned pgfree, pginact, pgcache;
|
||||
+ unsigned int pgfree, pginact, pgcache;
|
||||
+ size_t size = sizeof(page_size);
|
||||
+ size_t szpg = sizeof(pgfree);
|
||||
+ if(r == 0)
|
||||
+
|
||||
+ if (r == 0)
|
||||
+ r = sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
|
||||
+ if(r == 0)
|
||||
+ if (r == 0)
|
||||
+ r = sysctlbyname("vm.stats.vm.v_free_count", &pgfree, &szpg, NULL, 0);
|
||||
+ if(r == 0)
|
||||
+ if (r == 0)
|
||||
+ r = sysctlbyname("vm.stats.vm.v_inactive_count", &pginact, &szpg, NULL, 0);
|
||||
+ if(r == 0)
|
||||
+ if (r == 0)
|
||||
+ r = sysctlbyname("vm.stats.vm.v_cache_count", &pgcache, &szpg, NULL, 0);
|
||||
+ if(r == -1) {
|
||||
+
|
||||
+ if (r == -1) {
|
||||
+ NOTREACHED();
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return static_cast<int64_t>((pgfree + pginact + pgcache) * page_size);
|
||||
+}
|
||||
+
|
||||
// static
|
||||
+int64_t SysInfo::AmountOfAvailablePhysicalMemory(const SystemMemoryInfoKB& info) {
|
||||
+ int64_t res_kb = info.available != 0
|
||||
+ ? info.available - info.active_file
|
||||
+ : info.free + info.reclaimable + info.inactive_file;
|
||||
+ return res_kb * 1024;
|
||||
+}
|
||||
+
|
||||
+// static
|
||||
+std::string SysInfo::CPUModelName() {
|
||||
+ int mib[] = { CTL_HW, HW_MODEL };
|
||||
+ char name[256];
|
||||
+ size_t size = base::size(name);
|
||||
+ if (sysctl(mib, base::size(mib), &name, &size, NULL, 0) == 0)
|
||||
+
|
||||
+ if (sysctl(mib, base::size(mib), &name, &size, NULL, 0) == 0) {
|
||||
+ return name;
|
||||
+ }
|
||||
+
|
||||
+ return std::string();
|
||||
+}
|
||||
+
|
||||
@ -71,12 +89,13 @@
|
||||
+
|
||||
+SysInfo::HardwareInfo SysInfo::GetHardwareInfoSync() {
|
||||
+ HardwareInfo info;
|
||||
+ // Set the manufacturer to "FreeBSD" and the model to
|
||||
+ // an empty string.
|
||||
+
|
||||
+ info.manufacturer = "FreeBSD";
|
||||
+ info.model = HardwareModelName();
|
||||
+
|
||||
+ DCHECK(IsStringUTF8(info.manufacturer));
|
||||
+ DCHECK(IsStringUTF8(info.model));
|
||||
+
|
||||
+ return info;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- src/3rdparty/chromium/base/system/sys_info_posix.cc.orig 2019-11-27 21:12:25 UTC
|
||||
--- src/3rdparty/chromium/base/system/sys_info_posix.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/system/sys_info_posix.cc
|
||||
@@ -220,6 +220,8 @@ std::string SysInfo::OperatingSystemArchitecture() {
|
||||
@@ -223,6 +223,8 @@ std::string SysInfo::OperatingSystemArchitecture() {
|
||||
arch = "x86";
|
||||
} else if (arch == "amd64") {
|
||||
arch = "x86_64";
|
||||
|
@ -0,0 +1,15 @@
|
||||
--- src/3rdparty/chromium/base/test/BUILD.gn.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/test/BUILD.gn
|
||||
@@ -415,7 +415,11 @@ if (is_linux || is_chromeos) {
|
||||
|
||||
copy("fonts_conf") {
|
||||
sources = [ "fonts.conf" ]
|
||||
- outputs = [ "${root_build_dir}/etc/fonts/{{source_file_part}}" ]
|
||||
+ if (is_bsd) {
|
||||
+ outputs = [ "${root_build_dir}/%%LOCALBASE%%/etc/fonts/{{source_file_part}}" ]
|
||||
+ } else {
|
||||
+ outputs = [ "${root_build_dir}/etc/fonts/{{source_file_part}}" ]
|
||||
+ }
|
||||
}
|
||||
|
||||
if (current_toolchain == host_toolchain) {
|
@ -0,0 +1,11 @@
|
||||
--- src/3rdparty/chromium/base/test/test_file_util_posix.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/test/test_file_util_posix.cc
|
||||
@@ -87,7 +87,7 @@ void SyncPageCacheToDisk() {
|
||||
sync();
|
||||
}
|
||||
|
||||
-#if !defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_APPLE) && \
|
||||
+#if !defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_APPLE) && !defined(OS_BSD) && \
|
||||
!defined(OS_ANDROID)
|
||||
bool EvictFileFromSystemCache(const FilePath& file) {
|
||||
// There doesn't seem to be a POSIX way to cool the disk cache.
|
@ -0,0 +1,37 @@
|
||||
--- src/3rdparty/chromium/base/test/test_suite.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/test/test_suite.cc
|
||||
@@ -66,7 +66,7 @@
|
||||
#include "base/test/test_support_android.h"
|
||||
#endif
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
#include "base/test/fontconfig_util_linux.h"
|
||||
#endif
|
||||
|
||||
@@ -382,14 +382,14 @@ void TestSuite::PreInitialize() {
|
||||
testing::GTEST_FLAG(catch_exceptions) = false;
|
||||
#endif
|
||||
EnableTerminationOnHeapCorruption();
|
||||
-#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(USE_AURA)
|
||||
+#if (defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)) && defined(USE_AURA)
|
||||
// When calling native char conversion functions (e.g wrctomb) we need to
|
||||
// have the locale set. In the absence of such a call the "C" locale is the
|
||||
// default. In the gtk code (below) gtk_init() implicitly sets a locale.
|
||||
setlocale(LC_ALL, "");
|
||||
// We still need number to string conversions to be locale insensitive.
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
-#endif // (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(USE_AURA)
|
||||
+#endif // (defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)) && defined(USE_AURA)
|
||||
|
||||
// On Android, AtExitManager is created in
|
||||
// testing/android/native_test_wrapper.cc before main() is called.
|
||||
@@ -650,7 +650,7 @@ void TestSuite::Initialize() {
|
||||
// TODO(jshin): Should we set the locale via an OS X locale API here?
|
||||
i18n::SetICUDefaultLocale("en_US");
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
SetUpFontconfig();
|
||||
#endif
|
||||
|
@ -1,11 +1,11 @@
|
||||
--- src/3rdparty/chromium/base/third_party/libevent/BUILD.gn.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/base/third_party/libevent/BUILD.gn.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/third_party/libevent/BUILD.gn
|
||||
@@ -48,13 +48,20 @@ static_library("bundled_libevent") {
|
||||
"mac/event-config.h",
|
||||
]
|
||||
include_dirs = [ "mac" ]
|
||||
- } else if (is_linux) {
|
||||
+ } else if (is_linux && !is_bsd) {
|
||||
- } else if (is_linux || is_chromeos) {
|
||||
+ } else if ((is_linux || is_chromeos) && !is_bsd) {
|
||||
sources += [
|
||||
"epoll.c",
|
||||
"linux/config.h",
|
||||
@ -13,7 +13,7 @@
|
||||
]
|
||||
include_dirs = [ "linux" ]
|
||||
+ } else if (is_bsd) {
|
||||
+ sources += [
|
||||
+ sources += [
|
||||
+ "kqueue.c",
|
||||
+ "freebsd/config.h",
|
||||
+ "freebsd/event-config.h",
|
||||
|
@ -1,11 +1,11 @@
|
||||
--- src/3rdparty/chromium/base/threading/platform_thread.h.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/base/threading/platform_thread.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/threading/platform_thread.h
|
||||
@@ -217,7 +217,7 @@ class BASE_EXPORT PlatformThread {
|
||||
@@ -230,7 +230,7 @@ class BASE_EXPORT PlatformThread {
|
||||
// Returns a realtime period provided by |delegate|.
|
||||
static TimeDelta GetRealtimePeriod(Delegate* delegate);
|
||||
|
||||
static ThreadPriority GetCurrentThreadPriority();
|
||||
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
// Toggles a specific thread's priority at runtime. This can be used to
|
||||
// change the priority of a thread in a different process and will fail
|
||||
// if the calling process does not have proper permissions. The
|
||||
|
@ -0,0 +1,18 @@
|
||||
--- src/3rdparty/chromium/base/threading/platform_thread_internal_posix.h.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/threading/platform_thread_internal_posix.h
|
||||
@@ -47,13 +47,13 @@ Optional<ThreadPriority> GetCurrentThreadPriorityForPl
|
||||
// of CanIncreaseThreadPriority().
|
||||
Optional<ThreadPriority> GetCurrentThreadPriorityForPlatform();
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
// Current thread id is cached in thread local storage for performance reasons.
|
||||
// In some rare cases it's important to clear that cache explicitly (e.g. after
|
||||
// going through clone() syscall which does not call pthread_atfork()
|
||||
// handlers).
|
||||
BASE_EXPORT void ClearTidCache();
|
||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
|
||||
} // namespace internal
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- src/3rdparty/chromium/base/threading/platform_thread_linux.cc.orig 2019-05-23 12:39:34 UTC
|
||||
--- src/3rdparty/chromium/base/threading/platform_thread_linux.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/threading/platform_thread_linux.cc
|
||||
@@ -18,7 +18,9 @@
|
||||
@@ -24,7 +24,9 @@
|
||||
|
||||
#if !defined(OS_NACL) && !defined(OS_AIX)
|
||||
#include <pthread.h>
|
||||
@ -10,7 +10,7 @@
|
||||
#include <sys/resource.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
@@ -99,7 +101,7 @@ const ThreadPriorityToNiceValuePair kThreadPriorityToN
|
||||
@@ -264,7 +266,7 @@ Optional<bool> CanIncreaseCurrentThreadPriorityForPlat
|
||||
|
||||
Optional<bool> CanIncreaseCurrentThreadPriorityForPlatform(
|
||||
ThreadPriority priority) {
|
||||
@ -19,7 +19,7 @@
|
||||
// A non-zero soft-limit on RLIMIT_RTPRIO is required to be allowed to invoke
|
||||
// pthread_setschedparam in SetCurrentThreadPriorityForPlatform().
|
||||
struct rlimit rlim;
|
||||
@@ -141,7 +143,7 @@ Optional<ThreadPriority> GetCurrentThreadPriorityForPl
|
||||
@@ -314,7 +316,7 @@ void PlatformThread::SetName(const std::string& name)
|
||||
void PlatformThread::SetName(const std::string& name) {
|
||||
ThreadIdNameManager::GetInstance()->SetName(name);
|
||||
|
||||
|
@ -1,11 +1,54 @@
|
||||
--- src/3rdparty/chromium/base/threading/platform_thread_posix.cc.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/base/threading/platform_thread_posix.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/threading/platform_thread_posix.cc
|
||||
@@ -61,7 +61,7 @@ void* ThreadFunc(void* params) {
|
||||
if (!thread_params->joinable)
|
||||
base::ThreadRestrictions::SetSingletonAllowed(false);
|
||||
@@ -32,6 +32,10 @@
|
||||
#include <sys/syscall.h>
|
||||
#endif
|
||||
|
||||
-#if !defined(OS_NACL)
|
||||
+#if !defined(OS_NACL) && !defined(OS_BSD)
|
||||
// Threads on linux/android may inherit their priority from the thread
|
||||
// where they were created. This explicitly sets the priority of all new
|
||||
// threads.
|
||||
+#if defined(OS_BSD)
|
||||
+#include <pthread_np.h>
|
||||
+#endif
|
||||
+
|
||||
#if defined(OS_FUCHSIA)
|
||||
#include <zircon/process.h>
|
||||
#else
|
||||
@@ -141,7 +145,7 @@ bool CreateThread(size_t stack_size,
|
||||
return success;
|
||||
}
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
|
||||
// Store the thread ids in local storage since calling the SWI can
|
||||
// expensive and PlatformThread::CurrentId is used liberally. Clear
|
||||
@@ -159,11 +163,11 @@ class InitAtFork {
|
||||
InitAtFork() { pthread_atfork(nullptr, nullptr, internal::ClearTidCache); }
|
||||
};
|
||||
|
||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSSD)
|
||||
|
||||
} // namespace
|
||||
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
|
||||
namespace internal {
|
||||
|
||||
@@ -173,7 +177,7 @@ void ClearTidCache() {
|
||||
|
||||
} // namespace internal
|
||||
|
||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
|
||||
// static
|
||||
PlatformThreadId PlatformThread::CurrentId() {
|
||||
@@ -181,6 +185,8 @@ PlatformThreadId PlatformThread::CurrentId() {
|
||||
// into the kernel.
|
||||
#if defined(OS_APPLE)
|
||||
return pthread_mach_thread_np(pthread_self());
|
||||
+#elif defined(OS_BSD)
|
||||
+ return pthread_getthreadid_np();
|
||||
#elif defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
static NoDestructor<InitAtFork> init_at_fork;
|
||||
if (g_thread_id == -1) {
|
||||
|
@ -1,14 +1,14 @@
|
||||
--- src/3rdparty/chromium/base/threading/thread_task_runner_handle.cc.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/base/threading/thread_task_runner_handle.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/threading/thread_task_runner_handle.cc
|
||||
@@ -7,6 +7,7 @@
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <utility>
|
||||
|
||||
#include "base/bind.h"
|
||||
+#include "base/callback_helpers.h"
|
||||
#include "base/check_op.h"
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
@@ -37,6 +38,7 @@ bool ThreadTaskRunnerHandle::IsSet() {
|
||||
#include "base/run_loop.h"
|
||||
@@ -38,6 +39,7 @@ bool ThreadTaskRunnerHandle::IsSet() {
|
||||
return !!thread_task_runner_tls.Pointer()->Get();
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
// static
|
||||
ScopedClosureRunner ThreadTaskRunnerHandle::OverrideForTesting(
|
||||
scoped_refptr<SingleThreadTaskRunner> overriding_task_runner) {
|
||||
@@ -86,6 +88,7 @@ ScopedClosureRunner ThreadTaskRunnerHandle::OverrideFo
|
||||
@@ -82,6 +84,7 @@ ScopedClosureRunner ThreadTaskRunnerHandle::OverrideFo
|
||||
base::Unretained(ttrh->task_runner_.get()),
|
||||
std::move(no_running_during_override)));
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
--- src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc
|
||||
@@ -17,6 +17,8 @@
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_APPLE)
|
||||
#include <malloc/malloc.h>
|
||||
+#elif defined(OS_BSD)
|
||||
+#include <stdlib.h>
|
||||
|
@ -1,11 +1,11 @@
|
||||
--- src/3rdparty/chromium/base/trace_event/process_memory_dump.cc.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/base/trace_event/process_memory_dump.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/trace_event/process_memory_dump.cc
|
||||
@@ -93,7 +93,7 @@ size_t ProcessMemoryDump::CountResidentBytes(void* sta
|
||||
@@ -95,7 +95,7 @@ size_t ProcessMemoryDump::CountResidentBytes(void* sta
|
||||
#if defined(OS_WIN)
|
||||
std::unique_ptr<PSAPI_WORKING_SET_EX_INFORMATION[]> vec(
|
||||
new PSAPI_WORKING_SET_EX_INFORMATION[max_vec_size]);
|
||||
-#elif defined(OS_MACOSX)
|
||||
+#elif defined(OS_MACOSX) || defined(OS_BSD)
|
||||
-#elif defined(OS_APPLE)
|
||||
+#elif defined(OS_APPLE) || defined(OS_BSD)
|
||||
std::unique_ptr<char[]> vec(new char[max_vec_size]);
|
||||
#elif defined(OS_POSIX) || defined(OS_FUCHSIA)
|
||||
std::unique_ptr<unsigned char[]> vec(new unsigned char[max_vec_size]);
|
||||
|
@ -0,0 +1,20 @@
|
||||
--- src/3rdparty/chromium/base/util/memory_pressure/system_memory_pressure_evaluator.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/base/util/memory_pressure/system_memory_pressure_evaluator.cc
|
||||
@@ -14,7 +14,7 @@
|
||||
#elif defined(OS_WIN)
|
||||
#include "base/util/memory_pressure/system_memory_pressure_evaluator_win.h"
|
||||
#include "base/win/windows_version.h"
|
||||
-#elif defined(OS_LINUX) && !defined(OS_CHROMEOS)
|
||||
+#elif (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_BSD)
|
||||
#include "base/util/memory_pressure/system_memory_pressure_evaluator_linux.h"
|
||||
#endif
|
||||
|
||||
@@ -45,7 +45,7 @@ SystemMemoryPressureEvaluator::CreateDefaultSystemEval
|
||||
evaluator->CreateOSSignalPressureEvaluator(monitor->CreateVoter());
|
||||
}
|
||||
return evaluator;
|
||||
-#elif defined(OS_LINUX) && !defined(OS_CHROMEOS)
|
||||
+#elif (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_BSD)
|
||||
return std::make_unique<util::os_linux::SystemMemoryPressureEvaluator>(
|
||||
monitor->CreateVoter());
|
||||
#endif
|
@ -1,17 +1,17 @@
|
||||
--- src/3rdparty/chromium/build/config/BUILD.gn.orig 2019-05-23 12:39:34 UTC
|
||||
--- src/3rdparty/chromium/build/config/BUILD.gn.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/build/config/BUILD.gn
|
||||
@@ -166,7 +166,7 @@ config("debug") {
|
||||
@@ -137,7 +137,7 @@ config("debug") {
|
||||
# builds, and we have to tell it to turn it off.
|
||||
defines += [ "_HAS_ITERATOR_DEBUGGING=0" ]
|
||||
}
|
||||
- } else if (is_linux && current_cpu == "x64" && enable_iterator_debugging) {
|
||||
+ } else if ((is_linux || is_bsd) && current_cpu == "x64" && enable_iterator_debugging) {
|
||||
- } else if ((is_linux || is_chromeos) && current_cpu == "x64" && enable_iterator_debugging) {
|
||||
+ } else if ((is_linux || is_chromeos || is_bsd) && current_cpu == "x64" && enable_iterator_debugging) {
|
||||
# Enable libstdc++ debugging facilities to help catch problems early, see
|
||||
# http://crbug.com/65151 .
|
||||
# TODO(phajdan.jr): Should we enable this for all of POSIX?
|
||||
@@ -267,9 +267,7 @@ config("default_libs") {
|
||||
@@ -235,9 +235,7 @@ config("default_libs") {
|
||||
]
|
||||
} else if (is_linux) {
|
||||
} else if (is_linux || is_chromeos) {
|
||||
libs = [
|
||||
- "dl",
|
||||
"pthread",
|
||||
@ -19,12 +19,12 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -346,7 +344,7 @@ config("executable_config") {
|
||||
@@ -320,7 +318,7 @@ config("executable_config") {
|
||||
"//build/config/ios:ios_dynamic_flags",
|
||||
"//build/config/ios:ios_executable_flags",
|
||||
]
|
||||
- } else if (is_linux || is_android || current_os == "aix") {
|
||||
+ } else if (is_linux || is_bsd || is_android || current_os == "aix") {
|
||||
- } else if (is_linux || is_chromeos || is_android || current_os == "aix") {
|
||||
+ } else if (is_linux || is_bsd || is_chromeos || is_android || current_os == "aix") {
|
||||
configs += [ "//build/config/gcc:executable_config" ]
|
||||
if (is_chromecast) {
|
||||
configs += [ "//build/config/chromecast:executable_config" ]
|
||||
|
@ -1,4 +1,4 @@
|
||||
--- src/3rdparty/chromium/build/config/BUILDCONFIG.gn.orig 2019-05-23 12:39:34 UTC
|
||||
--- src/3rdparty/chromium/build/config/BUILDCONFIG.gn.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/build/config/BUILDCONFIG.gn
|
||||
@@ -131,10 +131,10 @@ declare_args() {
|
||||
is_official_build = false
|
||||
@ -33,16 +33,16 @@
|
||||
# See comments in build/toolchain/cros/BUILD.gn about board compiles.
|
||||
if (is_clang) {
|
||||
_default_toolchain = "//build/toolchain/linux:clang_$target_cpu"
|
||||
@@ -296,10 +296,11 @@ is_android = current_os == "android"
|
||||
@@ -290,10 +290,11 @@ is_android = current_os == "android"
|
||||
# current_os value directly.
|
||||
|
||||
is_android = current_os == "android"
|
||||
+is_bsd = current_os == "freebsd"
|
||||
is_chromeos = current_os == "chromeos"
|
||||
is_fuchsia = current_os == "fuchsia"
|
||||
is_ios = current_os == "ios"
|
||||
-is_linux = current_os == "chromeos" || current_os == "linux"
|
||||
+is_linux = current_os == "chromeos" || current_os == "linux" || current_os == "freebsd"
|
||||
-is_linux = current_os == "linux"
|
||||
+is_linux = current_os == "linux" || current_os == "freebsd"
|
||||
is_mac = current_os == "mac"
|
||||
is_nacl = current_os == "nacl"
|
||||
is_win = current_os == "win" || current_os == "winuwp"
|
||||
+is_bsd = current_os == "freebsd"
|
||||
|
||||
is_posix = !is_win && !is_fuchsia
|
||||
|
||||
|
@ -1,24 +1,24 @@
|
||||
--- src/3rdparty/chromium/build/config/compiler/BUILD.gn.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/build/config/compiler/BUILD.gn.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/build/config/compiler/BUILD.gn
|
||||
@@ -144,7 +144,7 @@ declare_args() {
|
||||
# 'is_android' breaks content_shell_test_apk on android-kitkat-arm-rel.
|
||||
# 'use_xcode_clang' may call old clang.
|
||||
init_stack_vars =
|
||||
- !is_android && !use_xcode_clang && (!is_official_build || is_linux)
|
||||
+ !is_android && !use_xcode_clang && (!is_official_build || is_linux) && !is_bsd
|
||||
@@ -134,7 +134,7 @@ declare_args() {
|
||||
#
|
||||
# TODO(crbug.com/977230): Enabling this when 'use_xcode_clang' is true may
|
||||
# call an old clang that doesn't support auto-init.
|
||||
- init_stack_vars = !is_android && !use_xcode_clang
|
||||
+ init_stack_vars = !is_android && !use_xcode_clang && !is_bsd
|
||||
|
||||
# This argument is to control whether enabling text section splitting in the
|
||||
# final binary. When enabled, the separated text sections with prefix
|
||||
@@ -313,7 +313,7 @@ config("compiler") {
|
||||
@@ -297,7 +297,7 @@ config("compiler") {
|
||||
}
|
||||
|
||||
# Linker warnings.
|
||||
- if (fatal_linker_warnings && !is_mac && !is_ios && current_os != "aix") {
|
||||
+ if (fatal_linker_warnings && !is_mac && !is_ios && !is_bsd && current_os != "aix") {
|
||||
- if (fatal_linker_warnings && !is_apple && current_os != "aix") {
|
||||
+ if (fatal_linker_warnings && !is_apple && !is_bsd && current_os != "aix") {
|
||||
ldflags += [ "-Wl,--fatal-warnings" ]
|
||||
}
|
||||
if (fatal_linker_warnings && (is_mac || is_ios)) {
|
||||
@@ -419,7 +419,7 @@ config("compiler") {
|
||||
if (fatal_linker_warnings && is_apple &&
|
||||
@@ -407,7 +407,7 @@ config("compiler") {
|
||||
|
||||
# Compiler instrumentation can introduce dependencies in DSOs to symbols in
|
||||
# the executable they are loaded into, so they are unresolved at link-time.
|
||||
@ -27,16 +27,7 @@
|
||||
ldflags += [
|
||||
"-Wl,-z,defs",
|
||||
"-Wl,--as-needed",
|
||||
@@ -518,7 +518,7 @@ config("compiler") {
|
||||
ldflags += [ "-Wl,-z,keep-text-section-prefix" ]
|
||||
}
|
||||
|
||||
- if (is_clang && !is_nacl && !use_xcode_clang && !use_qt) {
|
||||
+ if (is_clang && !is_nacl && !use_xcode_clang && !use_qt && !is_bsd) {
|
||||
cflags += [ "-fcrash-diagnostics-dir=" +
|
||||
rebase_path("//tools/clang/crashreports", root_build_dir) ]
|
||||
|
||||
@@ -789,7 +789,7 @@ config("compiler_cpu_abi") {
|
||||
@@ -795,7 +795,7 @@ config("compiler_cpu_abi") {
|
||||
cflags += [ "-mtune=$arm_tune" ]
|
||||
}
|
||||
} else if (current_cpu == "arm64") {
|
||||
@ -45,7 +36,7 @@
|
||||
cflags += [ "--target=aarch64-linux-gnu" ]
|
||||
ldflags += [ "--target=aarch64-linux-gnu" ]
|
||||
}
|
||||
@@ -1139,7 +1139,7 @@ config("compiler_deterministic") {
|
||||
@@ -1148,7 +1148,7 @@ config("compiler_deterministic") {
|
||||
"-Xclang",
|
||||
".",
|
||||
]
|
||||
@ -54,7 +45,7 @@
|
||||
# We don't use clang -cc1as on Windows (yet? https://crbug.com/762167)
|
||||
asmflags = [ "-Wa,-fdebug-compilation-dir,." ]
|
||||
}
|
||||
@@ -1541,7 +1541,7 @@ config("default_warnings") {
|
||||
@@ -1550,7 +1550,7 @@ config("default_warnings") {
|
||||
cflags += [ "-Wno-nonportable-include-path" ]
|
||||
}
|
||||
|
||||
@ -63,16 +54,25 @@
|
||||
# Flags NaCl (Clang 3.7) and Xcode 9.2 (Clang clang-900.0.39.2) do not
|
||||
# recognize.
|
||||
cflags += [
|
||||
@@ -1791,7 +1791,7 @@ config("thin_archive") {
|
||||
@@ -1724,7 +1724,7 @@ config("no_chromium_code") {
|
||||
# suppressing them individually, we just blanket suppress them here.
|
||||
"-Wno-unused-variable",
|
||||
]
|
||||
- if (!is_nacl && (current_toolchain == host_toolchain || !use_xcode_clang)) {
|
||||
+ if (!is_nacl && (current_toolchain == host_toolchain || !use_xcode_clang) && !is_bsd) {
|
||||
cflags += [
|
||||
# TODO(https://crbug.com/1031169): Clean up and enable.
|
||||
"-Wno-misleading-indentation",
|
||||
@@ -1802,7 +1802,7 @@ config("thin_archive") {
|
||||
# Mac and iOS use the mac-specific "libtool" command, not ar, which doesn't
|
||||
# have a "thin archive" mode (it does accept -T, but it means truncating
|
||||
# archive names to 16 characters, which is not what we want).
|
||||
- if ((is_posix && !is_nacl && !is_mac && !is_ios) || is_fuchsia) {
|
||||
+ if ((is_posix && !is_nacl && !is_mac && !is_ios && !is_bsd) || is_fuchsia) {
|
||||
- if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) {
|
||||
+ if ((is_posix && !is_nacl && !is_apple && !is_bsd) || is_fuchsia) {
|
||||
arflags = [ "-T" ]
|
||||
} else if (is_win && use_lld) {
|
||||
arflags = [ "/llvmlibthin" ]
|
||||
@@ -2323,7 +2323,7 @@ config("symbols") {
|
||||
@@ -2343,7 +2343,7 @@ config("symbols") {
|
||||
# flag, so we can use use -g1 for pnacl and nacl-clang compiles.
|
||||
# gcc nacl is is_nacl && !is_clang, pnacl and nacl-clang are && is_clang.
|
||||
if (!is_nacl || is_clang) {
|
||||
@ -80,11 +80,11 @@
|
||||
+ cflags += [ "-g0" ]
|
||||
}
|
||||
|
||||
if (is_clang && !is_nacl && !use_xcode_clang && !use_qt) {
|
||||
@@ -2351,7 +2351,7 @@ config("symbols") {
|
||||
# TODO(https://crbug.com/1050118): Investigate missing debug info on mac.
|
||||
@@ -2385,7 +2385,7 @@ config("symbols") {
|
||||
# DWARF info may be corrupt; offsets in a range list entry are in different
|
||||
# sections" there. Maybe just a bug in nacl_switch_32.S.
|
||||
if (!is_mac && !is_ios && !is_nacl && current_cpu != "x86" &&
|
||||
if (!is_apple && !is_nacl && current_cpu != "x86" &&
|
||||
- (use_gold || use_lld)) {
|
||||
+ (use_gold || use_lld) && !is_bsd) {
|
||||
if (is_clang) {
|
||||
|
@ -1,15 +1,6 @@
|
||||
--- src/3rdparty/chromium/build/config/compiler/compiler.gni.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/build/config/compiler/compiler.gni.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/build/config/compiler/compiler.gni
|
||||
@@ -47,7 +47,7 @@ declare_args() {
|
||||
# only two architectures that are currently checked in). Turn this off when
|
||||
# you are using a custom toolchain and need to control -B in cflags.
|
||||
linux_use_bundled_binutils =
|
||||
- linux_use_bundled_binutils_override && is_linux &&
|
||||
+ linux_use_bundled_binutils_override && (is_linux && !is_bsd) &&
|
||||
(current_cpu == "x64" || current_cpu == "x86")
|
||||
binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin",
|
||||
root_build_dir)
|
||||
@@ -193,7 +193,7 @@ declare_args() {
|
||||
@@ -195,7 +195,7 @@ declare_args() {
|
||||
declare_args() {
|
||||
# Whether to use the gold linker from binutils instead of lld or bfd.
|
||||
use_gold =
|
||||
|
@ -1,11 +1,11 @@
|
||||
--- src/3rdparty/chromium/build/config/features.gni.orig 2020-04-29 07:57:35 UTC
|
||||
--- src/3rdparty/chromium/build/config/features.gni.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/build/config/features.gni
|
||||
@@ -26,7 +26,7 @@ declare_args() {
|
||||
proprietary_codecs = is_chrome_branded || is_chromecast
|
||||
|
||||
# libudev usage. This currently only affects the content layer.
|
||||
- use_udev = is_linux && !is_chromecast
|
||||
+ use_udev = is_linux && !is_chromecast && !is_bsd
|
||||
- use_udev = (is_linux || is_chromeos) && !is_chromecast
|
||||
+ use_udev = (is_linux || is_chromeos) && !is_chromecast && !is_bsd
|
||||
|
||||
use_dbus = is_linux && !is_chromecast
|
||||
use_dbus = (is_linux || is_chromeos) && !is_chromecast
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
--- src/3rdparty/chromium/build/config/freetype/freetype.gni.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/build/config/freetype/freetype.gni
|
||||
@@ -10,7 +10,7 @@ declare_args() {
|
||||
# than version 2.7.1 and have color bitmap support compiled in. WARNING:
|
||||
# System FreeType configurations other than as described WILL INTRODUCE TEXT
|
||||
# RENDERING AND SECURITY REGRESSIONS.
|
||||
- use_system_freetype = false
|
||||
+ use_system_freetype = true
|
||||
use_qt_freetype = false
|
||||
qt_freetype_includes = ""
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
--- src/3rdparty/chromium/build/detect_host_arch.py.orig 2019-05-23 12:39:34 UTC
|
||||
--- src/3rdparty/chromium/build/detect_host_arch.py.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/build/detect_host_arch.py
|
||||
@@ -19,6 +19,8 @@ def HostArch():
|
||||
@@ -21,6 +21,8 @@ def HostArch():
|
||||
host_arch = 'ia32'
|
||||
elif host_arch in ['x86_64', 'amd64']:
|
||||
host_arch = 'x64'
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- src/3rdparty/chromium/build/gn_run_binary.py.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/build/gn_run_binary.py.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/build/gn_run_binary.py
|
||||
@@ -19,7 +19,7 @@ path = './' + sys.argv[1]
|
||||
@@ -24,7 +24,7 @@ args = [path] + sys.argv[2:]
|
||||
# The rest of the arguments are passed directly to the executable.
|
||||
args = [path] + sys.argv[2:]
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
--- src/3rdparty/chromium/build/toolchain/gcc_toolchain.gni.orig 2020-11-07 01:22:36 UTC
|
||||
--- src/3rdparty/chromium/build/toolchain/gcc_toolchain.gni.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/build/toolchain/gcc_toolchain.gni
|
||||
@@ -36,6 +36,11 @@ if (is_linux && target_os == "android") {
|
||||
enable_resource_whitelist_generation = false
|
||||
@@ -50,6 +50,11 @@ if (enable_resource_allowlist_generation) {
|
||||
"enable_resource_allowlist_generation=true does not work for target_os=$target_os")
|
||||
}
|
||||
|
||||
+declare_args() {
|
||||
@ -12,7 +12,7 @@
|
||||
# This template defines a toolchain for something that works like gcc
|
||||
# (including clang).
|
||||
#
|
||||
@@ -589,13 +594,23 @@ template("clang_toolchain") {
|
||||
@@ -641,13 +646,23 @@ template("clang_toolchain") {
|
||||
}
|
||||
|
||||
gcc_toolchain(target_name) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- src/3rdparty/chromium/build/toolchain/get_concurrent_links.py.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/build/toolchain/get_concurrent_links.py.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/build/toolchain/get_concurrent_links.py
|
||||
@@ -46,6 +46,14 @@ def _GetTotalMemoryInBytes():
|
||||
@@ -53,6 +53,14 @@ def _GetTotalMemoryInBytes():
|
||||
return int(subprocess.check_output(['sysctl', '-n', 'hw.memsize']))
|
||||
except Exception:
|
||||
return 0
|
||||
|
@ -1,11 +1,11 @@
|
||||
--- src/3rdparty/chromium/chrome/browser/devtools/devtools_eye_dropper.cc.orig 2018-11-13 18:25:11 UTC
|
||||
--- src/3rdparty/chromium/chrome/browser/devtools/devtools_eye_dropper.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/chrome/browser/devtools/devtools_eye_dropper.cc
|
||||
@@ -211,7 +211,7 @@ void DevToolsEyeDropper::UpdateCursor() {
|
||||
@@ -163,7 +163,7 @@ void DevToolsEyeDropper::UpdateCursor() {
|
||||
// magnified projection only with centered hotspot.
|
||||
// Mac Retina requires cursor to be > 120px in order to render smoothly.
|
||||
|
||||
-#if defined(OS_LINUX)
|
||||
+#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
|
||||
const float kCursorSize = 63;
|
||||
const float kDiameter = 63;
|
||||
const float kHotspotOffset = 32;
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- src/3rdparty/chromium/chrome/browser/extensions/api/input_ime/input_ime_api.h.orig 2018-11-13 18:25:11 UTC
|
||||
+++ src/3rdparty/chromium/chrome/browser/extensions/api/input_ime/input_ime_api.h
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
#include "chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.h"
|
||||
-#elif defined(OS_LINUX) || defined(OS_WIN)
|
||||
+#elif defined(OS_LINUX) || defined(OS_WIN) || defined(OS_BSD)
|
||||
#include "chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.h"
|
||||
#endif // defined(OS_CHROMEOS)
|
||||
|
@ -1,20 +1,20 @@
|
||||
--- src/3rdparty/chromium/chrome/browser/extensions/api/settings_private/prefs_util.cc.orig 2019-11-27 21:12:25 UTC
|
||||
--- src/3rdparty/chromium/chrome/browser/extensions/api/settings_private/prefs_util.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -153,7 +153,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelist
|
||||
(*s_whitelist)[bookmarks::prefs::kShowBookmarkBar] =
|
||||
@@ -169,7 +169,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlist
|
||||
(*s_allowlist)[bookmarks::prefs::kShowBookmarkBar] =
|
||||
settings_api::PrefType::PREF_TYPE_BOOLEAN;
|
||||
|
||||
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
|
||||
+#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_BSD)
|
||||
(*s_whitelist)[::prefs::kUseCustomChromeFrame] =
|
||||
(*s_allowlist)[::prefs::kUseCustomChromeFrame] =
|
||||
settings_api::PrefType::PREF_TYPE_BOOLEAN;
|
||||
#endif
|
||||
@@ -163,7 +163,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelist
|
||||
@@ -179,7 +179,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlist
|
||||
// Appearance settings.
|
||||
(*s_whitelist)[::prefs::kCurrentThemeID] =
|
||||
(*s_allowlist)[::prefs::kCurrentThemeID] =
|
||||
settings_api::PrefType::PREF_TYPE_STRING;
|
||||
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
|
||||
+#if (defined(OS_BSD) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
|
||||
(*s_whitelist)[::prefs::kUsesSystemTheme] =
|
||||
+#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_BSD)
|
||||
(*s_allowlist)[::prefs::kUsesSystemTheme] =
|
||||
settings_api::PrefType::PREF_TYPE_BOOLEAN;
|
||||
#endif
|
||||
|
@ -0,0 +1,11 @@
|
||||
--- src/3rdparty/chromium/chrome/browser/media/webrtc/webrtc_event_log_uploader.cc.orig 2021-12-15 16:12:54 UTC
|
||||
+++ src/3rdparty/chromium/chrome/browser/media/webrtc/webrtc_event_log_uploader.cc
|
||||
@@ -42,6 +42,8 @@ const char kProduct[] = "Chrome_Linux";
|
||||
const char kProduct[] = "Chrome_ChromeOS";
|
||||
#elif defined(OS_LINUX)
|
||||
const char kProduct[] = "Chrome_Linux";
|
||||
+#elif defined(OS_FREEBSD)
|
||||
+const char kProduct[] = "Chrome_FreeBSD";
|
||||
#elif defined(OS_ANDROID)
|
||||
const char kProduct[] = "Chrome_Android";
|
||||
#else
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user