| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 } | 258 } |
| 259 | 259 |
| 260 String SchemeRegistry::listOfCORSEnabledURLSchemes() | 260 String SchemeRegistry::listOfCORSEnabledURLSchemes() |
| 261 { | 261 { |
| 262 StringBuilder builder; | 262 StringBuilder builder; |
| 263 const URLSchemesMap& corsEnabledSchemes = CORSEnabledSchemes(); | 263 const URLSchemesMap& corsEnabledSchemes = CORSEnabledSchemes(); |
| 264 | 264 |
| 265 bool addSeparator = false; | 265 bool addSeparator = false; |
| 266 for (URLSchemesMap::const_iterator it = corsEnabledSchemes.begin(); it != co
rsEnabledSchemes.end(); ++it) { | 266 for (URLSchemesMap::const_iterator it = corsEnabledSchemes.begin(); it != co
rsEnabledSchemes.end(); ++it) { |
| 267 if (addSeparator) | 267 if (addSeparator) |
| 268 builder.append(", "); | 268 builder.appendLiteral(", "); |
| 269 else | 269 else |
| 270 addSeparator = true; | 270 addSeparator = true; |
| 271 | 271 |
| 272 builder.append(*it); | 272 builder.append(*it); |
| 273 } | 273 } |
| 274 return builder.toString(); | 274 return builder.toString(); |
| 275 } | 275 } |
| 276 | 276 |
| 277 void SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy(const Str
ing& scheme) | 277 void SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy(const Str
ing& scheme) |
| 278 { | 278 { |
| 279 ContentSecurityPolicyBypassingSchemes().add(scheme); | 279 ContentSecurityPolicyBypassingSchemes().add(scheme); |
| 280 } | 280 } |
| 281 | 281 |
| 282 void SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(c
onst String& scheme) | 282 void SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(c
onst String& scheme) |
| 283 { | 283 { |
| 284 ContentSecurityPolicyBypassingSchemes().remove(scheme); | 284 ContentSecurityPolicyBypassingSchemes().remove(scheme); |
| 285 } | 285 } |
| 286 | 286 |
| 287 bool SchemeRegistry::schemeShouldBypassContentSecurityPolicy(const String& schem
e) | 287 bool SchemeRegistry::schemeShouldBypassContentSecurityPolicy(const String& schem
e) |
| 288 { | 288 { |
| 289 if (scheme.isEmpty()) | 289 if (scheme.isEmpty()) |
| 290 return false; | 290 return false; |
| 291 return ContentSecurityPolicyBypassingSchemes().contains(scheme); | 291 return ContentSecurityPolicyBypassingSchemes().contains(scheme); |
| 292 } | 292 } |
| 293 | 293 |
| 294 } // namespace blink | 294 } // namespace blink |
| OLD | NEW |