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( |