feat: enable code cache for custom protocols (#40544)

This commit is contained in:
Cheng Zhao 2023-12-06 11:22:41 +09:00 committed by GitHub
parent 85bc005cd6
commit 9aa73abe78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 526 additions and 6 deletions

View file

@ -526,7 +526,8 @@ void ElectronBrowserClient::AppendExtraCommandLineSwitches(
switches::kStandardSchemes, switches::kEnableSandbox,
switches::kSecureSchemes, switches::kBypassCSPSchemes,
switches::kCORSSchemes, switches::kFetchSchemes,
switches::kServiceWorkerSchemes, switches::kStreamingSchemes};
switches::kServiceWorkerSchemes, switches::kStreamingSchemes,
switches::kCodeCacheSchemes};
command_line->CopySwitchesFrom(*base::CommandLine::ForCurrentProcess(),
kCommonSwitchNames);
if (process_type == ::switches::kUtilityProcess ||
@ -694,7 +695,7 @@ ElectronBrowserClient::CreateWindowForVideoPictureInPicture(
void ElectronBrowserClient::GetAdditionalAllowedSchemesForFileSystem(
std::vector<std::string>* additional_schemes) {
auto schemes_list = api::GetStandardSchemes();
const auto& schemes_list = api::GetStandardSchemes();
if (!schemes_list.empty())
additional_schemes->insert(additional_schemes->end(), schemes_list.begin(),
schemes_list.end());