Skip to content

Commit

Permalink
fix: ensure standard schemes are registered in nw service process
Browse files Browse the repository at this point in the history
Refs #20546
  • Loading branch information
deepak1556 committed Mar 27, 2020
1 parent bd5789a commit 5b73b1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 2 additions & 0 deletions shell/app/electron_content_client.cc
Expand Up @@ -233,6 +233,8 @@ base::RefCountedMemory* ElectronContentClient::GetDataResourceBytes(
void ElectronContentClient::AddAdditionalSchemes(Schemes* schemes) {
AppendDelimitedSwitchToVector(switches::kServiceWorkerSchemes,
&schemes->service_worker_schemes);
AppendDelimitedSwitchToVector(switches::kStandardSchemes,
&schemes->standard_schemes);
AppendDelimitedSwitchToVector(switches::kSecureSchemes,
&schemes->secure_schemes);
AppendDelimitedSwitchToVector(switches::kBypassCSPSchemes,
Expand Down
8 changes: 1 addition & 7 deletions shell/renderer/renderer_client_base.cc
Expand Up @@ -97,13 +97,7 @@ std::vector<std::string> ParseSchemesCLISwitch(base::CommandLine* command_line,

RendererClientBase::RendererClientBase() {
auto* command_line = base::CommandLine::ForCurrentProcess();
// Parse --standard-schemes=scheme1,scheme2
std::vector<std::string> standard_schemes_list =
ParseSchemesCLISwitch(command_line, switches::kStandardSchemes);
for (const std::string& scheme : standard_schemes_list)
url::AddStandardScheme(scheme.c_str(), url::SCHEME_WITH_HOST);
isolated_world_ = base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kContextIsolation);
isolated_world_ = command_line->HasSwitch(switches::kContextIsolation);
// We rely on the unique process host id which is notified to the
// renderer process via command line switch from the content layer,
// if this switch is removed from the content layer for some reason,
Expand Down

0 comments on commit 5b73b1b

Please sign in to comment.