diff --git a/url/url_util.cc b/url/url_util.cc index 2aa5c4296eac803fc70ae0f148cf3ac8721bb0cf..39c99aa7ac1793473103b42f25bd09a2d918796f 100644 --- a/url/url_util.cc +++ b/url/url_util.cc @@ -132,7 +132,9 @@ struct SchemeRegistry { #endif #if BUILDFLAG(IS_OHOS) - std::vector code_cache_enabled_schemes = {}; + std::vector code_cache_enabled_schemes = { + kFileScheme, + }; #endif bool allow_non_standard_schemes = false; @@ -720,6 +722,11 @@ bool IsCodeCacheEnabledScheme(const std::string& scheme) { } return false; } + +const std::vector& GetCodeCacheEnabledSchemes() +{ + return GetSchemeRegistry().code_cache_enabled_schemes; +} #endif void AddPredefinedHandlerScheme(const char* new_scheme, const char* handler) { diff --git a/url/url_util.h b/url/url_util.h index 0bdc9af343a5f033dfb5d71e1a8ed8023e00ee54..c2d2de665f6e27c8d6ea8ac1f8250104409bb6b5 100644 --- a/url/url_util.h +++ b/url/url_util.h @@ -128,6 +128,9 @@ COMPONENT_EXPORT(URL) void AddCodeCacheEnabledScheme(const char* new_scheme); // Returns true if the given scheme identified by |scheme| within |spec| is in // the list of allowed schemes for code cache (see AddCodeCacheEnabledScheme). COMPONENT_EXPORT(URL) bool IsCodeCacheEnabledScheme(const std::string& scheme); + +// Returns code cache enabled schemes list. +COMPONENT_EXPORT(URL) const std::vector& GetCodeCacheEnabledSchemes(); #endif // Adds a scheme with a predefined default handler.