0

[Fuchsia] Process WebEngine config only after loading argv.json

UpdateCommandLineFromConfigFile() assumes that the command line contains
arguments that were initialized based on the web context parameters.
With CFv2 context-specific arguments are passed as argv.json . That file
was processed only after loading config, as result some of the
parameters in the config were not processed properly.

Bug: 268737401
Change-Id: Ia0f2c52b4efc4f70644645d221d635b12263a64a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4251481
Reviewed-by: Wez <wez@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1105598}
This commit is contained in:
Sergey Ulanov
2023-02-15 12:45:06 +00:00
committed by Chromium LUCI CQ
parent 053e592461
commit 780dad9465

@ -21,16 +21,16 @@ static void LoadConfigAndUpdateCommandLine(base::CommandLine* command_line) {
if (!is_browser_process)
return;
CHECK(fuchsia_component_support::AppendArgumentsFromFile(
base::FilePath(FILE_PATH_LITERAL("/config/command-line/argv.json")),
*command_line))
<< "Malformed argv.json file.";
if (const auto& config = fuchsia_component_support::LoadPackageConfig();
config.has_value()) {
CHECK(UpdateCommandLineFromConfigFile(config.value(), command_line))
<< "WebEngine config is invalid.";
}
CHECK(fuchsia_component_support::AppendArgumentsFromFile(
base::FilePath(FILE_PATH_LITERAL("/config/command-line/argv.json")),
*command_line))
<< "Malformed argv.json file.";
}
int main(int argc, const char** argv) {