OLD | NEW |
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 #ifndef NET_BASE_MIME_UTIL_H__ | 5 #ifndef NET_BASE_MIME_UTIL_H__ |
6 #define NET_BASE_MIME_UTIL_H__ | 6 #define NET_BASE_MIME_UTIL_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 NET_EXPORT void GetExtensionsForMimeType( | 133 NET_EXPORT void GetExtensionsForMimeType( |
134 const std::string& mime_type, | 134 const std::string& mime_type, |
135 std::vector<base::FilePath::StringType>* extensions); | 135 std::vector<base::FilePath::StringType>* extensions); |
136 | 136 |
137 // Test only method that removes proprietary media types and codecs from the | 137 // Test only method that removes proprietary media types and codecs from the |
138 // list of supported MIME types and codecs. These types and codecs must be | 138 // list of supported MIME types and codecs. These types and codecs must be |
139 // removed to ensure consistent layout test results across all Chromium | 139 // removed to ensure consistent layout test results across all Chromium |
140 // variations. | 140 // variations. |
141 NET_EXPORT void RemoveProprietaryMediaTypesAndCodecsForTests(); | 141 NET_EXPORT void RemoveProprietaryMediaTypesAndCodecsForTests(); |
142 | 142 |
143 // Returns the IANA media type contained in |mime_type|, or an empty | |
144 // string if |mime_type| does not specifify a known media type. | |
145 // Supported media types are defined at: | |
146 // http://www.iana.org/assignments/media-types/index.html | |
147 NET_EXPORT const std::string GetIANAMediaType(const std::string& mime_type); | |
148 | |
149 // A list of supported certificate-related mime types. | 143 // A list of supported certificate-related mime types. |
150 // | 144 // |
151 // A Java counterpart will be generated for this enum. | 145 // A Java counterpart will be generated for this enum. |
152 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net | 146 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net |
153 enum CertificateMimeType { | 147 enum CertificateMimeType { |
154 CERTIFICATE_MIME_TYPE_UNKNOWN, | 148 CERTIFICATE_MIME_TYPE_UNKNOWN, |
155 CERTIFICATE_MIME_TYPE_X509_USER_CERT, | 149 CERTIFICATE_MIME_TYPE_X509_USER_CERT, |
156 CERTIFICATE_MIME_TYPE_X509_CA_CERT, | 150 CERTIFICATE_MIME_TYPE_X509_CA_CERT, |
157 CERTIFICATE_MIME_TYPE_PKCS12_ARCHIVE, | 151 CERTIFICATE_MIME_TYPE_PKCS12_ARCHIVE, |
158 }; | 152 }; |
159 | 153 |
160 NET_EXPORT CertificateMimeType GetCertificateMimeTypeForMimeType( | 154 NET_EXPORT CertificateMimeType GetCertificateMimeTypeForMimeType( |
161 const std::string& mime_type); | 155 const std::string& mime_type); |
162 | 156 |
163 // Prepares one value as part of a multi-part upload request. | 157 // Prepares one value as part of a multi-part upload request. |
164 NET_EXPORT void AddMultipartValueForUpload(const std::string& value_name, | 158 NET_EXPORT void AddMultipartValueForUpload(const std::string& value_name, |
165 const std::string& value, | 159 const std::string& value, |
166 const std::string& mime_boundary, | 160 const std::string& mime_boundary, |
167 const std::string& content_type, | 161 const std::string& content_type, |
168 std::string* post_data); | 162 std::string* post_data); |
169 | 163 |
170 // Adds the final delimiter to a multi-part upload request. | 164 // Adds the final delimiter to a multi-part upload request. |
171 NET_EXPORT void AddMultipartFinalDelimiterForUpload( | 165 NET_EXPORT void AddMultipartFinalDelimiterForUpload( |
172 const std::string& mime_boundary, | 166 const std::string& mime_boundary, |
173 std::string* post_data); | 167 std::string* post_data); |
174 | 168 |
175 } // namespace net | 169 } // namespace net |
176 | 170 |
177 #endif // NET_BASE_MIME_UTIL_H__ | 171 #endif // NET_BASE_MIME_UTIL_H__ |
OLD | NEW |