diff options
Diffstat (limited to 'www/chromium/files/patch-chrome_browser_chrome__content__browser__client.cc')
-rw-r--r-- | www/chromium/files/patch-chrome_browser_chrome__content__browser__client.cc | 215 |
1 files changed, 122 insertions, 93 deletions
diff --git a/www/chromium/files/patch-chrome_browser_chrome__content__browser__client.cc b/www/chromium/files/patch-chrome_browser_chrome__content__browser__client.cc index 5276a2ff105d..7f9cb252ad26 100644 --- a/www/chromium/files/patch-chrome_browser_chrome__content__browser__client.cc +++ b/www/chromium/files/patch-chrome_browser_chrome__content__browser__client.cc @@ -1,132 +1,161 @@ ---- chrome/browser/chrome_content_browser_client.cc.orig 2021-06-09 22:13:55 UTC +--- chrome/browser/chrome_content_browser_client.cc.orig 2024-04-19 13:02:56 UTC +++ chrome/browser/chrome_content_browser_client.cc -@@ -446,7 +446,7 @@ - #include "components/user_manager/user.h" - #include "components/user_manager/user_manager.h" - #include "services/service_manager/public/mojom/interface_provider_spec.mojom.h" --#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD) +@@ -460,7 +460,7 @@ + #include "storage/browser/file_system/external_mount_points.h" + // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch + // of lacros-chrome is complete. +-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) #include "chrome/browser/chrome_browser_main_linux.h" - #elif defined(OS_ANDROID) - #include "base/android/application_status_listener.h" -@@ -507,7 +507,7 @@ + #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h" + #elif BUILDFLAG(IS_ANDROID) +@@ -569,12 +569,12 @@ + // TODO(crbug.com/1052397): Revisit the macro expression 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) +-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ ++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) || \ + (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) #include "chrome/browser/browser_switcher/browser_switcher_navigation_throttle.h" #endif -@@ -526,9 +526,9 @@ - - // TODO(crbug/1169547) Remove `BUILDFLAG(IS_CHROMEOS_LACROS)` once the - // migration is complete. --#if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_WIN) -+#if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_WIN) || defined(OS_BSD) - #include "chrome/browser/enterprise/connectors/device_trust/navigation_throttle.h" --#endif // defined(OS_LINUX) || defined(OS_MAC) || defined(OS_WIN) -+#endif // defined(OS_LINUX) || defined(OS_MAC) || defined(OS_WIN) || defined(OS_BSD) - - // TODO(crbug.com/939205): Once the upcoming App Service is available, use a - // single navigation throttle to display the intent picker on all platforms. -@@ -546,7 +546,7 @@ - - // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch - // of lacros-chrome is complete. --#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD) - #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h" +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + #include "components/crash/core/app/crash_switches.h" + #include "components/crash/core/app/crashpad.h" + #endif +@@ -585,7 +585,7 @@ + #include "chrome/browser/apps/link_capturing/web_app_link_capturing_delegate.h" #endif -@@ -957,11 +957,13 @@ breakpad::CrashHandlerHostLinux* CreateCrashHandlerHos - } +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) + #include "chrome/browser/enterprise/chrome_browser_main_extra_parts_enterprise.h" + #include "chrome/browser/enterprise/profile_management/oidc_auth_response_capture_navigation_throttle.h" + #include "chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.h" +@@ -593,7 +593,7 @@ + #endif - int GetCrashSignalFD(const base::CommandLine& command_line) { -+#if !defined(OS_BSD) - if (crash_reporter::IsCrashpadEnabled()) { - int fd; - pid_t pid; - return crash_reporter::GetHandlerSocket(&fd, &pid) ? fd : -1; - } -+#endif + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \ +- BUILDFLAG(IS_CHROMEOS_ASH) ++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) + #include "chrome/browser/enterprise/connectors/device_trust/navigation_throttle.h" + #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || + // BUILDFLAG(IS_CHROMEOS_ASH) +@@ -609,7 +609,7 @@ + #include "components/lens/lens_features.h" + #endif - // Extensions have the same process type as renderers. - if (command_line.HasSwitch(extensions::switches::kExtensionProcess)) { -@@ -1381,7 +1383,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #include "chrome/browser/chrome_browser_main_extra_parts_linux.h" + #elif BUILDFLAG(IS_OZONE) + #include "chrome/browser/chrome_browser_main_extra_parts_ozone.h" +@@ -1474,7 +1474,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePre + #if BUILDFLAG(IS_CHROMEOS) + registry->RegisterBooleanPref(prefs::kNativeClientForceAllowed, false); + #endif // BUILDFLAG(IS_CHROMEOS) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) + registry->RegisterBooleanPref(prefs::kOutOfProcessSystemDnsResolutionEnabled, + true); + #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) +@@ -1598,7 +1598,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo #elif BUILDFLAG(IS_CHROMEOS_LACROS) - main_parts = std::make_unique<ChromeBrowserMainPartsLacros>(parameters, - &startup_data_); --#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD) - main_parts = - std::make_unique<ChromeBrowserMainPartsLinux>(parameters, &startup_data_); - #elif defined(OS_ANDROID) -@@ -1412,7 +1414,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts( + main_parts = std::make_unique<ChromeBrowserMainPartsLacros>( + is_integration_test, &startup_data_); +-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) + main_parts = std::make_unique<ChromeBrowserMainPartsLinux>( + is_integration_test, &startup_data_); + #elif BUILDFLAG(IS_ANDROID) +@@ -1635,7 +1635,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo std::make_unique<ChromeBrowserMainExtraPartsViewsLacros>()); // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. --#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -+#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD) +-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD) main_parts->AddParts( std::make_unique<ChromeBrowserMainExtraPartsViewsLinux>()); #else -@@ -2190,7 +2192,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLin - command_line->AppendSwitchASCII(switches::kMetricsClientID, +@@ -1656,7 +1656,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo + main_parts->AddParts(std::make_unique<ChromeBrowserMainExtraPartsLacros>()); + #endif + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + main_parts->AddParts(std::make_unique<ChromeBrowserMainExtraPartsLinux>()); + #elif BUILDFLAG(IS_OZONE) + main_parts->AddParts(std::make_unique<ChromeBrowserMainExtraPartsOzone>()); +@@ -1675,7 +1675,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo + + chrome::AddMetricsExtraParts(main_parts.get()); + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) + main_parts->AddParts( + std::make_unique< + chrome::enterprise_util::ChromeBrowserMainExtraPartsEnterprise>()); +@@ -2515,7 +2515,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLin client_info->client_id); } --#elif defined(OS_POSIX) -+#elif defined(OS_POSIX) && !defined(OS_BSD) - #if defined(OS_ANDROID) - bool enable_crash_reporter = true; - #else -@@ -2493,7 +2495,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLin + #elif BUILDFLAG(IS_POSIX) +-#if !BUILDFLAG(IS_ANDROID) ++#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_BSD) + pid_t pid; + if (crash_reporter::GetHandlerSocket(nullptr, &pid)) { + command_line->AppendSwitchASCII( +@@ -2847,7 +2847,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLin ThreadProfilerConfiguration::Get()->AppendCommandLineSwitchForChildProcess( command_line); --#if defined(OS_LINUX) || defined(OS_CHROMEOS) -+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) - // Processes may only query perf_event_open with the BPF sandbox disabled. - if (browser_command_line.HasSwitch(switches::kEnableThreadInstructionCount) && - command_line->HasSwitch(sandbox::policy::switches::kNoSandbox)) { -@@ -3821,7 +3823,7 @@ void ChromeContentBrowserClient::GetAdditionalFileSyst +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) ++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)) && !BUILDFLAG(IS_BSD) + // Opt into a hardened stack canary mitigation if it hasn't already been + // force-disabled. + if (!browser_command_line.HasSwitch(switches::kChangeStackGuardOnFork)) { +@@ -4551,7 +4551,7 @@ void ChromeContentBrowserClient::GetAdditionalFileSyst } } --#if defined(OS_POSIX) && !defined(OS_MAC) -+#if defined(OS_POSIX) && !defined(OS_MAC) && !defined(OS_BSD) +-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) ++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD) void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( const base::CommandLine& command_line, int child_process_id, -@@ -3856,7 +3858,7 @@ void ChromeContentBrowserClient::GetAdditionalMappedFi - mappings->Share(kCrashDumpSignal, crash_signal_fd); - } - } --#endif // defined(OS_POSIX) && !defined(OS_MAC) -+#endif // defined(OS_POSIX) && !defined(OS_MAC) && !defined(OS_BSD) - - #if defined(OS_WIN) - std::wstring ChromeContentBrowserClient::GetAppContainerSidForSandboxType( -@@ -4210,11 +4212,11 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati +@@ -5109,7 +5109,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati &throttles); } --#if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_WIN) -+#if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_WIN) || defined(OS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) + MaybeAddThrottle( + WebAppSettingsNavigationThrottle::MaybeCreateThrottleFor(handle), + &throttles); +@@ -5123,7 +5123,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati + #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) + + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \ +- BUILDFLAG(IS_CHROMEOS_ASH) ++ BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_BSD) MaybeAddThrottle(enterprise_connectors::DeviceTrustNavigationThrottle:: MaybeCreateThrottleFor(handle), &throttles); --#endif // defined(OS_LINUX) || defined(OS_MAC) || defined(OS_WIN) -+#endif // defined(OS_LINUX) || defined(OS_MAC) || defined(OS_WIN) || defined(OS_BSD) +@@ -5162,7 +5162,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati + handle)); + } - #if !defined(OS_ANDROID) - MaybeAddThrottle(DevToolsWindow::MaybeCreateNavigationThrottle(handle), -@@ -4236,7 +4238,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati - // TODO(crbug.com/1052397): Revisit the macro expression 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) +-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) MaybeAddThrottle(browser_switcher::BrowserSwitcherNavigationThrottle:: MaybeCreateThrottleFor(handle), &throttles); +@@ -7137,7 +7137,7 @@ bool ChromeContentBrowserClient::ShouldSandboxNetworkS + bool ChromeContentBrowserClient::ShouldRunOutOfProcessSystemDnsResolution() { + // This enterprise policy is supported on Android, but the feature will not be + // launched there. +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD) + // This is possibly called before `g_browser_process` is initialized. + PrefService* local_state; + if (g_browser_process) { |