Skip to content

Commit

Permalink
Added missing patches for v91 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
mwolf-rw committed Jun 14, 2021
1 parent e24f556 commit 27b0fe4
Show file tree
Hide file tree
Showing 32 changed files with 406 additions and 52 deletions.
4 changes: 2 additions & 2 deletions www/chromium/files/patch-base_posix_unix__domain__socket.cc
@@ -1,4 +1,4 @@
--- base/posix/unix_domain_socket.cc.orig 2021-04-14 18:40:48 UTC
--- base/posix/unix_domain_socket.cc.orig 2021-06-09 22:13:52 UTC
+++ base/posix/unix_domain_socket.cc
@@ -5,7 +5,10 @@
#include "base/posix/unix_domain_socket.h"
Expand All @@ -7,7 +7,7 @@
+#include <sys/param.h>
#include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/ucred.h>a
+#include <sys/ucred.h>
#if !defined(OS_NACL_NONSFI)
#include <sys/un.h>
#endif
Expand Down
9 changes: 0 additions & 9 deletions www/chromium/files/patch-chrome_browser_about__flags.cc
Expand Up @@ -36,15 +36,6 @@
{
"disable-accelerated-video-encode",
flag_descriptions::kAcceleratedVideoEncodeName,
@@ -3386,7 +3386,7 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(performance_manager::features::kDynamicTcmallocTuning)},
#endif // BUILDFLAG(USE_TCMALLOC)
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
-#if (defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_ANDROID)) && \
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)) && \
!defined(OS_NACL)
{"mojo-linux-sharedmem", flag_descriptions::kMojoLinuxChannelSharedMemName,
flag_descriptions::kMojoLinuxChannelSharedMemDescription,
@@ -3439,7 +3439,7 @@ const FeatureEntry kFeatureEntries[] = {
{"enable-login-detection", flag_descriptions::kEnableLoginDetectionName,
flag_descriptions::kEnableLoginDetectionDescription, kOsAll,
Expand Down
12 changes: 12 additions & 0 deletions www/chromium/files/patch-chrome_browser_platform__util__linux.cc
@@ -0,0 +1,12 @@
--- chrome/browser/platform_util_linux.cc.orig 2021-06-11 09:25:25 UTC
+++ chrome/browser/platform_util_linux.cc
@@ -126,7 +126,9 @@ void RunCommand(const std::string& command,

base::LaunchOptions options;
options.current_directory = working_directory;
+#if !defined(OS_BSD)
options.allow_new_privs = true;
+#endif
// xdg-open can fall back on mailcap which eventually might plumb through
// to a command that needs a terminal. Set the environment variable telling
// it that we definitely don't have a terminal available and that it should
@@ -0,0 +1,11 @@
--- chrome/browser/resources/media_router/extension/src/utils/platform_utils.js.orig 2021-06-11 09:26:56 UTC
+++ chrome/browser/resources/media_router/extension/src/utils/platform_utils.js
@@ -58,5 +58,8 @@ mr.PlatformUtils.getCurrentOS = function() {
if (userAgent.includes('Linux')) {
return mr.PlatformUtils.OS.LINUX;
}
+ if (userAgent.includes('FreeBSD')) {
+ return mr.PlatformUtils.OS.LINUX;
+ }
return mr.PlatformUtils.OS.OTHER;
};
@@ -0,0 +1,11 @@
--- chrome/browser/resources/settings/autofill_page/passwords_shared_css.html.orig 2021-06-11 09:29:24 UTC
+++ chrome/browser/resources/settings/autofill_page/passwords_shared_css.html
@@ -64,7 +64,7 @@
* necessary to prevent Chrome from using the operating system's font
* instead of the Material Design font.
* TODO(dbeam): why not font: inherit? */
-<if expr="chromeos or is_linux">
+<if expr="chromeos or is_posix">
font-family: 'DejaVu Sans Mono', monospace;
</if>
<if expr="is_win">
@@ -0,0 +1,11 @@
--- chrome/browser/resources/settings/route.js.orig 2021-06-11 09:29:55 UTC
+++ chrome/browser/resources/settings/route.js
@@ -183,7 +183,7 @@ function createBrowserSettingsRoutes() {

r.ACCESSIBILITY = r.ADVANCED.createSection('/accessibility', 'a11y');

- // <if expr="chromeos or is_linux">
+ // <if expr="chromeos or is_posix">
r.CAPTIONS = r.ACCESSIBILITY.createChild('/captions');
// </if>

@@ -0,0 +1,11 @@
--- chrome/browser/resources/signin/signin_shared_css.html.orig 2021-06-11 09:30:40 UTC
+++ chrome/browser/resources/signin/signin_shared_css.html
@@ -30,7 +30,7 @@
margin-inline-start: 8px;
}

-<if expr="is_macosx or is_linux">
+<if expr="is_macosx or is_posix">
.action-container {
flex-flow: row-reverse;
justify-content: flex-start;
@@ -0,0 +1,11 @@
--- chrome/browser/sync/device_info_sync_client_impl.cc.orig 2021-06-11 09:31:26 UTC
+++ chrome/browser/sync/device_info_sync_client_impl.cc
@@ -38,7 +38,7 @@ std::string DeviceInfoSyncClientImpl::GetSigninScopedD
// in lacros-chrome once build flag switch of lacros-chrome is
// complete.
#if defined(OS_WIN) || defined(OS_MAC) || \
- (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
+ (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || defined(OS_BSD)
syncer::SyncPrefs prefs(profile_->GetPrefs());
if (prefs.IsLocalSyncEnabled()) {
return "local_device";
@@ -0,0 +1,11 @@
--- components/cast_channel/cast_message_util.cc.orig 2021-06-11 09:34:59 UTC
+++ components/cast_channel/cast_message_util.cc
@@ -168,7 +168,7 @@ int GetVirtualConnectPlatformValue() {
return 4;
#elif BUILDFLAG(IS_CHROMEOS_ASH)
return 5;
-#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD)
return 6;
#else
return 0;
@@ -0,0 +1,20 @@
--- components/startup_metric_utils/browser/startup_metric_utils.cc.orig 2021-06-11 09:43:41 UTC
+++ components/startup_metric_utils/browser/startup_metric_utils.cc
@@ -343,7 +343,7 @@ base::TimeTicks StartupTimeToTimeTicks(base::Time time

// Enabling this logic on OS X causes a significant performance regression.
// https://crbug.com/601270
-#if !defined(OS_APPLE)
+#if !defined(OS_APPLE) && !defined(OS_BSD)
static bool statics_initialized = false;

base::ThreadPriority previous_priority = base::ThreadPriority::NORMAL;
@@ -357,7 +357,7 @@ base::TimeTicks StartupTimeToTimeTicks(base::Time time
static const base::Time time_base = base::Time::Now();
static const base::TimeTicks trace_ticks_base = base::TimeTicks::Now();

-#if !defined(OS_APPLE)
+#if !defined(OS_APPLE) && !defined(OS_BSD)
if (!statics_initialized) {
base::PlatformThread::SetCurrentThreadPriority(previous_priority);
}
@@ -1,19 +1,23 @@
--- content/renderer/renderer_main_platform_delegate_linux.cc.orig 2021-04-14 18:41:03 UTC
--- content/renderer/renderer_main_platform_delegate_linux.cc.orig 2021-06-09 22:14:02 UTC
+++ content/renderer/renderer_main_platform_delegate_linux.cc
@@ -30,6 +30,7 @@ void RendererMainPlatformDelegate::PlatformUninitializ
@@ -30,6 +30,11 @@ void RendererMainPlatformDelegate::PlatformUninitializ
}

bool RendererMainPlatformDelegate::EnableSandbox() {
+#if !defined(OS_BSD)
+#if defined(OS_FREEBSD)
+ sandbox::policy::Sandbox::Initialize(
+ sandbox::policy::SandboxTypeFromCommandLine(
+ *base::CommandLine::ForCurrentProcess()));
+#else
// The setuid sandbox is started in the zygote process: zygote_main_linux.cc
// https://chromium.googlesource.com/chromium/src/+/master/docs/linux/suid_sandbox.md
//
@@ -65,7 +66,7 @@ bool RendererMainPlatformDelegate::EnableSandbox() {
@@ -65,7 +70,7 @@ bool RendererMainPlatformDelegate::EnableSandbox() {
CHECK_EQ(errno, EPERM);
}
#endif // __x86_64__
-
+#endif // ! OS_BSD
+#endif // OS_FREEBSD
return true;
}

14 changes: 14 additions & 0 deletions www/chromium/files/patch-content_utility_utility__main.cc
@@ -0,0 +1,14 @@
--- content/utility/utility_main.cc.orig 2021-06-11 14:43:47 UTC
+++ content/utility/utility_main.cc
@@ -89,6 +89,11 @@ int UtilityMain(const MainFunctionParams& parameters)
if (parameters.command_line.HasSwitch(switches::kUtilityStartupDialog))
WaitForDebugger("Utility");

+#if defined(OS_FREEBSD)
+ sandbox::policy::Sandbox::Initialize(
+ sandbox::policy::SandboxTypeFromCommandLine(parameters.command_line));
+#endif
+
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
// Initializes the sandbox before any threads are created.
// TODO(jorgelo): move this after GTK initialization when we enable a strict
11 changes: 11 additions & 0 deletions www/chromium/files/patch-device_fido_features.cc
@@ -0,0 +1,11 @@
--- device/fido/features.cc.orig 2021-06-11 09:50:47 UTC
+++ device/fido/features.cc
@@ -26,7 +26,7 @@ extern const base::Feature kWebAuthCableServerLink {
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
// If updating this, also update kWebAuthCable.
-#if BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_LINUX)
+#if BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_LINUX) || defined(OS_BSD)
base::FEATURE_DISABLED_BY_DEFAULT
#else
base::FEATURE_ENABLED_BY_DEFAULT
29 changes: 29 additions & 0 deletions www/chromium/files/patch-gpu_vulkan_generate__bindings.py
@@ -0,0 +1,29 @@
--- gpu/vulkan/generate_bindings.py.orig 2021-06-11 09:51:44 UTC
+++ gpu/vulkan/generate_bindings.py
@@ -183,7 +183,7 @@ VULKAN_DEVICE_FUNCTIONS = [
]
},
{
- 'ifdef': 'defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)',
+ 'ifdef': 'defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD)',
'extension': 'VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME',
'functions': [
'vkGetSemaphoreFdKHR',
@@ -199,7 +199,7 @@ VULKAN_DEVICE_FUNCTIONS = [
]
},
{
- 'ifdef': 'defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)',
+ 'ifdef': 'defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD)',
'extension': 'VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME',
'functions': [
'vkGetMemoryFdKHR',
@@ -250,7 +250,7 @@ VULKAN_DEVICE_FUNCTIONS = [
]
},
{
- 'ifdef': 'defined(OS_LINUX) || defined(OS_CHROMEOS)',
+ 'ifdef': 'defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)',
'extension': 'VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME',
'functions': [
'vkGetImageDrmFormatModifierPropertiesEXT',
11 changes: 11 additions & 0 deletions www/chromium/files/patch-net_dns_BUILD.gn
@@ -0,0 +1,11 @@
--- net/dns/BUILD.gn.orig 2021-06-11 08:54:45 UTC
+++ net/dns/BUILD.gn
@@ -114,7 +114,7 @@ source_set("dns") {
"dns_config_service_android.cc",
"dns_config_service_android.h",
]
- } else if (is_linux) {
+ } else if (is_linux && !is_bsd) {
sources += [
"dns_config_service_linux.cc",
"dns_config_service_linux.h",
18 changes: 17 additions & 1 deletion www/chromium/files/patch-sandbox_policy_BUILD.gn
@@ -1,4 +1,4 @@
--- sandbox/policy/BUILD.gn.orig 2021-04-14 18:41:08 UTC
--- sandbox/policy/BUILD.gn.orig 2021-06-09 22:14:06 UTC
+++ sandbox/policy/BUILD.gn
@@ -29,7 +29,7 @@ component("policy") {
"//sandbox:common",
Expand All @@ -9,3 +9,19 @@
sources += [
"linux/bpf_audio_policy_linux.cc",
"linux/bpf_audio_policy_linux.h",
@@ -78,6 +78,15 @@ component("policy") {
"//sandbox/linux:sandbox_services",
"//sandbox/linux:seccomp_bpf",
"//sandbox/linux:suid_sandbox_client",
+ ]
+ }
+ if (is_bsd) {
+ sources += [
+ "freebsd/sandbox_freebsd.h",
+ "freebsd/sandbox_freebsd.cc",
+ ]
+ deps += [
+ "//sandbox:sandbox_buildflags",
]
}
if (is_chromeos_ash) {
35 changes: 35 additions & 0 deletions www/chromium/files/patch-sandbox_policy_sandbox.cc
@@ -0,0 +1,35 @@
--- sandbox/policy/sandbox.cc.orig 2021-06-11 14:21:39 UTC
+++ sandbox/policy/sandbox.cc
@@ -12,6 +12,10 @@
#include "base/android/jni_android.h"
#endif // defined(OS_ANDROID)

+#if defined(OS_FREEBSD)
+#include "sandbox/policy/freebsd/sandbox_freebsd.h"
+#endif // defined(OS_FREEBSD)
+
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
#include "sandbox/policy/linux/sandbox_linux.h"
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
@@ -29,6 +33,12 @@
namespace sandbox {
namespace policy {

+#if defined(OS_FREEBSD)
+bool Sandbox::Initialize(SandboxType sandbox_type) {
+ return SandboxFreeBSD::GetInstance()->InitializeSandbox(sandbox_type);
+}
+#endif // defined(OS_FREEBSD)
+
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
bool Sandbox::Initialize(SandboxType sandbox_type,
SandboxLinux::PreSandboxHook hook,
@@ -89,6 +99,8 @@ bool Sandbox::IsProcessSandboxed() {
base::android::MethodID::Get<base::android::MethodID::TYPE_STATIC>(
env, process_class.obj(), "isIsolated", "()Z");
return env->CallStaticBooleanMethod(process_class.obj(), is_isolated);
+#elif defined(OS_FREEBSD)
+ return SandboxFreeBSD::GetInstance()->IsSandboxed();
#elif defined(OS_FUCHSIA)
// TODO(https://crbug.com/1071420): Figure out what to do here. Process
// launching controls the sandbox and there are no ambient capabilities, so
24 changes: 24 additions & 0 deletions www/chromium/files/patch-sandbox_policy_sandbox.h
@@ -0,0 +1,24 @@
--- sandbox/policy/sandbox.h.orig 2021-06-11 14:23:34 UTC
+++ sandbox/policy/sandbox.h
@@ -9,6 +9,10 @@
#include "sandbox/policy/export.h"
#include "sandbox/policy/sandbox_type.h"

+#if defined(OS_FREEBSD)
+#include "sandbox/policy/freebsd/sandbox_freebsd.h"
+#endif
+
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
#include "sandbox/policy/linux/sandbox_linux.h"
#endif
@@ -30,6 +34,10 @@ namespace policy {

class SANDBOX_POLICY_EXPORT Sandbox {
public:
+#if defined(OS_FREEBSD)
+ static bool Initialize(SandboxType sandbox_type);
+#endif // defined(OS_FREEBSD)
+
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
static bool Initialize(SandboxType sandbox_type,
SandboxLinux::PreSandboxHook hook,
@@ -1,6 +1,6 @@
--- services/device/hid/hid_service_freebsd.cc.orig 2021-04-21 12:19:19 UTC
--- services/device/hid/hid_service_freebsd.cc.orig 2021-06-10 13:30:27 UTC
+++ services/device/hid/hid_service_freebsd.cc
@@ -0,0 +1,390 @@
@@ -0,0 +1,391 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
Expand Down Expand Up @@ -32,6 +32,7 @@
+#include "base/strings/string_util.h"
+#include "base/strings/string_split.h"
+#include "base/task/post_task.h"
+#include "base/task/thread_pool.h"
+#include "base/threading/scoped_blocking_call.h"
+#include "base/threading/thread_task_runner_handle.h"
+#include "base/threading/thread_restrictions.h"
Expand Down
11 changes: 11 additions & 0 deletions www/chromium/files/patch-services_network_network__context.cc
@@ -0,0 +1,11 @@
--- services/network/network_context.cc.orig 2021-06-11 09:55:35 UTC
+++ services/network/network_context.cc
@@ -2331,7 +2331,7 @@ NetworkContext::MakeSessionCleanupCookieStore() const

net::CookieCryptoDelegate* crypto_delegate = nullptr;
if (params_->enable_encrypted_cookies) {
-#if (defined(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
+#if (defined(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD)) && \
!BUILDFLAG(IS_CHROMECAST)
DCHECK(network_service_->os_crypt_config_set())
<< "NetworkService::SetCryptConfig must be called before creating a "
@@ -0,0 +1,16 @@
--- services/service_manager/public/cpp/service_executable/service_executable_environment.cc.orig 2021-06-11 15:03:35 UTC
+++ services/service_manager/public/cpp/service_executable/service_executable_environment.cc
@@ -50,6 +50,13 @@ ServiceExecutableEnvironment::ServiceExecutableEnviron
sandbox::policy::switches::kServiceSandboxType)),
sandbox::policy::SandboxLinux::PreSandboxHook(), sandbox_options);
}
+#elif defined(OS_FREEBSD)
+ if (command_line.HasSwitch(sandbox::policy::switches::kServiceSandboxType)) {
+ sandbox::policy::Sandbox::Initialize(
+ sandbox::policy::UtilitySandboxTypeFromString(
+ command_line.GetSwitchValueASCII(
+ sandbox::policy::switches::kServiceSandboxType)));
+ }
#endif

mojo::core::Init();
@@ -0,0 +1,11 @@
--- services/tracing/public/cpp/perfetto/perfetto_config.cc.orig 2021-06-11 09:57:05 UTC
+++ services/tracing/public/cpp/perfetto/perfetto_config.cc
@@ -88,7 +88,7 @@ void AddDataSourceConfigs(
// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
// complete.
#if BUILDFLAG(IS_CHROMEOS_ASH) || \
- (BUILDFLAG(IS_CHROMECAST) && defined(OS_LINUX))
+ (BUILDFLAG(IS_CHROMECAST) && (defined(OS_LINUX) || defined(OS_BSD)))
if (source_names.empty() ||
source_names.count(tracing::mojom::kSystemTraceDataSourceName) == 1) {
AddDataSourceConfig(

0 comments on commit 27b0fe4

Please sign in to comment.