0

Revert "[fuchsia] Pass switches by process type"

This reverts commit 1fba93c2f3.

Reason for revert: Possible culprit for Fuchsia builders:
https://ci.chromium.org/p/chromium/builders/ci/Fuchsia%20ARM64/132538
https://ci.chromium.org/p/chromium/builders/ci/Fuchsia%20x64/78606

BUG: 1336067


Original change's description:
> [fuchsia] Pass switches by process type
>
> WebEngineContentBrowserClient::AppendExtraCommandLineSwitches() copied
> kSwitchesToCopy to the command line regardless of the process type.
>
> Therefore, this CL passes switches based on the process type, depending
> on whether it is a renderer process, a GPU process, or a network
> process. This is very similar to what
> ChromeContentBrowserClient::AppendExtraCommandLineSwitches() does.
>
> Also, the kMaxDecodedImageSizeMb switch was removed because it is passed
> by content.
>
> Bug: 1083520
> Change-Id: Ic9e849722544aae0763b6bf11c0f3d7a0a7330c2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3669440
> Reviewed-by: Fabrice de Gans <fdegans@chromium.org>
> Reviewed-by: David Dorwin <ddorwin@chromium.org>
> Commit-Queue: Joseph Wang <jwx@google.com>
> Cr-Commit-Position: refs/heads/main@{#1013594}

Bug: 1083520
Change-Id: Iabd84327174cd5b4192ed0e3284370df875e91b6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3704485
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Travis Skare <skare@chromium.org>
Commit-Queue: Travis Skare <skare@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1013725}
This commit is contained in:
Travis Skare
2022-06-13 23:53:29 +00:00
committed by Chromium LUCI CQ
parent 1e96f6e180
commit 404768f98f

@ -84,27 +84,6 @@ std::vector<std::string> GetCorsExemptHeaders() {
",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
}
static constexpr char const* kRendererSwitchesToCopy[] = {
blink::switches::kSharedArrayBufferAllowedOrigins,
switches::kCorsExemptHeaders,
switches::kEnableCastStreamingReceiver,
switches::kEnableContentDirectories,
switches::kEnableProtectedVideoBuffers,
switches::kUseOverlaysForVideo,
// TODO(crbug/1013412): Delete these two switches when fixed.
switches::kEnableWidevine,
switches::kPlayreadyKeySystem,
// Pass to the renderer process for consistency with Chrome.
network::switches::kUnsafelyTreatInsecureOriginAsSecure,
};
static constexpr char const*
kUnsafelyTreatInsecureOriginAsSecureSwitchToCopy[] = {
network::switches::kUnsafelyTreatInsecureOriginAsSecure,
};
} // namespace
WebEngineContentBrowserClient::WebEngineContentBrowserClient()
@ -208,24 +187,22 @@ bool WebEngineContentBrowserClient::ShouldEnableStrictSiteIsolation() {
void WebEngineContentBrowserClient::AppendExtraCommandLineSwitches(
base::CommandLine* command_line,
int child_process_id) {
std::string process_type =
command_line->GetSwitchValueASCII(switches::kProcessType);
// TODO(https://crbug.com/1083520): Pass based on process type.
constexpr char const* kSwitchesToCopy[] = {
blink::switches::kSharedArrayBufferAllowedOrigins,
switches::kCorsExemptHeaders,
switches::kEnableCastStreamingReceiver,
switches::kEnableContentDirectories,
switches::kEnableProtectedVideoBuffers,
switches::kEnableWidevine,
switches::kMaxDecodedImageSizeMb,
switches::kPlayreadyKeySystem,
network::switches::kUnsafelyTreatInsecureOriginAsSecure,
switches::kUseOverlaysForVideo,
};
if (process_type == switches::kRendererProcess) {
command_line->CopySwitchesFrom(*base::CommandLine::ForCurrentProcess(),
kRendererSwitchesToCopy,
std::size(kRendererSwitchesToCopy));
} else if (process_type == switches::kUtilityProcess) {
// Although only the Network process needs
// kUnsafelyTreatInsecureOriginAsSecureSwitchToCopy, differentiating utility
// process sub-types is non-trivial. ChromeContentBrowserClient appends this
// switch to all Utility processes so do the same here.
// Do not add other switches here.
command_line->CopySwitchesFrom(
*base::CommandLine::ForCurrentProcess(),
kUnsafelyTreatInsecureOriginAsSecureSwitchToCopy,
std::size(kUnsafelyTreatInsecureOriginAsSecureSwitchToCopy));
}
command_line->CopySwitchesFrom(*base::CommandLine::ForCurrentProcess(),
kSwitchesToCopy, std::size(kSwitchesToCopy));
}
std::string WebEngineContentBrowserClient::GetApplicationLocale() {