1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-27 00:57:50 +00:00

www/chromium: Update to version 87.0.4280.66

Submitted by:	Matthias Wolf, cem, rene
Obtained from:	Some patches from OpenBSD port (robert@openbsd.org)
This commit is contained in:
Joseph Mingrone 2020-12-01 04:06:37 +00:00
parent e5c06c3d46
commit a0dbfe2fb0
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=556709
914 changed files with 6920 additions and 5468 deletions

View File

@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= chromium
PORTVERSION= 85.0.4183.121
PORTREVISION= 3
PORTVERSION= 87.0.4280.66
CATEGORIES?= www java
MASTER_SITES= https://commondatastorage.googleapis.com/chromium-browser-official/ \
LOCAL/rene/chromium/:fonts
@ -60,7 +59,8 @@ LIB_DEPENDS= libatk-bridge-2.0.so:accessibility/at-spi2-atk \
libsecret-1.so:security/libsecret \
libnss3.so:security/nss \
libexpat.so:textproc/expat2 \
libfontconfig.so:x11-fonts/fontconfig
libfontconfig.so:x11-fonts/fontconfig \
libxkbcommon.so:x11/libxkbcommon
RUN_DEPENDS= xdg-open:devel/xdg-utils \
noto-basic>0:x11-fonts/noto-basic
@ -98,6 +98,10 @@ INSTALLS_ICONS= yes
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-clang
.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1300000
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-build_config_compiler_pgo_pgo.gni
.endif
# TODO bz@ : install libwidevinecdm.so (see third_party/widevine/cdm/BUILD.gn)
#
# Run "./out/${BUILDTYPE}/gn args out/${BUILDTYPE} --list" for all variables.
@ -237,12 +241,6 @@ post-extract-TEST-on:
@${MKDIR} ${WRKSRC}/third_party/test_fonts/test_fonts
@${MV} ${WRKDIR}/test_fonts ${WRKSRC}/third_party/test_fonts/
post-patch:
# XXX nop for www/chromium itself
@${REINPLACE_CMD} -e 's|@@PACKAGE@@|chromium|' \
-e 's|@@MENUNAME@@|Chromium Web Browser|' \
${WRKSRC}/chrome/app/resources/manpage.1.in
post-patch-SNDIO-on:
@${MKDIR} ${WRKSRC}/media/audio/sndio ${WRKSRC}/media/audio/openbsd
@${CP} ${FILESDIR}/sndio_output.* ${WRKSRC}/media/audio/sndio

View File

@ -1,7 +1,7 @@
TIMESTAMP = 1603266707
SHA256 (chromium-85.0.4183.121.tar.xz) = e018547e54566410fb365d9f3dae10037c30fca5debe6ba8baceef3ad3b03d28
SIZE (chromium-85.0.4183.121.tar.xz) = 833194480
SHA256 (chromium-85.0.4183.121-testdata.tar.xz) = 46735defc73e4f4836d9a36944cc18d258d826e57ac2d663d0fcb7281c17fea4
SIZE (chromium-85.0.4183.121-testdata.tar.xz) = 256914468
TIMESTAMP = 1605893526
SHA256 (chromium-87.0.4280.66.tar.xz) = 29a8e4ea82edec2fdcf34ece68323bec7ab90f3d5669e6b77f58cff9c278f741
SIZE (chromium-87.0.4280.66.tar.xz) = 856464608
SHA256 (chromium-87.0.4280.66-testdata.tar.xz) = f6f26bac71a58d36b1b47abdaf4b209b135877a15b6964b126f7677be101e676
SIZE (chromium-87.0.4280.66-testdata.tar.xz) = 257359532
SHA256 (test_fonts-85.tar.xz) = f22b61b3639acb147c98ec2e2305d8b96f0b55c8c74c40e2ea696402fae8cef9
SIZE (test_fonts-85.tar.xz) = 9511984

View File

@ -0,0 +1,11 @@
--- build/config/compiler/pgo/pgo.gni.orig 2020-11-24 12:45:30 UTC
+++ build/config/compiler/pgo/pgo.gni
@@ -12,7 +12,7 @@ declare_args() {
# 2 : Used during the PGO (optimization) phase.
chrome_pgo_phase = 0
if (is_official_build &&
- (is_win || is_mac || (is_desktop_linux && !chromeos_is_browser_only))) {
+ (is_win || is_mac || (is_desktop_linux && !chromeos_is_browser_only && !is_bsd))) {
chrome_pgo_phase = 2
}

View File

@ -27,14 +27,3 @@
if (*ptr == kFinalTlsValue)
return; // We've been called enough times.
ASSERT_LT(kFinalTlsValue, *ptr);
--- media/audio/audio_output_proxy_unittest.cc.orig 2019-03-11 22:00:59 UTC
+++ 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);

View File

@ -1,11 +1,11 @@
--- third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_internals_posix.h.orig 2020-07-07 22:03:25 UTC
--- third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_internals_posix.h.orig 2020-11-13 06:42:21 UTC
+++ third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_internals_posix.h
@@ -16,7 +16,7 @@
#if defined(OS_ANDROID)
#include <sys/prctl.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 <sys/resource.h>
#include <algorithm>

View File

@ -1,15 +1,15 @@
--- BUILD.gn.orig 2020-09-21 18:38:58 UTC
--- BUILD.gn.orig 2020-11-13 06:36:33 UTC
+++ BUILD.gn
@@ -427,7 +427,7 @@ group("gn_all") {
@@ -422,7 +422,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",
@@ -469,8 +469,6 @@ group("gn_all") {
@@ -463,8 +463,6 @@ group("gn_all") {
"//net:disk_cache_memory_test",
"//net:quic_client",
"//net:quic_server",
@ -18,7 +18,7 @@
"//testing:empty_main",
]
@@ -525,10 +523,6 @@ group("gn_all") {
@@ -519,10 +517,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",
@@ -588,10 +582,6 @@ group("gn_all") {
@@ -582,10 +576,6 @@ group("gn_all") {
"//mojo:mojo_perftests",
"//services/service_manager/public/cpp",
"//testing/gmock:gmock_main",
@ -40,7 +40,7 @@
]
if (!is_android) {
@@ -665,7 +655,7 @@ group("gn_all") {
@@ -663,7 +653,7 @@ group("gn_all") {
host_os == "win") {
deps += [ "//chrome/test/mini_installer:mini_installer_tests" ]
}
@ -49,16 +49,25 @@
deps += [ "//third_party/breakpad:symupload($host_toolchain)" ]
}
@@ -798,7 +788,6 @@ group("gn_all") {
@@ -678,7 +668,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",
@@ -797,7 +787,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) {
]
if (is_android) {
deps += [ "//chrome/browser/android/vr:vr_android_unittests" ]
@@ -1090,7 +1079,7 @@ if (!is_ios) {
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) {
@@ -1099,7 +1088,7 @@ if (!is_ios) {
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)" ]
}
@@ -1292,9 +1281,6 @@ group("chromium_builder_perf") {
@@ -1296,9 +1285,6 @@ group("chromium_builder_perf") {
if (is_win) {
data_deps += [ "//chrome/installer/mini_installer:mini_installer" ]

View File

@ -1,11 +1,11 @@
--- apps/app_restore_service_browsertest.cc.orig 2020-07-07 21:57:29 UTC
--- apps/app_restore_service_browsertest.cc.orig 2020-11-13 06:36:34 UTC
+++ apps/app_restore_service_browsertest.cc
@@ -148,7 +148,7 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, FileAcc
}
// Flaky: crbug.com/269613
-#if defined(OS_LINUX) || defined(OS_WIN)
+#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_BSD)
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN)
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) || defined(OS_BSD)
#define MAYBE_FileAccessIsRestored DISABLED_FileAccessIsRestored
#else
#define MAYBE_FileAccessIsRestored FileAccessIsRestored

View File

@ -1,6 +1,6 @@
--- apps/ui/views/app_window_frame_view.cc.orig 2019-06-04 18:55:14 UTC
--- apps/ui/views/app_window_frame_view.cc.orig 2020-11-13 06:36:34 UTC
+++ apps/ui/views/app_window_frame_view.cc
@@ -125,7 +125,7 @@ gfx::Rect AppWindowFrameView::GetBoundsForClientView()
@@ -132,7 +132,7 @@ gfx::Rect AppWindowFrameView::GetBoundsForClientView()
gfx::Rect AppWindowFrameView::GetWindowBoundsForClientBounds(
const gfx::Rect& client_bounds) const {
gfx::Rect window_bounds = client_bounds;

View File

@ -1,4 +1,4 @@
--- ash/display/mirror_window_controller.cc.orig 2020-05-13 18:39:35 UTC
--- ash/display/mirror_window_controller.cc.orig 2020-11-13 06:36:34 UTC
+++ ash/display/mirror_window_controller.cc
@@ -275,7 +275,11 @@ void MirrorWindowController::UpdateWindow(
return info.id() == iter->first;

View File

@ -1,6 +1,6 @@
--- base/BUILD.gn.orig 2020-09-08 19:13:57 UTC
--- base/BUILD.gn.orig 2020-11-13 06:36:34 UTC
+++ base/BUILD.gn
@@ -60,7 +60,7 @@ declare_args() {
@@ -53,7 +53,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,21 +9,20 @@
# Unsafe developer build. Has developer-friendly features that may weaken or
# disable security measures like sandboxing or ASLR.
@@ -887,7 +887,7 @@ jumbo_component("base") {
@@ -878,7 +878,7 @@ 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",
@@ -896,6 +896,12 @@ jumbo_component("base") {
"cpu_affinity_posix.cc",
"cpu_affinity_posix.h",
@@ -889,6 +889,11 @@ component("base") {
"profiler/thread_delegate_posix.h",
]
}
+
+ if (is_freebsd) {
+ if (is_bsd) {
+ sources += [
+ "profiler/stack_sampler_posix.cc",
+ ]
@ -31,29 +30,38 @@
}
if (is_win) {
@@ -1287,7 +1293,7 @@ jumbo_component("base") {
# Needed for <atomic> if using newer C++ library than sysroot, except if
@@ -1295,7 +1300,7 @@ component("base") {
# 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)) &&
+ if (!use_sysroot && (is_android || (is_linux && !is_chromecast) && !is_clang) &&
if (!use_sysroot &&
- (is_android || ((is_linux || is_chromeos) && !is_chromecast)) &&
+ (is_android || ((is_linux || is_chromeos) && !is_chromecast) && !is_clang) &&
host_toolchain != "//build/toolchain/cros:host") {
libs += [ "atomic" ]
}
@@ -1313,7 +1319,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_linux || is_android) && use_allocator == "partition") {
# Cannot use the same dispatching for host-side binaries.
@@ -1925,6 +1931,33 @@ jumbo_component("base") {
@@ -1342,7 +1347,7 @@ 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) {
@@ -1811,7 +1816,7 @@ 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",
@@ -1956,6 +1961,34 @@ component("base") {
}
}
+ if (is_freebsd) {
+ if (is_bsd) {
+ sources -= [
+ "files/file_path_watcher_linux.cc",
+ "files/file_util_linux.cc",
@ -79,29 +87,26 @@
+ "util" # process_metrics_freebsd
+ ]
+ }
+
+
# iOS
if (is_ios) {
sources -= [
@@ -3026,7 +3059,7 @@ test("base_unittests") {
@@ -3069,7 +3102,7 @@ test("base_unittests") {
]
}
- if (is_linux || is_chromeos) {
+ if ((is_linux || is_chromeos) && !is_bsd) {
sources += [ "debug/proc_maps_linux_unittest.cc" ]
}
@@ -3110,7 +3143,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" ]
}
}
@@ -3240,6 +3273,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",

View File

@ -1,4 +1,4 @@
--- base/allocator/allocator_shim_default_dispatch_to_glibc.cc.orig 2020-02-03 21:52:37 UTC
--- base/allocator/allocator_shim_default_dispatch_to_glibc.cc.orig 2020-11-13 06:36:34 UTC
+++ base/allocator/allocator_shim_default_dispatch_to_glibc.cc
@@ -6,18 +6,28 @@
#include "base/compiler_specific.h"

View File

@ -1,4 +1,4 @@
--- base/allocator/allocator_shim_override_libc_symbols.h.orig 2019-03-11 22:00:51 UTC
--- base/allocator/allocator_shim_override_libc_symbols.h.orig 2020-11-13 06:36:34 UTC
+++ base/allocator/allocator_shim_override_libc_symbols.h
@@ -10,7 +10,7 @@
#endif

View File

@ -1,45 +1,47 @@
--- base/allocator/allocator_shim_unittest.cc.orig 2020-07-07 21:57:30 UTC
--- base/allocator/allocator_shim_unittest.cc.orig 2020-11-13 06:36:34 UTC
+++ base/allocator/allocator_shim_unittest.cc
@@ -355,7 +355,7 @@ TEST_F(AllocatorShimTest, InterceptLibcSymbols) {
ASSERT_GE(aligned_allocs_intercepted_by_size[61], 1u);
@@ -367,7 +367,7 @@ TEST_F(AllocatorShimTest, InterceptLibcSymbols) {
#endif // !OS_WIN
-#if !defined(OS_WIN) && !defined(OS_MACOSX)
+#if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(OS_BSD)
-#if !defined(OS_WIN) && !defined(OS_APPLE)
+#if !defined(OS_WIN) && !defined(OS_APPLE) && !defined(OS_BSD)
void* memalign_ptr = memalign(128, 53);
ASSERT_NE(nullptr, memalign_ptr);
ASSERT_EQ(0u, reinterpret_cast<uintptr_t>(memalign_ptr) % 128);
@@ -368,7 +368,7 @@ TEST_F(AllocatorShimTest, InterceptLibcSymbols) {
ASSERT_GE(aligned_allocs_intercepted_by_alignment[kPageSize], 1u);
// pvalloc rounds the size up to the next page.
@@ -383,7 +383,7 @@ TEST_F(AllocatorShimTest, InterceptLibcSymbols) {
ASSERT_GE(aligned_allocs_intercepted_by_size[kPageSize], 1u);
-#endif // !OS_WIN && !OS_MACOSX
+#endif // !OS_WIN && !OS_MACOSX && !OS_BSD
#endif // !defined(OS_ANDROID)
char* realloc_ptr = static_cast<char*>(malloc(10));
strcpy(realloc_ptr, "foobar");
@@ -384,13 +384,13 @@ TEST_F(AllocatorShimTest, InterceptLibcSymbols) {
-#endif // !OS_WIN && !OS_APPLE
+#endif // !OS_WIN && !OS_APPLE && !OS_BSD
// See allocator_shim_override_glibc_weak_symbols.h for why we intercept
// internal libc symbols.
@@ -410,7 +410,7 @@ 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)
-#if !defined(OS_WIN) && !defined(OS_APPLE)
+#if !defined(OS_WIN) && !defined(OS_APPLE) && !defined(OS_BSD)
free(memalign_ptr);
ASSERT_GE(frees_intercepted_by_addr[Hash(memalign_ptr)], 1u);
free(pvalloc_ptr);
@@ -419,7 +419,7 @@ TEST_F(AllocatorShimTest, InterceptLibcSymbols) {
ASSERT_GE(frees_intercepted_by_addr[Hash(pvalloc_ptr)], 1u);
-#endif // !OS_WIN && !OS_MACOSX
+#endif // !OS_WIN && !OS_MACOSX && !OS_BSD
#endif // !defined(OS_ANDROID)
-#endif // !OS_WIN && !OS_APPLE
+#endif // !OS_WIN && !OS_APPLE && !OS_BSD
#if !defined(OS_WIN)
free(posix_memalign_ptr);
@@ -557,7 +557,7 @@ static size_t GetAllocatedSize(void* ptr) {
@@ -595,7 +595,7 @@ static size_t GetAllocatedSize(void* ptr) {
static size_t GetAllocatedSize(void* ptr) {
return malloc_size(ptr);
}
-#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)
static size_t GetAllocatedSize(void* ptr) {
return malloc_usable_size(ptr);
}

View File

@ -1,11 +1,11 @@
--- base/allocator/partition_allocator/page_allocator_internals_posix.h.orig 2020-09-08 19:13:57 UTC
--- base/allocator/partition_allocator/page_allocator_internals_posix.h.orig 2020-11-13 06:36:34 UTC
+++ base/allocator/partition_allocator/page_allocator_internals_posix.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>

View File

@ -0,0 +1,12 @@
--- base/allocator/partition_allocator/partition_alloc.cc.orig 2020-11-30 16:06:59 UTC
+++ base/allocator/partition_allocator/partition_alloc.cc
@@ -197,6 +197,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

View File

@ -1,16 +0,0 @@
--- base/allocator/partition_allocator/partition_alloc_constants.h.orig 2020-10-22 20:49:28 UTC
+++ base/allocator/partition_allocator/partition_alloc_constants.h
@@ -150,8 +150,13 @@ static_assert(alignof(std::max_align_t) <= 16,
//
// In practice, this means 8 bytes alignment on 32 bit architectures, and 16
// bytes on 64 bit ones.
+// On FreeBSD i386 alignof(std::max_align_t) is only 4.
+#if defined(__i386__) && defined(OS_FREEBSD)
+static const size_t kGenericMinBucketedOrder = 3;
+#else
static const size_t kGenericMinBucketedOrder =
alignof(std::max_align_t) == 16 ? 5 : 4; // 2^(order - 1), that is 16 or 8.
+#endif
// The largest bucketed order is 1 << (20 - 1), storing [512 KiB, 1 MiB):
static const size_t kGenericMaxBucketedOrder = 20;
static const size_t kGenericNumBucketedOrders =

View File

@ -1,17 +1,26 @@
--- base/allocator/partition_allocator/partition_alloc_unittest.cc.orig 2020-09-08 19:13:57 UTC
--- base/allocator/partition_allocator/partition_alloc_unittest.cc.orig 2020-11-13 06:36:34 UTC
+++ base/allocator/partition_allocator/partition_alloc_unittest.cc
@@ -313,9 +313,13 @@ void FreeFullPage(PartitionRoot<base::internal::Thread
@@ -333,9 +333,13 @@ void FreeFullPage(PartitionRoot<base::internal::Thread
}
}
-#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 CheckPageInCore(void* ptr, bool in_core) {
+#if defined(OS_BSD)
+ char ret = 0;
+#else
unsigned char ret = 0;
+#endif
EXPECT_EQ(0, mincore(ptr, kSystemPageSize, &ret));
EXPECT_EQ(0, mincore(ptr, SystemPageSize(), &ret));
return in_core == (ret & 1);
}
@@ -344,7 +348,7 @@ bool CheckPageInCore(void* ptr, bool in_core) {
EXPECT_TRUE(CheckPageInCore(ptr, in_core))
#else
#define CHECK_PAGE_IN_CORE(ptr, in_core) (void)(0)
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
class MockPartitionStatsDumper : public PartitionStatsDumper {
public:

View File

@ -1,20 +1,20 @@
--- base/base_switches.cc.orig 2020-09-08 19:13:57 UTC
--- base/base_switches.cc.orig 2020-11-13 06:36:34 UTC
+++ base/base_switches.cc
@@ -117,7 +117,7 @@ const char kDisableHighResTimer[] = "disable-highres-t
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
@@ -142,7 +142,7 @@ const char kReachedCodeSamplingIntervalUs[] =
"reached-code-sampling-interval-us";
@@ -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.
//

View File

@ -1,20 +1,20 @@
--- base/base_switches.h.orig 2020-09-08 19:13:57 UTC
--- base/base_switches.h.orig 2020-11-13 06:36:34 UTC
+++ base/base_switches.h
@@ -38,7 +38,7 @@ extern const char kDisableHighResTimer[];
@@ -39,7 +39,7 @@ extern const char kDisableHighResTimer[];
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
@@ -52,7 +52,7 @@ extern const char kReachedCodeSamplingIntervalUs[];
extern const char kOrderfileMemoryOptimization[];
@@ -55,7 +55,7 @@ extern const char kEnableIdleTracing[];
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

View File

@ -1,38 +1,44 @@
--- base/cpu.cc.orig 2020-07-07 21:57:30 UTC
--- base/cpu.cc.orig 2020-11-13 06:36:34 UTC
+++ base/cpu.cc
@@ -15,7 +15,7 @@
@@ -16,7 +16,7 @@
#include "base/stl_util.h"
-#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))
-#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
@@ -136,7 +136,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
@@ -166,7 +166,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
@@ -288,7 +288,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

View File

@ -0,0 +1,20 @@
--- base/cpu.h.orig 2020-11-16 17:24:49 UTC
+++ 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:

View File

@ -1,4 +1,4 @@
--- base/debug/debugger_posix.cc.orig 2020-07-07 21:58:11 UTC
--- base/debug/debugger_posix.cc.orig 2020-11-13 06:36:34 UTC
+++ base/debug/debugger_posix.cc
@@ -98,7 +98,7 @@ bool BeingDebugged() {
KERN_PROC,

View File

@ -1,6 +1,6 @@
--- base/debug/elf_reader.cc.orig 2020-07-07 21:57:30 UTC
--- base/debug/elf_reader.cc.orig 2020-11-13 06:36:34 UTC
+++ base/debug/elf_reader.cc
@@ -36,7 +36,9 @@ using Nhdr = Elf64_Nhdr;
@@ -38,7 +38,9 @@ using Nhdr = Elf64_Nhdr;
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.
@@ -99,6 +101,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);
@@ -108,6 +111,7 @@ size_t ReadElfBuildId(const void* elf_mapped_base,
@@ -84,6 +87,7 @@ size_t ReadElfBuildId(const void* elf_mapped_base,
break;
}
}

View File

@ -1,11 +1,11 @@
--- base/debug/proc_maps_linux.cc.orig 2020-07-07 21:57:30 UTC
--- base/debug/proc_maps_linux.cc.orig 2020-11-13 06:36:34 UTC
+++ base/debug/proc_maps_linux.cc
@@ -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

View File

@ -1,11 +1,11 @@
--- base/debug/stack_trace.cc.orig 2019-03-17 21:37:51 UTC
--- base/debug/stack_trace.cc.orig 2020-11-13 06:36:34 UTC
+++ 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"

View File

@ -1,4 +1,4 @@
--- base/debug/stack_trace.h.orig 2019-09-09 21:55:05 UTC
--- base/debug/stack_trace.h.orig 2020-11-13 06:36:34 UTC
+++ base/debug/stack_trace.h
@@ -19,6 +19,7 @@
#if !defined(OS_NACL)

View File

@ -1,11 +1,11 @@
--- base/debug/stack_trace_posix.cc.orig 2020-03-16 18:39:41 UTC
--- base/debug/stack_trace_posix.cc.orig 2020-11-13 06:36:34 UTC
+++ 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

View File

@ -1,14 +1,14 @@
--- base/debug/stack_trace_unittest.cc.orig 2020-03-23 14:01:09 UTC
--- base/debug/stack_trace_unittest.cc.orig 2020-11-13 06:36:34 UTC
+++ base/debug/stack_trace_unittest.cc
@@ -86,6 +86,7 @@ TEST_F(StackTraceTest, OutputToStream) {
@@ -88,6 +88,7 @@ TEST_F(StackTraceTest, OutputToStream) {
std::string::npos)
<< "Unable to resolve symbols.";
+#if !defined(OS_BSD)
// Expect a demangled symbol.
// Note that Windows Release builds omit the function parameters from the
// demangled stack output, otherwise this could be "testing::Test::Run()".
@@ -103,9 +104,10 @@ TEST_F(StackTraceTest, OutputToStream) {
// demangled stack output, otherwise this could be "testing::UnitTest::Run()".
@@ -106,9 +107,10 @@ TEST_F(StackTraceTest, OutputToStream) {
EXPECT_TRUE(backtrace_message.find(__func__) != std::string::npos)
<< "Expected to find " << __func__ << " in backtrace:\n"
<< backtrace_message;
@ -20,7 +20,7 @@
// Disabled in Official builds, where Link-Time Optimization can result in two
// or fewer stack frames being available, causing the test to fail.
TEST_F(StackTraceTest, TruncatedTrace) {
@@ -119,7 +121,7 @@ TEST_F(StackTraceTest, TruncatedTrace) {
@@ -122,7 +124,7 @@ TEST_F(StackTraceTest, TruncatedTrace) {
truncated.Addresses(&count);
EXPECT_EQ(2u, count);
}

View File

@ -1,11 +1,11 @@
--- base/files/file_path_unittest.cc.orig 2020-03-16 18:39:41 UTC
--- base/files/file_path_unittest.cc.orig 2020-11-13 06:36:34 UTC
+++ base/files/file_path_unittest.cc
@@ -1149,7 +1149,7 @@ TEST_F(FilePathTest, FromUTF8Unsafe_And_AsUTF8Unsafe)
"\xEF\xBC\xA1\xEF\xBC\xA2\xEF\xBC\xA3.txt" },
};
-#if !defined(SYSTEM_NATIVE_UTF8) && defined(OS_LINUX)
+#if !defined(SYSTEM_NATIVE_UTF8) && (defined(OS_LINUX) || defined(OS_BSD))
-#if !defined(SYSTEM_NATIVE_UTF8) && (defined(OS_LINUX) || defined(OS_CHROMEOS))
+#if !defined(SYSTEM_NATIVE_UTF8) && (defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD))
ScopedLocale locale("en_US.UTF-8");
#endif

View File

@ -1,15 +0,0 @@
--- base/files/file_path_watcher.cc.orig 2020-03-16 18:39:41 UTC
+++ 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
}

View File

@ -1,4 +1,4 @@
--- base/files/file_path_watcher_kqueue.h.orig 2019-03-11 22:00:51 UTC
--- base/files/file_path_watcher_kqueue.h.orig 2020-11-13 06:36:34 UTC
+++ base/files/file_path_watcher_kqueue.h
@@ -5,6 +5,10 @@
#ifndef BASE_FILES_FILE_PATH_WATCHER_KQUEUE_H_

View File

@ -1,4 +1,4 @@
--- base/files/file_path_watcher_stub.cc.orig 2020-03-16 18:39:41 UTC
--- base/files/file_path_watcher_stub.cc.orig 2020-11-13 06:36:34 UTC
+++ base/files/file_path_watcher_stub.cc
@@ -1,14 +1,15 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.

View File

@ -1,20 +1,44 @@
--- base/files/file_path_watcher_unittest.cc.orig 2020-09-08 19:13:57 UTC
--- base/files/file_path_watcher_unittest.cc.orig 2020-11-13 06:36:34 UTC
+++ base/files/file_path_watcher_unittest.cc
@@ -425,7 +425,7 @@ TEST_F(FilePathWatcherTest, WatchDirectory) {
@@ -425,12 +425,12 @@ TEST_F(FilePathWatcherTest, WatchDirectory) {
VLOG(1) << "Waiting for file1 creation";
ASSERT_TRUE(WaitForEvents());
-#if !defined(OS_MACOSX)
+#if !defined(OS_MACOSX) && !defined(OS_BSD)
-#if !defined(OS_APPLE)
+#if !defined(OS_APPLE) && !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";
ASSERT_TRUE(WaitForEvents());
-#endif // !OS_APPLE
+#endif // !OS_APPLE && !OS_BSD
ASSERT_TRUE(base::DeleteFile(file1));
VLOG(1) << "Waiting for file1 deletion";
@@ -632,7 +632,7 @@ TEST_F(FilePathWatcherTest, FileAttributesChanged) {
ASSERT_TRUE(WaitForEvents());
}
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
// Verify that creating a symlink is caught.
TEST_F(FilePathWatcherTest, CreateLink) {
@@ -790,7 +790,7 @@ TEST_F(FilePathWatcherTest, LinkedDirectoryPart3) {
ASSERT_TRUE(WaitForEvents());
}
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
enum Permission {
Read,
@@ -798,7 +798,7 @@ enum Permission {
Execute
};
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_BSD)
-#if defined(OS_APPLE)
+#if defined(OS_APPLE) || defined(OS_BSD)
bool ChangeFilePermissions(const FilePath& path, Permission perm, bool allow) {
struct stat stat_buf;
@ -22,11 +46,11 @@
}
return chmod(path.value().c_str(), stat_buf.st_mode) == 0;
}
-#endif // defined(OS_MACOSX)
+#endif // defined(OS_MACOSX) || defined(OS_BSD)
-#endif // defined(OS_APPLE)
+#endif // defined(OS_APPLE) || defined(OS_BSD)
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_BSD)
-#if defined(OS_APPLE)
+#if defined(OS_APPLE) || defined(OS_BSD)
// Linux implementation of FilePathWatcher doesn't catch attribute changes.
// http://crbug.com/78043
// Windows implementation of FilePathWatcher catches attribute changes that
@ -34,8 +58,8 @@
ASSERT_TRUE(ChangeFilePermissions(test_dir1, Execute, true));
}
-#endif // OS_MACOSX
+#endif // OS_MACOSX || OS_BSD
-#endif // OS_APPLE
+#endif // OS_APPLE || OS_BSD
} // namespace
} // namespace base

View File

@ -1,11 +1,28 @@
--- base/files/file_util.h.orig 2020-09-08 19:13:57 UTC
--- base/files/file_util.h.orig 2020-11-13 06:36:34 UTC
+++ base/files/file_util.h
@@ -582,7 +582,7 @@ BASE_EXPORT bool VerifyPathControlledByAdmin(const bas
@@ -278,14 +278,14 @@ BASE_EXPORT bool SetPosixFilePermissions(const FilePat
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 bool VerifyPathControlledByAdmin(const bas
// 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.

View File

@ -1,11 +1,60 @@
--- base/files/file_util_posix.cc.orig 2020-09-08 19:13:57 UTC
--- base/files/file_util_posix.cc.orig 2020-11-13 06:36:34 UTC
+++ base/files/file_util_posix.cc
@@ -415,7 +415,7 @@ bool CreatePipe(ScopedFD* read_fd, ScopedFD* write_fd,
@@ -412,7 +412,7 @@ bool CreatePipe(ScopedFD* read_fd, ScopedFD* write_fd,
}
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

View File

@ -1,20 +1,38 @@
--- base/files/file_util_unittest.cc.orig 2020-09-08 19:13:57 UTC
--- base/files/file_util_unittest.cc.orig 2020-11-13 06:36:34 UTC
+++ base/files/file_util_unittest.cc
@@ -3501,7 +3501,7 @@ TEST_F(FileUtilTest, ReadFileToStringWithNamedPipe) {
@@ -1639,7 +1639,7 @@ TEST_F(FileUtilTest, DeleteDirRecursiveWithOpenFile) {
#endif
}
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
// This test will validate that files which would block when read result in a
// failure on a call to ReadFileToStringNonBlocking. To accomplish this we will
// use a named pipe because it appears as a file on disk and we can control how
@@ -1672,7 +1672,7 @@ TEST_F(FileUtilTest, TestNonBlockingFileReadLinux) {
ASSERT_EQ(result.size(), 1u);
EXPECT_EQ(result[0], 'a');
}
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
TEST_F(FileUtilTest, MoveFileNew) {
// Create a file
@@ -3507,7 +3507,7 @@ TEST_F(FileUtilTest, ReadFileToStringWithNamedPipe) {
}
#endif // defined(OS_WIN)
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
+#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_BSD)
-#if defined(OS_POSIX) && !defined(OS_APPLE)
+#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_BSD)
TEST_F(FileUtilTest, ReadFileToStringWithProcFileSystem) {
FilePath file_path("/proc/cpuinfo");
std::string data = "temp";
@@ -3519,7 +3519,7 @@ TEST_F(FileUtilTest, ReadFileToStringWithProcFileSyste
@@ -3525,7 +3525,7 @@ TEST_F(FileUtilTest, ReadFileToStringWithProcFileSyste
EXPECT_FALSE(ReadFileToStringWithMaxSize(file_path, nullptr, 4));
}
-#endif // defined(OS_POSIX) && !defined(OS_MACOSX)
+#endif // defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_BSD)
-#endif // defined(OS_POSIX) && !defined(OS_APPLE)
+#endif // defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_BSD)
TEST_F(FileUtilTest, ReadFileToStringWithLargeFile) {
std::string data(kLargeFileSize, 'c');

View File

@ -1,11 +1,11 @@
--- base/files/scoped_file.cc.orig 2019-07-29 18:17:43 UTC
--- base/files/scoped_file.cc.orig 2020-11-13 06:36:34 UTC
+++ 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

View File

@ -1,20 +1,20 @@
--- base/i18n/icu_util.cc.orig 2020-05-13 18:39:35 UTC
--- base/i18n/icu_util.cc.orig 2020-11-13 06:36:34 UTC
+++ 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
@@ -341,7 +341,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().

View File

@ -1,4 +1,4 @@
--- base/linux_util.cc.orig 2020-09-08 19:13:57 UTC
--- base/linux_util.cc.orig 2020-11-13 06:36:34 UTC
+++ base/linux_util.cc
@@ -15,6 +15,7 @@

View File

@ -1,4 +1,4 @@
--- base/location_unittest.cc.orig 2020-05-26 09:56:30 UTC
--- base/location_unittest.cc.orig 2020-11-13 06:36:34 UTC
+++ base/location_unittest.cc
@@ -32,7 +32,7 @@ TEST(LocationTest, CurrentYieldsCorrectValue) {
EXPECT_EQ(here.line_number(), previous_line + 1);

View File

@ -1,11 +1,20 @@
--- base/logging_unittest.cc.orig 2020-07-07 21:58:11 UTC
--- base/logging_unittest.cc.orig 2020-11-13 06:36:34 UTC
+++ base/logging_unittest.cc
@@ -552,7 +552,7 @@ void CheckCrashTestSighandler(int, siginfo_t* info, vo
@@ -29,7 +29,7 @@
#include "base/posix/eintr_wrapper.h"
#endif // OS_POSIX
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD)
#include <ucontext.h>
#endif
@@ -559,7 +559,7 @@ 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)
-#if defined(OS_MAC)
+#if defined(OS_MAC) || defined(OS_BSD)
crash_addr = reinterpret_cast<uintptr_t>(info->si_addr);
#else // OS_POSIX && !OS_MACOSX
#else // OS_*
ucontext_t* context = reinterpret_cast<ucontext_t*>(context_ptr);

View File

@ -1,11 +1,11 @@
--- base/memory/discardable_memory.cc.orig 2020-02-07 10:23:12 UTC
--- base/memory/discardable_memory.cc.orig 2020-11-13 06:36:34 UTC
+++ 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())

View File

@ -1,11 +1,11 @@
--- base/memory/discardable_memory_internal.h.orig 2020-02-07 10:22:39 UTC
--- base/memory/discardable_memory_internal.h.orig 2020-11-13 06:36:34 UTC
+++ 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_

View File

@ -1,11 +1,11 @@
--- base/memory/madv_free_discardable_memory_posix.cc.orig 2020-09-08 19:13:57 UTC
--- base/memory/madv_free_discardable_memory_posix.cc.orig 2020-11-13 06:36:34 UTC
+++ base/memory/madv_free_discardable_memory_posix.cc
@@ -292,7 +292,7 @@ void MadvFreeDiscardableMemoryPosix::SetKeepMemoryForT
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_);

View File

@ -1,29 +1,29 @@
--- base/memory/platform_shared_memory_region.h.orig 2020-02-03 21:52:37 UTC
--- base/memory/platform_shared_memory_region.h.orig 2020-11-13 06:36:34 UTC
+++ base/memory/platform_shared_memory_region.h
@@ -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;
}
@@ -121,7 +121,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:
@@ -266,7 +266,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

View File

@ -1,11 +1,11 @@
--- base/memory/platform_shared_memory_region_posix.cc.orig 2020-07-07 21:57:30 UTC
--- base/memory/platform_shared_memory_region_posix.cc.orig 2020-11-13 06:36:34 UTC
+++ base/memory/platform_shared_memory_region_posix.cc
@@ -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 =
@ -13,8 +13,8 @@
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(
@ -22,8 +22,8 @@
// 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
@ -31,8 +31,8 @@
// 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 */,

View File

@ -1,4 +1,4 @@
--- base/memory/shared_memory_region_unittest.cc.orig 2020-03-23 16:31:23 UTC
--- base/memory/shared_memory_region_unittest.cc.orig 2020-11-13 06:36:34 UTC
+++ base/memory/shared_memory_region_unittest.cc
@@ -188,10 +188,13 @@ TYPED_TEST(SharedMemoryRegionTest, MapAtNotAlignedOffs
std::tie(region, rw_mapping) = CreateMappedRegion<TypeParam>(kDataSize);

View File

@ -0,0 +1,28 @@
--- base/message_loop/message_pump_glib.cc.orig 2020-11-20 15:15:51 UTC
+++ 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 @@ int GetTimeIntervalMilliseconds(TimeTicks next_task_ti
}
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:

View File

@ -1,4 +1,4 @@
--- base/native_library_posix.cc.orig 2019-03-11 22:00:51 UTC
--- base/native_library_posix.cc.orig 2020-11-13 06:36:34 UTC
+++ base/native_library_posix.cc
@@ -29,7 +29,7 @@ NativeLibrary LoadNativeLibraryWithOptions(const FileP
// http://crbug.com/17943, http://crbug.com/17557, http://crbug.com/36892,

View File

@ -1,6 +1,6 @@
--- base/native_library_unittest.cc.orig 2019-03-11 22:00:51 UTC
--- base/native_library_unittest.cc.orig 2020-11-13 06:36:34 UTC
+++ base/native_library_unittest.cc
@@ -120,7 +120,7 @@ TEST(NativeLibraryTest, LoadLibrary) {
@@ -118,7 +118,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

View File

@ -1,6 +1,6 @@
--- base/numerics/safe_math_shared_impl.h.orig 2019-09-09 21:55:05 UTC
--- base/numerics/safe_math_shared_impl.h.orig 2020-11-13 06:36:34 UTC
+++ 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__) && \

View File

@ -1,11 +1,11 @@
--- base/path_service_unittest.cc.orig 2020-07-07 21:57:30 UTC
--- base/path_service_unittest.cc.orig 2020-11-13 06:36:34 UTC
+++ base/path_service_unittest.cc
@@ -37,7 +37,7 @@ bool ReturnsValidPath(int dir_type) {
@@ -38,7 +38,7 @@ bool ReturnsValidPath(int dir_type) {
if (dir_type == DIR_CACHE)
check_path_exists = false;
#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)
// On the linux try-bots: a path is returned (e.g. /home/chrome-bot/Desktop),
// but it doesn't exist.
if (dir_type == DIR_USER_DESKTOP)

View File

@ -1,4 +1,4 @@
--- base/posix/can_lower_nice_to.cc.orig 2019-03-11 22:00:51 UTC
--- base/posix/can_lower_nice_to.cc.orig 2020-11-13 06:36:34 UTC
+++ base/posix/can_lower_nice_to.cc
@@ -31,6 +31,9 @@ bool CanLowerNiceTo(int nice_value) {
if (geteuid() == 0)

View File

@ -1,4 +1,4 @@
--- base/posix/unix_domain_socket.cc.orig 2020-09-08 19:13:57 UTC
--- base/posix/unix_domain_socket.cc.orig 2020-11-13 06:36:34 UTC
+++ base/posix/unix_domain_socket.cc
@@ -5,7 +5,10 @@
#include "base/posix/unix_domain_socket.h"
@ -7,7 +7,7 @@
+#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
@ -27,12 +27,12 @@
bool CreateSocketPair(ScopedFD* one, ScopedFD* two) {
int raw_socks[2];
@@ -151,7 +162,7 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd,
#if !defined(OS_NACL_NONSFI) && !defined(OS_MACOSX)
#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];
@@ -181,9 +192,9 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd,
@ -45,5 +45,5 @@
- pid = reinterpret_cast<struct ucred*>(CMSG_DATA(cmsg))->pid;
+ pid = getpid();
}
#endif // !defined(OS_NACL_NONSFI) && !defined(OS_MACOSX)
#endif // !defined(OS_NACL_NONSFI) && !defined(OS_APPLE)
}

View File

@ -1,4 +1,4 @@
--- base/posix/unix_domain_socket_unittest.cc.orig 2019-03-11 22:00:51 UTC
--- base/posix/unix_domain_socket_unittest.cc.orig 2020-11-13 06:36:34 UTC
+++ base/posix/unix_domain_socket_unittest.cc
@@ -8,6 +8,9 @@
#include <stdint.h>

View File

@ -1,4 +1,4 @@
--- base/process/internal_linux.cc.orig 2020-09-08 19:13:57 UTC
--- base/process/internal_linux.cc.orig 2020-11-13 06:36:34 UTC
+++ base/process/internal_linux.cc
@@ -30,7 +30,11 @@ namespace internal {

View File

@ -1,15 +1,15 @@
--- base/process/internal_linux.h.orig 2020-09-08 19:13:57 UTC
--- base/process/internal_linux.h.orig 2020-11-13 06:36:34 UTC
+++ 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;
@@ -55,6 +57,14 @@ bool ParseProcStats(const std::string& stats_data,
@@ -59,6 +61,14 @@ bool ParseProcStats(const std::string& stats_data,
// 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.
@@ -67,6 +77,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.

View File

@ -1,16 +1,16 @@
--- base/process/kill.h.orig 2019-12-16 21:50:40 UTC
--- base/process/kill.h.orig 2020-11-13 06:36:34 UTC
+++ base/process/kill.h
@@ -118,11 +118,11 @@ BASE_EXPORT TerminationStatus GetTerminationStatus(Pro
@@ -113,11 +113,11 @@ BASE_EXPORT TerminationStatus GetTerminationStatus(Pro
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)
+#endif // defined(OS_LINUX) || defined(OS_BSD)
-#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

View File

@ -1,20 +1,20 @@
--- base/process/kill_posix.cc.orig 2019-06-04 18:55:15 UTC
--- base/process/kill_posix.cc.orig 2020-11-13 06:36:34 UTC
+++ base/process/kill_posix.cc
@@ -168,7 +168,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());
@@ -179,7 +179,7 @@ void EnsureProcessGetsReaped(Process process) {
@@ -171,7 +171,7 @@ void EnsureProcessGetsReaped(Process process) {
PlatformThread::CreateNonJoinable(
0, new BackgroundReaper(std::move(process), TimeDelta()));
}
-#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)
#endif // !defined(OS_MACOSX)
#endif // !defined(OS_APPLE)
#endif // !defined(OS_NACL_NONSFI)

View File

@ -1,11 +1,11 @@
--- base/process/launch.cc.orig 2019-03-11 22:00:51 UTC
--- base/process/launch.cc.orig 2020-11-13 06:36:34 UTC
+++ base/process/launch.cc
@@ -15,7 +15,7 @@ LaunchOptions::~LaunchOptions() = default;
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.

View File

@ -1,11 +1,11 @@
--- base/process/launch.h.orig 2020-02-03 21:52:37 UTC
--- base/process/launch.h.orig 2020-11-13 06:36:34 UTC
+++ base/process/launch.h
@@ -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
@ -13,8 +13,17 @@
// 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_MACOSX) && !defined(OS_IOS)
#if defined(OS_MAC)
// Mach ports that will be accessible to the child process. These are not
@@ -408,7 +408,7 @@ BASE_EXPORT void RaiseProcessToHighPriority();
// 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).

View File

@ -1,4 +1,4 @@
--- base/process/launch_posix.cc.orig 2020-09-08 19:13:57 UTC
--- base/process/launch_posix.cc.orig 2020-11-13 06:36:34 UTC
+++ base/process/launch_posix.cc
@@ -65,6 +65,7 @@
#error "macOS should use launch_mac.cc"
@ -8,7 +8,7 @@
extern char** environ;
namespace base {
@@ -228,6 +229,28 @@
@@ -228,6 +229,28 @@ void CloseSuperfluousFds(const base::InjectiveMultimap
DirReaderPosix fd_dir(kFDDir);
if (!fd_dir.IsValid()) {
// Fallback case: Try every possible fd.

View File

@ -1,6 +1,6 @@
--- base/process/memory.cc.orig 2020-07-07 21:57:30 UTC
--- base/process/memory.cc.orig 2020-11-13 06:36:34 UTC
+++ base/process/memory.cc
@@ -44,7 +44,7 @@ NOINLINE void OnNoMemoryInternal(size_t size) {
@@ -55,7 +55,7 @@ NOINLINE void OnNoMemoryInternal(size_t size) {
} // namespace internal
// Defined in memory_win.cc for Windows.
@ -9,12 +9,12 @@
namespace {
@@ -63,7 +63,7 @@ void TerminateBecauseOutOfMemory(size_t size) {
@@ -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;

View File

@ -1,11 +1,11 @@
--- base/process/memory.h.orig 2019-10-21 19:06:18 UTC
--- base/process/memory.h.orig 2020-11-13 06:36:34 UTC
+++ base/process/memory.h
@@ -24,7 +24,7 @@ BASE_EXPORT void EnableTerminationOnOutOfMemory();
// 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.

View File

@ -1,18 +1,66 @@
--- base/process/memory_unittest.cc.orig 2020-03-16 18:39:41 UTC
--- base/process/memory_unittest.cc.orig 2020-11-13 06:36:34 UTC
+++ base/process/memory_unittest.cc
@@ -106,7 +106,7 @@ TEST(MemoryTest, AllocatorShimWorking) {
// OpenBSD does not support these tests. Don't test these on ASan/TSan/MSan
@@ -38,6 +38,8 @@
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
#include <malloc.h>
#include "base/test/malloc_wrapper.h"
+#elif defined(OS_BSD)
+#include "base/test/malloc_wrapper.h"
#endif
#if defined(OS_WIN)
@@ -105,9 +107,9 @@ TEST(MemoryTest, AllocatorShimWorking) {
#endif
}
-// OpenBSD does not support these tests. Don't test these on ASan/TSan/MSan
+// BSD 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 {
@@ -589,5 +589,5 @@ TEST_F(OutOfMemoryHandledTest, UncheckedCalloc) {
EXPECT_FALSE(base::UncheckedCalloc(1, test_size_, &value_));
EXPECT_TRUE(value_ == nullptr);
@@ -299,7 +301,7 @@ TEST_F(OutOfMemoryDeathTest, SecurityAlignedRealloc) {
#endif // defined(OS_WIN)
#endif // !defined(OS_MAC) && !defined(OS_ANDROID)
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
TEST_F(OutOfMemoryDeathTest, Valloc) {
ASSERT_OOM_DEATH({
@@ -345,7 +347,7 @@ TEST_F(OutOfMemoryDeathTest, ViaSharedLibraries) {
value_ = MallocWrapper(test_size_);
});
}
-#endif // !defined(OS_OPENBSD) && BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) &&
+#endif // !defined(OS_BSD) && BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) &&
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
// Android doesn't implement posix_memalign().
#if defined(OS_POSIX) && !defined(OS_ANDROID)
@@ -496,7 +498,7 @@ TEST_F(OutOfMemoryTest, TerminateBecauseOutOfMemoryRep
#endif // OS_WIN
#if defined(ARCH_CPU_32_BITS) && \
- (defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS))
+ (defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD))
void TestAllocationsReleaseReservation(void* (*alloc_fn)(size_t),
void (*free_fn)(void*)) {
@@ -554,7 +556,7 @@ TEST_F(OutOfMemoryHandledTest, NewReleasesReservation)
[](size_t size) { return static_cast<void*>(new char[size]); },
[](void* ptr) { delete[] static_cast<char*>(ptr); });
}
-#endif // defined(ARCH_CPU_32_BITS) && (defined(OS_WIN) || defined(OS_LINUX) ||
+#endif // defined(ARCH_CPU_32_BITS) && (defined(OS_WIN) || defined(OS_LINUX) || defined(OS_BSD) ||
// defined(OS_CHROMEOS))
// See the comment in |UncheckedMalloc()|, it behaves as malloc() in these
@@ -616,5 +618,5 @@ TEST_F(OutOfMemoryHandledTest, UncheckedCalloc) {
#endif // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) || defined(OS_ANDROID)
-#endif // !defined(OS_OPENBSD) && BUILDFLAG(USE_ALLOCATOR_SHIM) &&
+#endif // !defined(OS_BSD) && BUILDFLAG(USE_ALLOCATOR_SHIM) &&
// !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)

View File

@ -1,11 +1,11 @@
--- base/process/process_handle.cc.orig 2020-09-08 19:13:57 UTC
--- base/process/process_handle.cc.orig 2020-11-13 06:36:34 UTC
+++ base/process/process_handle.cc
@@ -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) {
DCHECK(pid_outside_of_namespace != kNullProcessId);

View File

@ -1,11 +1,11 @@
--- base/process/process_handle.h.orig 2019-10-21 19:06:18 UTC
--- base/process/process_handle.h.orig 2020-11-13 06:36:34 UTC
+++ base/process/process_handle.h
@@ -103,7 +103,7 @@ BASE_EXPORT ProcessId GetCurrentProcId();
// 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.

View File

@ -1,4 +1,4 @@
--- base/process/process_handle_freebsd.cc.orig 2019-03-11 22:00:51 UTC
--- base/process/process_handle_freebsd.cc.orig 2020-11-13 06:36:34 UTC
+++ base/process/process_handle_freebsd.cc
@@ -16,10 +16,13 @@ namespace base {

View File

@ -1,4 +1,4 @@
--- base/process/process_iterator_freebsd.cc.orig 2019-03-11 22:00:51 UTC
--- base/process/process_iterator_freebsd.cc.orig 2020-11-13 06:36:34 UTC
+++ base/process/process_iterator_freebsd.cc
@@ -10,6 +10,10 @@
#include <sys/sysctl.h>

View File

@ -1,16 +1,33 @@
--- base/process/process_linux.cc.orig 2020-07-07 21:57:30 UTC
--- base/process/process_linux.cc.orig 2020-11-13 06:36:34 UTC
+++ base/process/process_linux.cc
@@ -80,6 +80,9 @@ Time Process::CreationTime() const {
internal::VM_STARTTIME)
: internal::ReadProcStatsAndGetFieldAsInt64(
Pid(), internal::VM_STARTTIME);
@@ -24,7 +24,9 @@ namespace base {
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);
@@ -87,8 +90,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)
@@ -140,6 +145,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) {

View File

@ -1,38 +1,38 @@
--- base/process/process_metrics.cc.orig 2020-07-07 21:57:30 UTC
--- base/process/process_metrics.cc.orig 2020-11-13 06:36:34 UTC
+++ base/process/process_metrics.cc
@@ -58,7 +58,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_);
@@ -76,7 +76,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());
@@ -127,7 +127,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,
@@ -139,7 +139,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)

View File

@ -1,131 +1,163 @@
--- base/process/process_metrics.h.orig 2020-09-08 19:13:57 UTC
--- base/process/process_metrics.h.orig 2020-11-13 06:36:34 UTC
+++ base/process/process_metrics.h
@@ -44,7 +44,7 @@ namespace base {
@@ -47,7 +47,7 @@ namespace base {
// 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.
//
@@ -54,7 +54,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);
@@ -95,7 +95,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;
@@ -186,14 +186,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();
@@ -205,7 +205,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)
@@ -234,7 +234,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_;
@@ -285,7 +285,7 @@ BASE_EXPORT size_t GetHandleLimit();
@@ -323,7 +323,7 @@ BASE_EXPORT size_t GetHandleLimit();
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.
@@ -319,7 +319,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
@@ -333,7 +333,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;
@@ -343,7 +343,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)
@@ -369,10 +369,10 @@ struct BASE_EXPORT SystemMemoryInfoKB {
#if defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS)
@@ -406,11 +406,11 @@ struct BASE_EXPORT SystemMemoryInfoKB {
// 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.
@@ -445,7 +445,7 @@ BASE_EXPORT bool GetSystemDiskInfo(SystemDiskInfo* dis
@@ -485,7 +485,7 @@ BASE_EXPORT bool GetSystemDiskInfo(SystemDiskInfo* dis
// 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.
@@ -540,7 +540,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_;

View File

@ -1,4 +1,4 @@
--- base/process/process_metrics_freebsd.cc.orig 2020-09-08 19:13:57 UTC
--- base/process/process_metrics_freebsd.cc.orig 2020-11-13 06:36:34 UTC
+++ base/process/process_metrics_freebsd.cc
@@ -3,8 +3,10 @@
// found in the LICENSE file.
@ -43,7 +43,7 @@
// static
std::unique_ptr<ProcessMetrics> ProcessMetrics::CreateProcessMetrics(
@@ -74,4 +94,216 @@ size_t GetSystemCommitCharge() {
@@ -69,4 +89,216 @@ size_t GetSystemCommitCharge() {
return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize);
}

View File

@ -1,8 +1,8 @@
--- base/process/process_metrics_posix.cc.orig 2020-07-07 21:57:30 UTC
--- base/process/process_metrics_posix.cc.orig 2020-11-13 06:36:34 UTC
+++ base/process/process_metrics_posix.cc
@@ -20,6 +20,8 @@
#if defined(OS_MACOSX)
#if defined(OS_APPLE)
#include <malloc/malloc.h>
+#elif defined(OS_FREEBSD)
+#include <stdlib.h>

View File

@ -1,11 +1,11 @@
--- base/process/process_unittest.cc.orig 2019-03-18 19:16:37 UTC
--- base/process/process_unittest.cc.orig 2020-11-13 06:36:34 UTC
+++ base/process/process_unittest.cc
@@ -148,7 +148,7 @@ TEST_F(ProcessTest, CreationTimeOtherProcess) {
@@ -153,7 +153,7 @@ TEST_F(ProcessTest, CreationTimeOtherProcess) {
// was spawned and a time recorded after it was spawned. However, since the
// base::Time and process creation clocks don't match, tolerate some error.
constexpr base::TimeDelta kTolerance =
-#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)
// On Linux, process creation time is relative to boot time which has a
// 1-second resolution. Tolerate 1 second for the imprecise boot time and
// 100 ms for the imprecise clock.

View File

@ -1,16 +1,16 @@
--- base/process/process_util_unittest.cc.orig 2020-03-23 15:26:12 UTC
--- base/process/process_util_unittest.cc.orig 2020-11-13 06:36:34 UTC
+++ base/process/process_util_unittest.cc
@@ -1307,11 +1307,11 @@ std::string TestLaunchProcess(const CommandLine& cmdli
options.fds_to_remap.emplace_back(fds[1], STDOUT_FILENO);
#endif // defined(OS_WIN)
-#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)
options.clone_flags = clone_flags;
#else
CHECK_EQ(0, clone_flags);
-#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)
EXPECT_TRUE(LaunchProcess(cmdline, options).IsValid());
write_pipe.Close();

View File

@ -1,15 +1,15 @@
--- base/profiler/register_context.h.orig 2020-03-16 18:39:41 UTC
--- base/profiler/register_context.h.orig 2020-11-13 06:36:34 UTC
+++ 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
@@ -165,6 +165,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)

View File

@ -1,11 +1,11 @@
--- base/profiler/sampling_profiler_thread_token.cc.orig 2020-02-07 10:24:19 UTC
--- base/profiler/sampling_profiler_thread_token.cc.orig 2020-11-13 06:36:34 UTC
+++ base/profiler/sampling_profiler_thread_token.cc
@@ -7,7 +7,7 @@
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()};

View File

@ -1,11 +1,11 @@
--- base/profiler/sampling_profiler_thread_token.h.orig 2020-02-07 10:24:33 UTC
--- base/profiler/sampling_profiler_thread_token.h.orig 2020-11-13 06:36:34 UTC
+++ 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
@ -13,8 +13,8 @@
// 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
};

View File

@ -1,4 +1,4 @@
--- base/profiler/stack_copier_signal.cc.orig 2020-09-08 19:13:57 UTC
--- base/profiler/stack_copier_signal.cc.orig 2020-11-13 06:36:34 UTC
+++ base/profiler/stack_copier_signal.cc
@@ -4,7 +4,14 @@

View File

@ -1,6 +1,6 @@
--- base/profiler/stack_sampling_profiler_test_util.cc.orig 2020-09-08 19:13:57 UTC
--- base/profiler/stack_sampling_profiler_test_util.cc.orig 2020-11-13 06:36:34 UTC
+++ base/profiler/stack_sampling_profiler_test_util.cc
@@ -30,7 +30,7 @@
@@ -32,7 +32,7 @@
// Fortunately, it provides _alloca, which functions identically.
#include <malloc.h>
#define alloca _alloca

View File

@ -1,6 +1,6 @@
--- base/profiler/stack_sampling_profiler_unittest.cc.orig 2020-07-07 21:58:11 UTC
--- base/profiler/stack_sampling_profiler_unittest.cc.orig 2020-11-13 06:36:34 UTC
+++ base/profiler/stack_sampling_profiler_unittest.cc
@@ -41,7 +41,7 @@
@@ -42,7 +42,7 @@
#include <intrin.h>
#include <malloc.h>
#include <windows.h>

View File

@ -1,16 +1,16 @@
--- base/profiler/thread_delegate_posix.cc.orig 2020-05-13 18:39:35 UTC
--- base/profiler/thread_delegate_posix.cc.orig 2020-11-13 06:36:34 UTC
+++ 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 @@ base::Optional<uintptr_t> GetAndroidMainThreadStackBas
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]),

View File

@ -1,6 +1,6 @@
--- base/sampling_heap_profiler/sampling_heap_profiler.cc.orig 2019-09-09 21:55:05 UTC
--- base/sampling_heap_profiler/sampling_heap_profiler.cc.orig 2020-11-13 06:36:34 UTC
+++ 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)

View File

@ -1,11 +1,28 @@
--- base/security_unittest.cc.orig 2020-07-07 21:57:30 UTC
--- base/security_unittest.cc.orig 2020-11-13 06:36:34 UTC
+++ base/security_unittest.cc
@@ -59,7 +59,7 @@ NOINLINE Type HideValueFromCompiler(volatile Type valu
// FAILS_ is too clunky.
@@ -61,7 +61,7 @@ NOINLINE Type HideValueFromCompiler(volatile Type valu
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)
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \
- defined(OS_APPLE)
+ defined(OS_APPLE) || defined(OS_BSD)
// 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",
@@ -123,7 +123,7 @@ TEST(SecurityTest, MAYBE_NewOverflow) {
#endif // !defined(OS_WIN) || !defined(ARCH_CPU_64_BITS)
}
-#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(__x86_64__)
+#if (defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)) && defined(__x86_64__)
// Check if ptr1 and ptr2 are separated by less than size chars.
bool ArePointersToSameArea(void* ptr1, void* ptr2, size_t size) {
ptrdiff_t ptr_diff = reinterpret_cast<char*>(std::max(ptr1, ptr2)) -
@@ -177,6 +177,6 @@ TEST(SecurityTest, MALLOC_OVERFLOW_TEST(RandomMemoryAl
EXPECT_FALSE(impossible_random_address);
}
-#endif // (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(__x86_64__)
+#endif // (defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)) && defined(__x86_64__)
} // namespace

View File

@ -0,0 +1,19 @@
--- base/strings/sys_string_conversions_unittest.cc.orig 2020-11-16 14:00:26 UTC
+++ base/strings/sys_string_conversions_unittest.cc
@@ -76,7 +76,7 @@ TEST(SysStrings, SysUTF8ToWide) {
}
// Tests depend on setting a specific Linux locale.
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
TEST(SysStrings, SysWideToNativeMB) {
#if !defined(SYSTEM_NATIVE_UTF8)
ScopedLocale locale("en_US.UTF-8");
@@ -191,6 +191,6 @@ TEST(SysStrings, SysNativeMBAndWide) {
EXPECT_EQ(wide, trip);
}
}
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
} // namespace base

View File

@ -1,12 +1,15 @@
--- base/synchronization/lock_impl.h.orig 2020-07-07 21:58:11 UTC
--- base/synchronization/lock_impl.h.orig 2020-11-13 06:36:34 UTC
+++ base/synchronization/lock_impl.h
@@ -69,10 +69,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);
}

View File

@ -1,20 +1,20 @@
--- base/syslog_logging.cc.orig 2019-10-21 19:06:18 UTC
--- base/syslog_logging.cc.orig 2020-11-13 06:36:34 UTC
+++ base/syslog_logging.cc
@@ -14,7 +14,7 @@
#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>
@@ -113,7 +113,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

View File

@ -1,11 +1,11 @@
--- base/system/sys_info.cc.orig 2020-06-25 12:19:57 UTC
--- base/system/sys_info.cc.orig 2020-11-13 06:36:34 UTC
+++ 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));

View File

@ -1,6 +1,6 @@
--- base/system/sys_info.h.orig 2020-09-08 19:13:57 UTC
--- base/system/sys_info.h.orig 2020-11-13 06:36:34 UTC
+++ base/system/sys_info.h
@@ -201,6 +201,8 @@ class BASE_EXPORT SysInfo {
@@ -202,6 +202,8 @@ class BASE_EXPORT SysInfo {
// On Desktop this returns true when memory <= 512MB.
static bool IsLowEndDevice();
@ -9,12 +9,12 @@
private:
FRIEND_TEST_ALL_PREFIXES(SysInfoTest, AmountOfAvailablePhysicalMemory);
FRIEND_TEST_ALL_PREFIXES(debug::SystemMetricsTest, ParseMeminfo);
@@ -210,7 +212,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

View File

@ -1,9 +1,10 @@
--- base/system/sys_info_freebsd.cc.orig 2020-07-07 21:57:30 UTC
--- base/system/sys_info_freebsd.cc.orig 2020-11-13 06:36:34 UTC
+++ base/system/sys_info_freebsd.cc
@@ -9,30 +9,86 @@
@@ -9,30 +9,95 @@
#include <sys/sysctl.h>
#include "base/notreached.h"
+#include "base/process/process_metrics.h"
+#include "base/strings/string_util.h"
namespace base {
@ -53,6 +54,14 @@
+}
+
// 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];

View File

@ -1,6 +1,6 @@
--- base/system/sys_info_posix.cc.orig 2019-09-09 21:55:05 UTC
--- base/system/sys_info_posix.cc.orig 2020-11-13 06:36:34 UTC
+++ 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";

View File

@ -0,0 +1,46 @@
--- base/system/sys_info_unittest.cc.orig 2020-11-16 14:01:04 UTC
+++ base/system/sys_info_unittest.cc
@@ -50,13 +50,13 @@ TEST_F(SysInfoTest, AmountOfMem) {
EXPECT_GE(SysInfo::AmountOfVirtualMemory(), 0);
}
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD)
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
#define MAYBE_AmountOfAvailablePhysicalMemory \
DISABLED_AmountOfAvailablePhysicalMemory
#else
#define MAYBE_AmountOfAvailablePhysicalMemory AmountOfAvailablePhysicalMemory
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
TEST_F(SysInfoTest, MAYBE_AmountOfAvailablePhysicalMemory) {
// Note: info is in _K_bytes.
SystemMemoryInfoKB info;
@@ -87,7 +87,7 @@ TEST_F(SysInfoTest, MAYBE_AmountOfAvailablePhysicalMem
EXPECT_GT(amount, static_cast<int64_t>(info.free) * 1024);
EXPECT_LT(amount / 1024, info.total);
}
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSDD)
#if defined(OS_FUCHSIA)
// TODO(crbug.com/851734): Implementation depends on statvfs, which is not
@@ -117,7 +117,7 @@ TEST_F(SysInfoTest, MAYBE_AmountOfTotalDiskSpace) {
EXPECT_GT(SysInfo::AmountOfTotalDiskSpace(tmp_path), 0) << tmp_path.value();
}
-#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_FUCHSIA)
TEST_F(SysInfoTest, OperatingSystemVersionNumbers) {
int32_t os_major_version = -1;
@@ -178,7 +178,7 @@ TEST_F(SysInfoTest, GetHardwareInfo) {
EXPECT_TRUE(IsStringUTF8(hardware_info->model));
bool empty_result_expected =
#if defined(OS_ANDROID) || defined(OS_APPLE) || defined(OS_WIN) || \
- defined(OS_LINUX) || defined(OS_CHROMEOS)
+ defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
false;
#else
true;

View File

@ -1,8 +1,8 @@
--- base/task/thread_pool/environment_config_unittest.cc.orig 2019-07-29 13:26:54 UTC
--- base/task/thread_pool/environment_config_unittest.cc.orig 2020-11-13 06:36:34 UTC
+++ base/task/thread_pool/environment_config_unittest.cc
@@ -14,7 +14,7 @@ namespace internal {
TEST(ThreadPoolEnvironmentConfig, CanUseBackgroundPriorityForWorker) {
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_IOS)
#if defined(OS_WIN) || defined(OS_APPLE)
EXPECT_TRUE(CanUseBackgroundPriorityForWorkerThread());
-#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FUCHSIA) || \
+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FUCHSIA) || defined(OS_BSD) || \

View File

@ -1,6 +1,6 @@
--- base/test/BUILD.gn.orig 2020-09-08 19:13:57 UTC
--- base/test/BUILD.gn.orig 2020-11-13 06:36:34 UTC
+++ base/test/BUILD.gn
@@ -418,7 +418,11 @@ if (is_linux) {
@@ -415,7 +415,11 @@ if (is_linux || is_chromeos) {
copy("fonts_conf") {
sources = [ "fonts.conf" ]

View File

@ -1,6 +1,6 @@
--- base/test/launcher/test_launcher.cc.orig 2020-09-08 19:13:57 UTC
--- base/test/launcher/test_launcher.cc.orig 2020-11-13 06:36:34 UTC
+++ base/test/launcher/test_launcher.cc
@@ -56,6 +56,7 @@
@@ -58,6 +58,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#if defined(OS_POSIX)
@ -8,12 +8,21 @@
#include <fcntl.h>
#include "base/files/file_descriptor_watcher_posix.h"
@@ -582,7 +583,7 @@ ChildProcessResults DoLaunchChildTestProcess(
@@ -588,7 +589,7 @@ ChildProcessResults DoLaunchChildTestProcess(
#if !defined(OS_FUCHSIA)
options.new_process_group = true;
#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)
options.kill_on_parent_death = true;
#endif
@@ -1529,7 +1530,7 @@ bool TestLauncher::Init(CommandLine* command_line) {
results_tracker_.AddGlobalTag("OS_IOS");
#endif
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
results_tracker_.AddGlobalTag("OS_LINUX");
#endif

View File

@ -1,11 +1,11 @@
--- base/test/test_file_util_posix.cc.orig 2020-07-07 21:57:30 UTC
--- base/test/test_file_util_posix.cc.orig 2020-11-13 06:36:34 UTC
+++ base/test/test_file_util_posix.cc
@@ -85,7 +85,7 @@ void SyncPageCacheToDisk() {
@@ -87,7 +87,7 @@ void SyncPageCacheToDisk() {
sync();
}
-#if !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
+#if !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) && !defined(OS_BSD)
-#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.
NOTIMPLEMENTED();

View File

@ -1,37 +1,37 @@
--- base/test/test_suite.cc.orig 2020-09-08 19:13:57 UTC
--- base/test/test_suite.cc.orig 2020-11-13 06:36:34 UTC
+++ base/test/test_suite.cc
@@ -70,7 +70,7 @@
#include "base/test/test_support_ios.h"
@@ -66,7 +66,7 @@
#include "base/test/test_support_android.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/test/fontconfig_util_linux.h"
#endif
@@ -386,14 +386,14 @@ void TestSuite::PreInitialize() {
@@ -382,14 +382,14 @@ void TestSuite::PreInitialize() {
testing::GTEST_FLAG(catch_exceptions) = false;
#endif
EnableTerminationOnHeapCorruption();
-#if defined(OS_LINUX) && defined(USE_AURA)
+#if (defined(OS_LINUX) || defined(OS_BSD)) && defined(USE_AURA)
-#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(USE_AURA)
+#endif // (defined(OS_LINUX) || defined(OS_BSD)) && defined(USE_AURA)
-#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.
@@ -634,7 +634,7 @@ void TestSuite::Initialize() {
@@ -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)
+#if defined(OS_LINUX) || defined(OS_BSD)
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
SetUpFontconfig();
#endif

View File

@ -1,11 +1,11 @@
--- base/third_party/libevent/BUILD.gn.orig 2019-03-11 22:00:51 UTC
--- base/third_party/libevent/BUILD.gn.orig 2020-11-13 06:36:34 UTC
+++ base/third_party/libevent/BUILD.gn
@@ -43,13 +43,20 @@ static_library("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",

View File

@ -1,11 +1,11 @@
--- base/threading/platform_thread.h.orig 2019-10-21 19:06:18 UTC
--- base/threading/platform_thread.h.orig 2020-11-13 06:36:34 UTC
+++ base/threading/platform_thread.h
@@ -221,7 +221,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

Some files were not shown because too many files have changed in this diff Show More