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

Side by Side Diff: components/mime_util/mime_util.cc

Issue 1224553010: Replace base::str[n]casecmp with helper functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/mime_util/mime_util.h" 5 #include "components/mime_util/mime_util.h"
6 6
7 #include "base/containers/hash_tables.h" 7 #include "base/containers/hash_tables.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 214
215 bool IsSupportedMimeType(const std::string& mime_type) { 215 bool IsSupportedMimeType(const std::string& mime_type) {
216 return g_mime_util.Get().IsSupportedMimeType(mime_type); 216 return g_mime_util.Get().IsSupportedMimeType(mime_type);
217 } 217 }
218 218
219 net::CertificateMimeType GetCertificateMimeTypeForMimeType( 219 net::CertificateMimeType GetCertificateMimeTypeForMimeType(
220 const std::string& mime_type) { 220 const std::string& mime_type) {
221 // Don't create a map, there is only one entry in the table, 221 // Don't create a map, there is only one entry in the table,
222 // except on Android. 222 // except on Android.
223 for (size_t i = 0; i < arraysize(kSupportedCertificateTypes); ++i) { 223 for (size_t i = 0; i < arraysize(kSupportedCertificateTypes); ++i) {
224 if (base::strcasecmp(mime_type.c_str(), 224 if (base::EqualsCaseInsensitiveASCII(
225 kSupportedCertificateTypes[i].mime_type) == 0) { 225 mime_type, kSupportedCertificateTypes[i].mime_type)) {
226 return kSupportedCertificateTypes[i].cert_type; 226 return kSupportedCertificateTypes[i].cert_type;
227 } 227 }
228 } 228 }
229 229
230 return net::CERTIFICATE_MIME_TYPE_UNKNOWN; 230 return net::CERTIFICATE_MIME_TYPE_UNKNOWN;
231 } 231 }
232 232
233 } // namespace mime_util 233 } // namespace mime_util
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/performance_logger.cc ('k') | components/policy/core/common/registry_dict_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698