Replace AddCustomScheme bool arguments with int using bit flags

This commit is contained in:
Alexander Guettler
2019-02-26 16:45:12 +00:00
committed by Marshall Greenblatt
parent ba8b4e8b9d
commit c72d57aa60
12 changed files with 124 additions and 184 deletions

View File

@@ -21,18 +21,12 @@ void AppendArray(const std::vector<std::string>& source,
return;
target->insert(target->end(), source.begin(), source.end());
}
}
} // namespace
CefSchemeRegistrarImpl::CefSchemeRegistrarImpl() {}
bool CefSchemeRegistrarImpl::AddCustomScheme(const CefString& scheme_name,
bool is_standard,
bool is_local,
bool is_display_isolated,
bool is_secure,
bool is_cors_enabled,
bool is_csp_bypassing,
bool is_fetch_enabled) {
int options) {
const std::string& scheme = base::ToLowerASCII(scheme_name.ToString());
if (scheme::IsInternalHandledScheme(scheme) ||
registered_schemes_.find(scheme) != registered_schemes_.end()) {
@@ -41,6 +35,14 @@ bool CefSchemeRegistrarImpl::AddCustomScheme(const CefString& scheme_name,
registered_schemes_.insert(scheme);
const bool is_standard = options & CEF_SCHEME_OPTION_STANDARD;
const bool is_local = options & CEF_SCHEME_OPTION_LOCAL;
const bool is_display_isolated = options & CEF_SCHEME_OPTION_DISPLAY_ISOLATED;
const bool is_secure = options & CEF_SCHEME_OPTION_SECURE;
const bool is_cors_enabled = options & CEF_SCHEME_OPTION_CORS_ENABLED;
const bool is_csp_bypassing = options & CEF_SCHEME_OPTION_CSP_BYPASSING;
const bool is_fetch_enabled = options & CEF_SCHEME_OPTION_FETCH_ENABLED;
// The |is_display_isolated| value is excluded here because it's registered
// with Blink only.
if (is_standard)