| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 static bool shouldTreatURLSchemeAsFirstPartyWhenTopLevel( | 113 static bool shouldTreatURLSchemeAsFirstPartyWhenTopLevel( |
| 114 const String& scheme); | 114 const String& scheme); |
| 115 | 115 |
| 116 // Schemes that can be used in a referrer. | 116 // Schemes that can be used in a referrer. |
| 117 static void registerURLSchemeAsAllowedForReferrer(const String& scheme); | 117 static void registerURLSchemeAsAllowedForReferrer(const String& scheme); |
| 118 static void removeURLSchemeAsAllowedForReferrer(const String& scheme); | 118 static void removeURLSchemeAsAllowedForReferrer(const String& scheme); |
| 119 static bool shouldTreatURLSchemeAsAllowedForReferrer(const String& scheme); | 119 static bool shouldTreatURLSchemeAsAllowedForReferrer(const String& scheme); |
| 120 | 120 |
| 121 // Allow resources from some schemes to load on a page, regardless of its | 121 // Allow resources from some schemes to load on a page, regardless of its |
| 122 // Content Security Policy. | 122 // Content Security Policy. |
| 123 // This enum should be kept in sync with public/web/WebSecurityPolicy.h. | |
| 124 // Enforced in AssertMatchingEnums.cpp. | |
| 125 enum PolicyAreas : uint32_t { | 123 enum PolicyAreas : uint32_t { |
| 126 PolicyAreaNone = 0, | 124 PolicyAreaNone = 0, |
| 127 PolicyAreaImage = 1 << 0, | 125 PolicyAreaImage = 1 << 0, |
| 128 PolicyAreaStyle = 1 << 1, | 126 PolicyAreaStyle = 1 << 1, |
| 129 // Add more policy areas as needed by clients. | 127 // Add more policy areas as needed by clients. |
| 130 PolicyAreaAll = ~static_cast<uint32_t>(0), | 128 PolicyAreaAll = ~static_cast<uint32_t>(0), |
| 131 }; | 129 }; |
| 132 static void registerURLSchemeAsBypassingContentSecurityPolicy( | 130 static void registerURLSchemeAsBypassingContentSecurityPolicy( |
| 133 const String& scheme, | 131 const String& scheme, |
| 134 PolicyAreas = PolicyAreaAll); | 132 PolicyAreas = PolicyAreaAll); |
| 135 static void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy( | 133 static void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy( |
| 136 const String& scheme); | 134 const String& scheme); |
| 137 static bool schemeShouldBypassContentSecurityPolicy( | 135 static bool schemeShouldBypassContentSecurityPolicy( |
| 138 const String& scheme, | 136 const String& scheme, |
| 139 PolicyAreas = PolicyAreaAll); | 137 PolicyAreas = PolicyAreaAll); |
| 140 | 138 |
| 141 // Schemes which bypass Secure Context checks defined in | 139 // Schemes which bypass Secure Context checks defined in |
| 142 // https://w3c.github.io/webappsec/specs/powerfulfeatures/#is-origin-trustwort
hy. | 140 // https://w3c.github.io/webappsec/specs/powerfulfeatures/#is-origin-trustwort
hy. |
| 143 static void registerURLSchemeBypassingSecureContextCheck( | 141 static void registerURLSchemeBypassingSecureContextCheck( |
| 144 const String& scheme); | 142 const String& scheme); |
| 145 static bool schemeShouldBypassSecureContextCheck(const String& scheme); | 143 static bool schemeShouldBypassSecureContextCheck(const String& scheme); |
| 146 | 144 |
| 147 private: | 145 private: |
| 148 static const URLSchemesSet& localSchemes(); | 146 static const URLSchemesSet& localSchemes(); |
| 149 }; | 147 }; |
| 150 | 148 |
| 151 } // namespace blink | 149 } // namespace blink |
| 152 | 150 |
| 153 #endif // SchemeRegistry_h | 151 #endif // SchemeRegistry_h |
| OLD | NEW |