| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 bool forbidden, | 177 bool forbidden, |
| 178 const String& scheme) { | 178 const String& scheme) { |
| 179 DCHECK_EQ(scheme, scheme.lower()); | 179 DCHECK_EQ(scheme, scheme.lower()); |
| 180 if (scheme.isEmpty()) | 180 if (scheme.isEmpty()) |
| 181 return; | 181 return; |
| 182 | 182 |
| 183 if (forbidden) { | 183 if (forbidden) { |
| 184 getMutableURLSchemesRegistry().schemesForbiddenFromDomainRelaxation.insert( | 184 getMutableURLSchemesRegistry().schemesForbiddenFromDomainRelaxation.insert( |
| 185 scheme); | 185 scheme); |
| 186 } else { | 186 } else { |
| 187 getMutableURLSchemesRegistry().schemesForbiddenFromDomainRelaxation.remove( | 187 getMutableURLSchemesRegistry().schemesForbiddenFromDomainRelaxation.erase( |
| 188 scheme); | 188 scheme); |
| 189 } | 189 } |
| 190 } | 190 } |
| 191 | 191 |
| 192 bool SchemeRegistry::isDomainRelaxationForbiddenForURLScheme( | 192 bool SchemeRegistry::isDomainRelaxationForbiddenForURLScheme( |
| 193 const String& scheme) { | 193 const String& scheme) { |
| 194 DCHECK_EQ(scheme, scheme.lower()); | 194 DCHECK_EQ(scheme, scheme.lower()); |
| 195 if (scheme.isEmpty()) | 195 if (scheme.isEmpty()) |
| 196 return false; | 196 return false; |
| 197 return getURLSchemesRegistry().schemesForbiddenFromDomainRelaxation.contains( | 197 return getURLSchemesRegistry().schemesForbiddenFromDomainRelaxation.contains( |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 | 291 |
| 292 void SchemeRegistry::registerURLSchemeAsFirstPartyWhenTopLevel( | 292 void SchemeRegistry::registerURLSchemeAsFirstPartyWhenTopLevel( |
| 293 const String& scheme) { | 293 const String& scheme) { |
| 294 DCHECK_EQ(scheme, scheme.lower()); | 294 DCHECK_EQ(scheme, scheme.lower()); |
| 295 getMutableURLSchemesRegistry().firstPartyWhenTopLevelSchemes.insert(scheme); | 295 getMutableURLSchemesRegistry().firstPartyWhenTopLevelSchemes.insert(scheme); |
| 296 } | 296 } |
| 297 | 297 |
| 298 void SchemeRegistry::removeURLSchemeAsFirstPartyWhenTopLevel( | 298 void SchemeRegistry::removeURLSchemeAsFirstPartyWhenTopLevel( |
| 299 const String& scheme) { | 299 const String& scheme) { |
| 300 DCHECK_EQ(scheme, scheme.lower()); | 300 DCHECK_EQ(scheme, scheme.lower()); |
| 301 getMutableURLSchemesRegistry().firstPartyWhenTopLevelSchemes.remove(scheme); | 301 getMutableURLSchemesRegistry().firstPartyWhenTopLevelSchemes.erase(scheme); |
| 302 } | 302 } |
| 303 | 303 |
| 304 bool SchemeRegistry::shouldTreatURLSchemeAsFirstPartyWhenTopLevel( | 304 bool SchemeRegistry::shouldTreatURLSchemeAsFirstPartyWhenTopLevel( |
| 305 const String& scheme) { | 305 const String& scheme) { |
| 306 DCHECK_EQ(scheme, scheme.lower()); | 306 DCHECK_EQ(scheme, scheme.lower()); |
| 307 if (scheme.isEmpty()) | 307 if (scheme.isEmpty()) |
| 308 return false; | 308 return false; |
| 309 return getURLSchemesRegistry().firstPartyWhenTopLevelSchemes.contains(scheme); | 309 return getURLSchemesRegistry().firstPartyWhenTopLevelSchemes.contains(scheme); |
| 310 } | 310 } |
| 311 | 311 |
| 312 void SchemeRegistry::registerURLSchemeAsAllowedForReferrer( | 312 void SchemeRegistry::registerURLSchemeAsAllowedForReferrer( |
| 313 const String& scheme) { | 313 const String& scheme) { |
| 314 DCHECK_EQ(scheme, scheme.lower()); | 314 DCHECK_EQ(scheme, scheme.lower()); |
| 315 getMutableURLSchemesRegistry().allowedInReferrerSchemes.insert(scheme); | 315 getMutableURLSchemesRegistry().allowedInReferrerSchemes.insert(scheme); |
| 316 } | 316 } |
| 317 | 317 |
| 318 void SchemeRegistry::removeURLSchemeAsAllowedForReferrer(const String& scheme) { | 318 void SchemeRegistry::removeURLSchemeAsAllowedForReferrer(const String& scheme) { |
| 319 getMutableURLSchemesRegistry().allowedInReferrerSchemes.remove(scheme); | 319 getMutableURLSchemesRegistry().allowedInReferrerSchemes.erase(scheme); |
| 320 } | 320 } |
| 321 | 321 |
| 322 bool SchemeRegistry::shouldTreatURLSchemeAsAllowedForReferrer( | 322 bool SchemeRegistry::shouldTreatURLSchemeAsAllowedForReferrer( |
| 323 const String& scheme) { | 323 const String& scheme) { |
| 324 DCHECK_EQ(scheme, scheme.lower()); | 324 DCHECK_EQ(scheme, scheme.lower()); |
| 325 if (scheme.isEmpty()) | 325 if (scheme.isEmpty()) |
| 326 return false; | 326 return false; |
| 327 return getURLSchemesRegistry().allowedInReferrerSchemes.contains(scheme); | 327 return getURLSchemesRegistry().allowedInReferrerSchemes.contains(scheme); |
| 328 } | 328 } |
| 329 | 329 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 364 |
| 365 bool SchemeRegistry::schemeShouldBypassSecureContextCheck( | 365 bool SchemeRegistry::schemeShouldBypassSecureContextCheck( |
| 366 const String& scheme) { | 366 const String& scheme) { |
| 367 if (scheme.isEmpty()) | 367 if (scheme.isEmpty()) |
| 368 return false; | 368 return false; |
| 369 DCHECK_EQ(scheme, scheme.lower()); | 369 DCHECK_EQ(scheme, scheme.lower()); |
| 370 return getURLSchemesRegistry().secureContextBypassingSchemes.contains(scheme); | 370 return getURLSchemesRegistry().secureContextBypassingSchemes.contains(scheme); |
| 371 } | 371 } |
| 372 | 372 |
| 373 } // namespace blink | 373 } // namespace blink |
| OLD | NEW |