| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // Registers a URL scheme to not generate mixed content warnings when | 60 // Registers a URL scheme to not generate mixed content warnings when |
| 61 // included by an HTTPS page. | 61 // included by an HTTPS page. |
| 62 BLINK_EXPORT static void registerURLSchemeAsSecure(const WebString&); | 62 BLINK_EXPORT static void registerURLSchemeAsSecure(const WebString&); |
| 63 | 63 |
| 64 // Registers a non-HTTP URL scheme which can be sent CORS requests. | 64 // Registers a non-HTTP URL scheme which can be sent CORS requests. |
| 65 BLINK_EXPORT static void registerURLSchemeAsCORSEnabled(const WebString&); | 65 BLINK_EXPORT static void registerURLSchemeAsCORSEnabled(const WebString&); |
| 66 | 66 |
| 67 // Registers a URL scheme whose resources can be loaded regardless of a page
's Content Security Policy. | 67 // Registers a URL scheme whose resources can be loaded regardless of a page
's Content Security Policy. |
| 68 BLINK_EXPORT static void registerURLSchemeAsBypassingContentSecurityPolicy(c
onst WebString&); | 68 BLINK_EXPORT static void registerURLSchemeAsBypassingContentSecurityPolicy(c
onst WebString&); |
| 69 | 69 |
| 70 // Registers a URL scheme for which some kinds of resources bypass Content S
ecurity Policy. |
| 71 // This enum should be kept in sync with Source/platform/weborigin/SchemeReg
istry.h. |
| 72 enum PolicyAreas : uint32_t { |
| 73 PolicyAreaNone = 0, |
| 74 PolicyAreaImage = 1 << 0, |
| 75 PolicyAreaStyle = 1 << 1, |
| 76 // Add more policy areas as needed by clients. |
| 77 PolicyAreaAll = ~static_cast<uint32_t>(0), |
| 78 }; |
| 79 BLINK_EXPORT static void registerURLSchemeAsBypassingContentSecurityPolicy(c
onst WebString& scheme, PolicyAreas); |
| 80 |
| 70 // Registers a URL scheme as strictly empty documents, allowing them to | 81 // Registers a URL scheme as strictly empty documents, allowing them to |
| 71 // commit synchronously. | 82 // commit synchronously. |
| 72 BLINK_EXPORT static void registerURLSchemeAsEmptyDocument(const WebString&); | 83 BLINK_EXPORT static void registerURLSchemeAsEmptyDocument(const WebString&); |
| 73 | 84 |
| 74 // Support for whitelisting access to origins beyond the same-origin policy. | 85 // Support for whitelisting access to origins beyond the same-origin policy. |
| 75 BLINK_EXPORT static void addOriginAccessWhitelistEntry( | 86 BLINK_EXPORT static void addOriginAccessWhitelistEntry( |
| 76 const WebURL& sourceOrigin, const WebString& destinationProtocol, | 87 const WebURL& sourceOrigin, const WebString& destinationProtocol, |
| 77 const WebString& destinationHost, bool allowDestinationSubdomains); | 88 const WebString& destinationHost, bool allowDestinationSubdomains); |
| 78 BLINK_EXPORT static void removeOriginAccessWhitelistEntry( | 89 BLINK_EXPORT static void removeOriginAccessWhitelistEntry( |
| 79 const WebURL& sourceOrigin, const WebString& destinationProtocol, | 90 const WebURL& sourceOrigin, const WebString& destinationProtocol, |
| 80 const WebString& destinationHost, bool allowDestinationSubdomains); | 91 const WebString& destinationHost, bool allowDestinationSubdomains); |
| 81 BLINK_EXPORT static void resetOriginAccessWhitelists(); | 92 BLINK_EXPORT static void resetOriginAccessWhitelists(); |
| 82 | 93 |
| 83 // Returns the referrer modified according to the referrer policy for a | 94 // Returns the referrer modified according to the referrer policy for a |
| 84 // navigation to a given URL. If the referrer returned is empty, the | 95 // navigation to a given URL. If the referrer returned is empty, the |
| 85 // referrer header should be omitted. | 96 // referrer header should be omitted. |
| 86 BLINK_EXPORT static WebString generateReferrerHeader(WebReferrerPolicy, cons
t WebURL&, const WebString& referrer); | 97 BLINK_EXPORT static WebString generateReferrerHeader(WebReferrerPolicy, cons
t WebURL&, const WebString& referrer); |
| 87 | 98 |
| 88 // Registers an URL scheme to not allow manipulation of the loaded page | 99 // Registers an URL scheme to not allow manipulation of the loaded page |
| 89 // by bookmarklets or javascript: URLs typed in the omnibox. | 100 // by bookmarklets or javascript: URLs typed in the omnibox. |
| 90 BLINK_EXPORT static void registerURLSchemeAsNotAllowingJavascriptURLs(const
WebString&); | 101 BLINK_EXPORT static void registerURLSchemeAsNotAllowingJavascriptURLs(const
WebString&); |
| 91 | 102 |
| 92 private: | 103 private: |
| 93 WebSecurityPolicy(); | 104 WebSecurityPolicy(); |
| 94 }; | 105 }; |
| 95 | 106 |
| 96 } // namespace blink | 107 } // namespace blink |
| 97 | 108 |
| 98 #endif | 109 #endif |
| OLD | NEW |