| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "platform/weborigin/Referrer.h" | 33 #include "platform/weborigin/Referrer.h" |
| 34 #include "platform/weborigin/ReferrerPolicy.h" | 34 #include "platform/weborigin/ReferrerPolicy.h" |
| 35 #include "wtf/Allocator.h" | 35 #include "wtf/Allocator.h" |
| 36 #include "wtf/text/WTFString.h" | 36 #include "wtf/text/WTFString.h" |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 class KURL; | 40 class KURL; |
| 41 class SecurityOrigin; | 41 class SecurityOrigin; |
| 42 | 42 |
| 43 enum ReferrerPolicyLegacyKeywordsSupport { |
| 44 SupportReferrerPolicyLegacyKeywords, |
| 45 DoNotSupportReferrerPolicyLegacyKeywords, |
| 46 }; |
| 47 |
| 43 class PLATFORM_EXPORT SecurityPolicy { | 48 class PLATFORM_EXPORT SecurityPolicy { |
| 44 STATIC_ONLY(SecurityPolicy); | 49 STATIC_ONLY(SecurityPolicy); |
| 45 | 50 |
| 46 public: | 51 public: |
| 47 // This must be called during initialization (before we create | 52 // This must be called during initialization (before we create |
| 48 // other threads). | 53 // other threads). |
| 49 static void init(); | 54 static void init(); |
| 50 | 55 |
| 51 // True if the referrer should be omitted according to the | 56 // True if the referrer should be omitted according to the |
| 52 // ReferrerPolicyNoReferrerWhenDowngrade. If you intend to send a | 57 // ReferrerPolicyNoReferrerWhenDowngrade. If you intend to send a |
| (...skipping 21 matching lines...) Expand all Loading... |
| 74 static bool isAccessWhiteListed(const SecurityOrigin* activeOrigin, | 79 static bool isAccessWhiteListed(const SecurityOrigin* activeOrigin, |
| 75 const SecurityOrigin* targetOrigin); | 80 const SecurityOrigin* targetOrigin); |
| 76 static bool isAccessToURLWhiteListed(const SecurityOrigin* activeOrigin, | 81 static bool isAccessToURLWhiteListed(const SecurityOrigin* activeOrigin, |
| 77 const KURL&); | 82 const KURL&); |
| 78 | 83 |
| 79 static void addOriginTrustworthyWhiteList(PassRefPtr<SecurityOrigin>); | 84 static void addOriginTrustworthyWhiteList(PassRefPtr<SecurityOrigin>); |
| 80 static bool isOriginWhiteListedTrustworthy(const SecurityOrigin&); | 85 static bool isOriginWhiteListedTrustworthy(const SecurityOrigin&); |
| 81 static bool isUrlWhiteListedTrustworthy(const KURL&); | 86 static bool isUrlWhiteListedTrustworthy(const KURL&); |
| 82 | 87 |
| 83 static bool referrerPolicyFromString(const String& policy, | 88 static bool referrerPolicyFromString(const String& policy, |
| 89 ReferrerPolicyLegacyKeywordsSupport, |
| 84 ReferrerPolicy* result); | 90 ReferrerPolicy* result); |
| 85 static bool referrerPolicyFromStringWithLegacyKeywords( | 91 |
| 86 const String& policy, | 92 static bool referrerPolicyFromHeaderValue(const String& headerValue, |
| 87 ReferrerPolicy* result); | 93 ReferrerPolicyLegacyKeywordsSupport, |
| 94 ReferrerPolicy* result); |
| 88 }; | 95 }; |
| 89 | 96 |
| 90 } // namespace blink | 97 } // namespace blink |
| 91 | 98 |
| 92 #endif // SecurityPolicy_h | 99 #endif // SecurityPolicy_h |
| OLD | NEW |