Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(585)

Unified Diff: third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp

Issue 2687923002: WTF: Support enums in DefaultHash and HashTraits by casting to integral types. (Closed)
Patch Set: . Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/HashFunctions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp
diff --git a/third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp b/third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp
index 5fc77fc2607aec95e1f3626145ca1ebe889e8bd9..07f9bb0bb1c2346f5f16c958293d3c122ddea5cf 100644
--- a/third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp
+++ b/third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp
@@ -351,9 +351,12 @@ bool SchemeRegistry::schemeShouldBypassContentSecurityPolicy(
// get() returns 0 (PolicyAreaNone) if there is no entry in the map.
// Thus by default, schemes do not bypass CSP.
- return (getURLSchemesRegistry().contentSecurityPolicyBypassingSchemes.get(
- scheme) &
- policyAreas) == policyAreas;
+ const auto& schemes =
+ getURLSchemesRegistry().contentSecurityPolicyBypassingSchemes;
+ auto it = schemes.find(scheme);
+ PolicyAreas allowedPolicyAreas =
+ (it == schemes.end() ? PolicyAreaNone : it->value);
+ return !(policyAreas & ~allowedPolicyAreas);
}
void SchemeRegistry::registerURLSchemeBypassingSecureContextCheck(
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/HashFunctions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698