OLD | NEW |
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 Loading... |
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 |
OLD | NEW |