Commit 0a07e999 authored by Wez's avatar Wez Committed by Commit Bot

[fuchsia] Allow site-per-process to be set via config-data.

Bug: b/171024731, 1140436
Change-Id: I74900eaa038090cb3ec816492d78df261a9f6332
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2479362
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: default avatarAlex Gough <ajgo@chromium.org>
Reviewed-by: default avatarDavid Dorwin <ddorwin@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818869}
parent 8bbcdd00
...@@ -152,6 +152,14 @@ void WebEngineContentBrowserClient:: ...@@ -152,6 +152,14 @@ void WebEngineContentBrowserClient::
} }
} }
bool WebEngineContentBrowserClient::ShouldEnableStrictSiteIsolation() {
constexpr base::Feature kSitePerProcess{"site-per-process",
base::FEATURE_ENABLED_BY_DEFAULT};
static bool enable_strict_isolation =
base::FeatureList::IsEnabled(kSitePerProcess);
return enable_strict_isolation;
}
void WebEngineContentBrowserClient::AppendExtraCommandLineSwitches( void WebEngineContentBrowserClient::AppendExtraCommandLineSwitches(
base::CommandLine* command_line, base::CommandLine* command_line,
int child_process_id) { int child_process_id) {
......
...@@ -47,6 +47,7 @@ class WebEngineContentBrowserClient : public content::ContentBrowserClient { ...@@ -47,6 +47,7 @@ class WebEngineContentBrowserClient : public content::ContentBrowserClient {
int render_process_id, int render_process_id,
int render_frame_id, int render_frame_id,
NonNetworkURLLoaderFactoryMap* factories) final; NonNetworkURLLoaderFactoryMap* factories) final;
bool ShouldEnableStrictSiteIsolation() final;
void AppendExtraCommandLineSwitches(base::CommandLine* command_line, void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
int child_process_id) final; int child_process_id) final;
std::vector<std::unique_ptr<blink::URLLoaderThrottle>> std::vector<std::unique_ptr<blink::URLLoaderThrottle>>
......
...@@ -127,17 +127,6 @@ bool SetContentDirectoriesInCommandLine( ...@@ -127,17 +127,6 @@ bool SetContentDirectoriesInCommandLine(
return true; return true;
} }
base::Value LoadConfig() {
const base::Optional<base::Value>& config = cr_fuchsia::LoadPackageConfig();
if (!config) {
DLOG(WARNING) << "Configuration data not found. Using default "
"WebEngine configuration.";
return base::Value(base::Value::Type::DICTIONARY);
}
return config->Clone();
}
void AppendFeature(base::StringPiece features_flag, void AppendFeature(base::StringPiece features_flag,
base::StringPiece feature_string, base::StringPiece feature_string,
base::CommandLine* command_line) { base::CommandLine* command_line) {
...@@ -297,9 +286,15 @@ void ContextProviderImpl::Create( ...@@ -297,9 +286,15 @@ void ContextProviderImpl::Create(
base::CommandLine launch_command = *base::CommandLine::ForCurrentProcess(); base::CommandLine launch_command = *base::CommandLine::ForCurrentProcess();
std::vector<zx::channel> devtools_listener_channels; std::vector<zx::channel> devtools_listener_channels;
base::Value web_engine_config = // Process command-line settings specified in our package config-data.
config_for_test_.is_none() ? LoadConfig() : std::move(config_for_test_); base::Value web_engine_config;
if (config_for_test_.is_none()) {
const base::Optional<base::Value>& config = cr_fuchsia::LoadPackageConfig();
web_engine_config =
config ? config->Clone() : base::Value(base::Value::Type::DICTIONARY);
} else {
web_engine_config = std::move(config_for_test_);
}
if (!MaybeAddCommandLineArgsFromConfig(web_engine_config, &launch_command)) { if (!MaybeAddCommandLineArgsFromConfig(web_engine_config, &launch_command)) {
context_request.Close(ZX_ERR_INTERNAL); context_request.Close(ZX_ERR_INTERNAL);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment