feat: Add option to conditionally disable site instance patches (#18396)
* chore: allow conditional disable of the site instance override patches at runtime * feat: add app.allowRendererProcessReuse property to allow runtime disable of site instance overrides spec: add tests for the new allowRendererProcessReuse property feat: add console warnings / errors for loading non context-aware native modules * Only error if the patch is disabled * Warn all the time, this will ship in Electron 7
This commit is contained in:
parent
26155c8a00
commit
87ae9324ac
17 changed files with 221 additions and 89 deletions
|
@ -403,6 +403,14 @@ void AtomBrowserClient::OverrideWebkitPrefs(content::RenderViewHost* host,
|
|||
web_preferences->OverrideWebkitPrefs(prefs);
|
||||
}
|
||||
|
||||
void AtomBrowserClient::SetCanUseCustomSiteInstance(bool should_disable) {
|
||||
disable_process_restart_tricks_ = should_disable;
|
||||
}
|
||||
|
||||
bool AtomBrowserClient::CanUseCustomSiteInstance() {
|
||||
return disable_process_restart_tricks_;
|
||||
}
|
||||
|
||||
content::ContentBrowserClient::SiteInstanceForNavigationType
|
||||
AtomBrowserClient::ShouldOverrideSiteInstanceForNavigation(
|
||||
content::RenderFrameHost* current_rfh,
|
||||
|
@ -509,6 +517,10 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches(
|
|||
web_preferences->AppendCommandLineSwitches(command_line);
|
||||
SessionPreferences::AppendExtraCommandLineSwitches(
|
||||
web_contents->GetBrowserContext(), command_line);
|
||||
if (CanUseCustomSiteInstance()) {
|
||||
command_line->AppendSwitch(
|
||||
switches::kDisableElectronSiteInstanceOverrides);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue