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: third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp

Issue 2709033003: Migrate WTF::HashMap::get() to ::at() (Closed)
Patch Set: rebase Created 3 years, 10 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
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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 344
345 bool SchemeRegistry::schemeShouldBypassContentSecurityPolicy( 345 bool SchemeRegistry::schemeShouldBypassContentSecurityPolicy(
346 const String& scheme, 346 const String& scheme,
347 PolicyAreas policyAreas) { 347 PolicyAreas policyAreas) {
348 ASSERT(policyAreas != PolicyAreaNone); 348 ASSERT(policyAreas != PolicyAreaNone);
349 if (scheme.isEmpty() || policyAreas == PolicyAreaNone) 349 if (scheme.isEmpty() || policyAreas == PolicyAreaNone)
350 return false; 350 return false;
351 351
352 // get() returns 0 (PolicyAreaNone) if there is no entry in the map. 352 // get() returns 0 (PolicyAreaNone) if there is no entry in the map.
353 // Thus by default, schemes do not bypass CSP. 353 // Thus by default, schemes do not bypass CSP.
354 return (getURLSchemesRegistry().contentSecurityPolicyBypassingSchemes.get( 354 return (getURLSchemesRegistry().contentSecurityPolicyBypassingSchemes.at(
355 scheme) & 355 scheme) &
356 policyAreas) == policyAreas; 356 policyAreas) == policyAreas;
357 } 357 }
358 358
359 void SchemeRegistry::registerURLSchemeBypassingSecureContextCheck( 359 void SchemeRegistry::registerURLSchemeBypassingSecureContextCheck(
360 const String& scheme) { 360 const String& scheme) {
361 DCHECK_EQ(scheme, scheme.lower()); 361 DCHECK_EQ(scheme, scheme.lower());
362 getMutableURLSchemesRegistry().secureContextBypassingSchemes.insert(scheme); 362 getMutableURLSchemesRegistry().secureContextBypassingSchemes.insert(scheme);
363 } 363 }
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698