Update url_schemes.cc

This commit is contained in:
Alexander David Frick 2022-07-15 20:37:45 -05:00 committed by GitHub
parent 3f16713298
commit 7407535ca0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -72,7 +72,7 @@ void RegisterContentSchemes(bool should_lock_registry) {
url::AddStandardScheme(kChromeUIUntrustedScheme, url::SCHEME_WITH_HOST);
url::AddStandardScheme(kGuestScheme, url::SCHEME_WITH_HOST);
url::AddStandardScheme(kChromeErrorScheme, url::SCHEME_WITH_HOST);
url::AddStandardScheme(kIsolatedAppScheme, url::SCHEME_WITH_HOST);
for (auto& scheme : schemes.standard_schemes)
url::AddStandardScheme(scheme.c_str(), url::SCHEME_WITH_HOST);
@ -83,6 +83,7 @@ void RegisterContentSchemes(bool should_lock_registry) {
schemes.secure_schemes.push_back(kChromeUIScheme);
schemes.secure_schemes.push_back(kChromeUIUntrustedScheme);
schemes.secure_schemes.push_back(kChromeErrorScheme);
schemes.secure_schemes.push_back(kIsolatedAppScheme);
for (auto& scheme : schemes.secure_schemes)
url::AddSecureScheme(scheme.c_str());
@ -98,6 +99,7 @@ void RegisterContentSchemes(bool should_lock_registry) {
schemes.cors_enabled_schemes.push_back(kChromeUIScheme);
schemes.cors_enabled_schemes.push_back(kChromeUIUntrustedScheme);
schemes.cors_enabled_schemes.push_back(kIsolatedAppScheme);
for (auto& scheme : schemes.cors_enabled_schemes)
url::AddCorsEnabledScheme(scheme.c_str());
@ -114,6 +116,7 @@ void RegisterContentSchemes(bool should_lock_registry) {
url::EnableNonStandardSchemesForAndroidWebView();
#endif
schemes.service_worker_schemes.push_back(kIsolatedAppScheme);
// This should only be registered if the
// kEnableServiceWorkerForChromeUntrusted feature is enabled but checking
// it here causes a crash when --no-sandbox is enabled. See crbug.com/1313812
@ -122,6 +125,8 @@ void RegisterContentSchemes(bool should_lock_registry) {
// enabled.
schemes.service_worker_schemes.push_back(kChromeUIUntrustedScheme);
url::AddWebStorageScheme(kIsolatedAppScheme);
// Prevent future modification of the scheme lists. This is to prevent
// accidental creation of data races in the program. Add*Scheme aren't
// threadsafe so must be called when GURL isn't used on any other thread. This