| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 } | 192 } |
| 193 | 193 |
| 194 void SecurityPolicy::addOriginTrustworthyWhiteList( | 194 void SecurityPolicy::addOriginTrustworthyWhiteList( |
| 195 PassRefPtr<SecurityOrigin> origin) { | 195 PassRefPtr<SecurityOrigin> origin) { |
| 196 #if DCHECK_IS_ON() | 196 #if DCHECK_IS_ON() |
| 197 // Must be called before we start other threads. | 197 // Must be called before we start other threads. |
| 198 DCHECK(WTF::isBeforeThreadCreated()); | 198 DCHECK(WTF::isBeforeThreadCreated()); |
| 199 #endif | 199 #endif |
| 200 if (origin->isUnique()) | 200 if (origin->isUnique()) |
| 201 return; | 201 return; |
| 202 trustworthyOriginSet().add(origin->toRawString()); | 202 trustworthyOriginSet().insert(origin->toRawString()); |
| 203 } | 203 } |
| 204 | 204 |
| 205 bool SecurityPolicy::isOriginWhiteListedTrustworthy( | 205 bool SecurityPolicy::isOriginWhiteListedTrustworthy( |
| 206 const SecurityOrigin& origin) { | 206 const SecurityOrigin& origin) { |
| 207 // Early return if there are no whitelisted origins to avoid unnecessary | 207 // Early return if there are no whitelisted origins to avoid unnecessary |
| 208 // allocations, copies, and frees. | 208 // allocations, copies, and frees. |
| 209 if (origin.isUnique() || trustworthyOriginSet().isEmpty()) | 209 if (origin.isUnique() || trustworthyOriginSet().isEmpty()) |
| 210 return false; | 210 return false; |
| 211 return trustworthyOriginSet().contains(origin.toRawString()); | 211 return trustworthyOriginSet().contains(origin.toRawString()); |
| 212 } | 212 } |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 } | 304 } |
| 305 | 305 |
| 306 bool SecurityPolicy::referrerPolicyFromStringWithLegacyKeywords( | 306 bool SecurityPolicy::referrerPolicyFromStringWithLegacyKeywords( |
| 307 const String& policy, | 307 const String& policy, |
| 308 ReferrerPolicy* result) { | 308 ReferrerPolicy* result) { |
| 309 return referrerPolicyFromStringImpl( | 309 return referrerPolicyFromStringImpl( |
| 310 policy, SupportReferrerPolicyLegacyKeywords, result); | 310 policy, SupportReferrerPolicyLegacyKeywords, result); |
| 311 } | 311 } |
| 312 | 312 |
| 313 } // namespace blink | 313 } // namespace blink |
| OLD | NEW |