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

Side by Side Diff: net/base/mime_util.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 | « net/base/mime_sniffer_unittest.cc ('k') | net/base/mime_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 5 #include <algorithm>
6 #include <iterator> 6 #include <iterator>
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "net/base/mime_util.h" 10 #include "net/base/mime_util.h"
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 codecs->push_back(proprietary_media_codecs[i]); 960 codecs->push_back(proprietary_media_codecs[i]);
961 #endif 961 #endif
962 } 962 }
963 963
964 const std::string GetIANAMediaType(const std::string& mime_type) { 964 const std::string GetIANAMediaType(const std::string& mime_type) {
965 for (size_t i = 0; i < arraysize(kIanaMediaTypes); ++i) { 965 for (size_t i = 0; i < arraysize(kIanaMediaTypes); ++i) {
966 if (StartsWithASCII(mime_type, kIanaMediaTypes[i].matcher, true)) { 966 if (StartsWithASCII(mime_type, kIanaMediaTypes[i].matcher, true)) {
967 return kIanaMediaTypes[i].name; 967 return kIanaMediaTypes[i].name;
968 } 968 }
969 } 969 }
970 return ""; 970 return std::string();
971 } 971 }
972 972
973 CertificateMimeType GetCertificateMimeTypeForMimeType( 973 CertificateMimeType GetCertificateMimeTypeForMimeType(
974 const std::string& mime_type) { 974 const std::string& mime_type) {
975 // Don't create a map, there is only one entry in the table, 975 // Don't create a map, there is only one entry in the table,
976 // except on Android. 976 // except on Android.
977 for (size_t i = 0; i < arraysize(supported_certificate_types); ++i) { 977 for (size_t i = 0; i < arraysize(supported_certificate_types); ++i) {
978 if (mime_type == net::supported_certificate_types[i].mime_type) 978 if (mime_type == net::supported_certificate_types[i].mime_type)
979 return net::supported_certificate_types[i].cert_type; 979 return net::supported_certificate_types[i].cert_type;
980 } 980 }
981 return CERTIFICATE_MIME_TYPE_UNKNOWN; 981 return CERTIFICATE_MIME_TYPE_UNKNOWN;
982 } 982 }
983 983
984 bool IsSupportedCertificateMimeType(const std::string& mime_type) { 984 bool IsSupportedCertificateMimeType(const std::string& mime_type) {
985 CertificateMimeType file_type = 985 CertificateMimeType file_type =
986 GetCertificateMimeTypeForMimeType(mime_type); 986 GetCertificateMimeTypeForMimeType(mime_type);
987 return file_type != CERTIFICATE_MIME_TYPE_UNKNOWN; 987 return file_type != CERTIFICATE_MIME_TYPE_UNKNOWN;
988 } 988 }
989 989
990 } // namespace net 990 } // namespace net
OLDNEW
« no previous file with comments | « net/base/mime_sniffer_unittest.cc ('k') | net/base/mime_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698