1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
|
--- chrome/browser/chrome_content_browser_client.cc.orig 2025-05-28 14:55:43 UTC
+++ chrome/browser/chrome_content_browser_client.cc
@@ -506,7 +506,7 @@
#include "components/user_manager/user_manager.h"
#include "services/service_manager/public/mojom/interface_provider_spec.mojom.h"
#include "storage/browser/file_system/external_mount_points.h"
-#elif BUILDFLAG(IS_LINUX)
+#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
#include "chrome/browser/chrome_browser_main_linux.h"
#include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h"
#elif BUILDFLAG(IS_ANDROID)
@@ -621,11 +621,11 @@
#include "services/network/public/mojom/permissions_policy/permissions_policy_feature.mojom.h"
#endif // !BUILDFLAG(IS_ANDROID)
-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
#include "chrome/browser/browser_switcher/browser_switcher_navigation_throttle.h"
#endif
-#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
@@ -636,7 +636,7 @@
#include "chrome/browser/apps/link_capturing/web_app_link_capturing_delegate.h"
#endif
-#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"
@@ -647,7 +647,7 @@
#endif
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \
- BUILDFLAG(IS_CHROMEOS)
+ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
#include "chrome/browser/enterprise/connectors/device_trust/navigation_throttle.h"
#include "chrome/browser/enterprise/incognito/incognito_navigation_throttle.h"
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) ||
@@ -657,7 +657,7 @@
#include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h"
#endif
-#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"
@@ -1558,7 +1558,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePre
registry->RegisterBooleanPref(prefs::kDeviceNativeClientForceAllowedCache,
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)
@@ -1651,7 +1651,7 @@ void ChromeContentBrowserClient::RegisterProfilePrefs(
policy::policy_prefs::kForcePermissionPolicyUnloadDefaultEnabled, false);
#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
- BUILDFLAG(IS_LINUX)
+ BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
registry->RegisterListPref(prefs::kMandatoryExtensionsForIncognitoNavigation);
#endif
@@ -1775,7 +1775,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo
#elif BUILDFLAG(IS_CHROMEOS)
main_parts = std::make_unique<ash::ChromeBrowserMainPartsAsh>(
is_integration_test, &startup_data_);
-#elif BUILDFLAG(IS_LINUX)
+#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
main_parts = std::make_unique<ChromeBrowserMainPartsLinux>(
is_integration_test, &startup_data_);
#elif BUILDFLAG(IS_ANDROID)
@@ -1804,7 +1804,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo
// Construct additional browser parts. Stages are called in the order in
// which they are added.
#if defined(TOOLKIT_VIEWS)
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
main_parts->AddParts(
std::make_unique<ChromeBrowserMainExtraPartsViewsLinux>());
#else
@@ -1821,7 +1821,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(boo
main_parts->AddParts(std::make_unique<ChromeBrowserMainExtraPartsAsh>());
#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>());
@@ -1840,7 +1840,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<
enterprise_util::ChromeBrowserMainExtraPartsEnterprise>());
@@ -2744,7 +2744,9 @@ void MaybeAppendBlinkSettingsSwitchForFieldTrial(
void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
base::CommandLine* command_line,
int child_process_id) {
+#ifdef notyet
crash_keys::AppendStringAnnotationsCommandLineSwitch(command_line);
+#endif
#if BUILDFLAG(IS_MAC)
std::unique_ptr<metrics::ClientInfo> client_info =
GoogleUpdateSettings::LoadMetricsClientInfo();
@@ -2753,7 +2755,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLin
client_info->client_id);
}
#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(
@@ -3117,7 +3119,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLin
}
}
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !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)) {
@@ -4067,7 +4069,7 @@ bool UpdatePreferredColorScheme(WebPreferences* web_pr
return old_preferred_color_scheme != web_prefs->preferred_color_scheme;
}
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
// Sets the `root_scrollbar_theme_color` web pref if the user has enabled a
// custom colored frame for the UI.
void UpdateRootScrollbarThemeColor(Profile* profile,
@@ -4697,7 +4699,7 @@ void ChromeContentBrowserClient::OverrideWebPreference
UpdatePreferredColorScheme(web_prefs, main_frame_site.GetSiteURL(),
web_contents, GetWebTheme());
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
UpdateRootScrollbarThemeColor(profile, web_contents, web_prefs);
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
@@ -5017,7 +5019,7 @@ void ChromeContentBrowserClient::GetAdditionalFileSyst
}
}
-#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,
@@ -5529,7 +5531,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati
&throttles);
}
-#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);
@@ -5553,7 +5555,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)
+ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
MaybeAddThrottle(enterprise_connectors::DeviceTrustNavigationThrottle::
MaybeCreateThrottleFor(handle),
&throttles);
@@ -5594,7 +5596,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati
}
#endif
-#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);
@@ -5716,7 +5718,7 @@ ChromeContentBrowserClient::CreateThrottlesForNavigati
&throttles);
#endif // BUILDFLAG(IS_CHROMEOS)
-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
if (profile && profile->IsIncognitoProfile() && profile->IsOffTheRecord()) {
MaybeAddThrottle(enterprise_incognito::IncognitoNavigationThrottle::
MaybeCreateThrottleFor(handle),
@@ -7544,7 +7546,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) {
|