| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // Serialize the registered schemes in a comma-separated list. | 84 // Serialize the registered schemes in a comma-separated list. |
| 85 static String listOfCORSEnabledURLSchemes(); | 85 static String listOfCORSEnabledURLSchemes(); |
| 86 | 86 |
| 87 // "Legacy" schemes (e.g. 'ftp:', 'gopher:') which we might want to treat di
fferently from "webby" schemes. | 87 // "Legacy" schemes (e.g. 'ftp:', 'gopher:') which we might want to treat di
fferently from "webby" schemes. |
| 88 static bool shouldTreatURLSchemeAsLegacy(const String& scheme); | 88 static bool shouldTreatURLSchemeAsLegacy(const String& scheme); |
| 89 | 89 |
| 90 // Schemes that can register a service worker. | 90 // Schemes that can register a service worker. |
| 91 static void registerURLSchemeAsAllowingServiceWorkers(const String& scheme); | 91 static void registerURLSchemeAsAllowingServiceWorkers(const String& scheme); |
| 92 static bool shouldTreatURLSchemeAsAllowingServiceWorkers(const String& schem
e); | 92 static bool shouldTreatURLSchemeAsAllowingServiceWorkers(const String& schem
e); |
| 93 | 93 |
| 94 // HTTP-like schemes that are treated as supporting the Fetch API. |
| 95 static void registerURLSchemeAsSupportingFetchAPI(const String& scheme); |
| 96 static bool shouldTreatURLSchemeAsSupportingFetchAPI(const String& scheme); |
| 97 |
| 94 // Allow resources from some schemes to load on a page, regardless of its | 98 // Allow resources from some schemes to load on a page, regardless of its |
| 95 // Content Security Policy. | 99 // Content Security Policy. |
| 96 // This enum should be kept in sync with public/web/WebSecurityPolicy.h. | 100 // This enum should be kept in sync with public/web/WebSecurityPolicy.h. |
| 97 // Enforced in AssertMatchingEnums.cpp. | 101 // Enforced in AssertMatchingEnums.cpp. |
| 98 enum PolicyAreas : uint32_t { | 102 enum PolicyAreas : uint32_t { |
| 99 PolicyAreaNone = 0, | 103 PolicyAreaNone = 0, |
| 100 PolicyAreaImage = 1 << 0, | 104 PolicyAreaImage = 1 << 0, |
| 101 PolicyAreaStyle = 1 << 1, | 105 PolicyAreaStyle = 1 << 1, |
| 102 // Add more policy areas as needed by clients. | 106 // Add more policy areas as needed by clients. |
| 103 PolicyAreaAll = ~static_cast<uint32_t>(0), | 107 PolicyAreaAll = ~static_cast<uint32_t>(0), |
| 104 }; | 108 }; |
| 105 static void registerURLSchemeAsBypassingContentSecurityPolicy(const String&
scheme, PolicyAreas = PolicyAreaAll); | 109 static void registerURLSchemeAsBypassingContentSecurityPolicy(const String&
scheme, PolicyAreas = PolicyAreaAll); |
| 106 static void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const
String& scheme); | 110 static void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const
String& scheme); |
| 107 static bool schemeShouldBypassContentSecurityPolicy(const String& scheme, Po
licyAreas = PolicyAreaAll); | 111 static bool schemeShouldBypassContentSecurityPolicy(const String& scheme, Po
licyAreas = PolicyAreaAll); |
| 108 | 112 |
| 109 private: | 113 private: |
| 110 static const URLSchemesSet& localSchemes(); | 114 static const URLSchemesSet& localSchemes(); |
| 111 }; | 115 }; |
| 112 | 116 |
| 113 } // namespace blink | 117 } // namespace blink |
| 114 | 118 |
| 115 #endif // SchemeRegistry_h | 119 #endif // SchemeRegistry_h |
| OLD | NEW |