| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // Allow non-HTTP schemes to be registered to allow CORS requests. | 80 // Allow non-HTTP schemes to be registered to allow CORS requests. |
| 81 static void registerURLSchemeAsCORSEnabled(const String& scheme); | 81 static void registerURLSchemeAsCORSEnabled(const String& scheme); |
| 82 static bool shouldTreatURLSchemeAsCORSEnabled(const String& scheme); | 82 static bool shouldTreatURLSchemeAsCORSEnabled(const String& scheme); |
| 83 | 83 |
| 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. |
| 91 static void registerURLSchemeAsAllowingServiceWorkers(const String& scheme); |
| 92 static bool shouldTreatURLSchemeAsAllowingServiceWorkers(const String& schem
e); |
| 93 |
| 90 // Allow resources from some schemes to load on a page, regardless of its | 94 // Allow resources from some schemes to load on a page, regardless of its |
| 91 // Content Security Policy. | 95 // Content Security Policy. |
| 92 // This enum should be kept in sync with public/web/WebSecurityPolicy.h. | 96 // This enum should be kept in sync with public/web/WebSecurityPolicy.h. |
| 93 // Enforced in AssertMatchingEnums.cpp. | 97 // Enforced in AssertMatchingEnums.cpp. |
| 94 enum PolicyAreas : uint32_t { | 98 enum PolicyAreas : uint32_t { |
| 95 PolicyAreaNone = 0, | 99 PolicyAreaNone = 0, |
| 96 PolicyAreaImage = 1 << 0, | 100 PolicyAreaImage = 1 << 0, |
| 97 PolicyAreaStyle = 1 << 1, | 101 PolicyAreaStyle = 1 << 1, |
| 98 // Add more policy areas as needed by clients. | 102 // Add more policy areas as needed by clients. |
| 99 PolicyAreaAll = ~static_cast<uint32_t>(0), | 103 PolicyAreaAll = ~static_cast<uint32_t>(0), |
| 100 }; | 104 }; |
| 101 static void registerURLSchemeAsBypassingContentSecurityPolicy(const String&
scheme, PolicyAreas = PolicyAreaAll); | 105 static void registerURLSchemeAsBypassingContentSecurityPolicy(const String&
scheme, PolicyAreas = PolicyAreaAll); |
| 102 static void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const
String& scheme); | 106 static void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const
String& scheme); |
| 103 static bool schemeShouldBypassContentSecurityPolicy(const String& scheme, Po
licyAreas = PolicyAreaAll); | 107 static bool schemeShouldBypassContentSecurityPolicy(const String& scheme, Po
licyAreas = PolicyAreaAll); |
| 104 | 108 |
| 105 private: | 109 private: |
| 106 static const URLSchemesSet& localSchemes(); | 110 static const URLSchemesSet& localSchemes(); |
| 107 }; | 111 }; |
| 108 | 112 |
| 109 } // namespace blink | 113 } // namespace blink |
| 110 | 114 |
| 111 #endif // SchemeRegistry_h | 115 #endif // SchemeRegistry_h |
| OLD | NEW |