Don't rely on AddAdditionalSchemes for setting standard schemes
On Linux because of the existence of zygote process, it becomes very tricky to correctly set standard schemes, basically we have to: 1. Pass --standard-schemes to both zygote and render processes 2. Init standard schemes for both zygote and render processes The )1 is very hard to achieve, so instead of using AddAdditionalSchemes, we just call url::AddStandardScheme directly.
This commit is contained in:
parent
7108cc5f2b
commit
1bfbd215ea
2 changed files with 10 additions and 14 deletions
|
@ -122,6 +122,16 @@ bool IsDevToolsExtension(content::RenderFrame* render_frame) {
|
|||
AtomRendererClient::AtomRendererClient()
|
||||
: node_bindings_(NodeBindings::Create(false)),
|
||||
atom_bindings_(new AtomBindings) {
|
||||
// Parse --standard-schemes=scheme1,scheme2
|
||||
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||
std::string custom_schemes = command_line->GetSwitchValueASCII(
|
||||
switches::kStandardSchemes);
|
||||
if (!custom_schemes.empty()) {
|
||||
std::vector<std::string> schemes_list = base::SplitString(
|
||||
custom_schemes, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
|
||||
for (const std::string& scheme : schemes_list)
|
||||
url::AddStandardScheme(scheme.c_str(), url::SCHEME_WITHOUT_PORT);
|
||||
}
|
||||
}
|
||||
|
||||
AtomRendererClient::~AtomRendererClient() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue