Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: Source/platform/weborigin/SchemeRegistry.cpp

Issue 482753002: Use StringBuilder::appendLiteral() / StringBuilder::append(char) when possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/platform/text/PlatformLocale.cpp ('k') | Source/web/WebPageSerializerImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/platform/text/PlatformLocale.cpp ('k') | Source/web/WebPageSerializerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698