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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 // Get the extensions associated with the given mime type. This should be passed | 88 // Get the extensions associated with the given mime type. This should be passed |
89 // in lower case. There could be multiple extensions for a given mime type, like | 89 // in lower case. There could be multiple extensions for a given mime type, like |
90 // "html,htm" for "text/html", or "txt,text,html,..." for "text/*". | 90 // "html,htm" for "text/html", or "txt,text,html,..." for "text/*". |
91 // Note that we do not erase the existing elements in the the provided vector. | 91 // Note that we do not erase the existing elements in the the provided vector. |
92 // Instead, we append the result to it. | 92 // Instead, we append the result to it. |
93 NET_EXPORT void GetExtensionsForMimeType( | 93 NET_EXPORT void GetExtensionsForMimeType( |
94 const std::string& mime_type, | 94 const std::string& mime_type, |
95 std::vector<base::FilePath::StringType>* extensions); | 95 std::vector<base::FilePath::StringType>* extensions); |
96 | 96 |
97 // Test only methods that return lists of proprietary media types and codecs | |
98 // that are not supported by all variations of Chromium. | |
99 // These types and codecs must be blacklisted to ensure consistent layout test | |
100 // results across all Chromium variations. | |
101 NET_EXPORT void GetMediaTypesBlacklistedForTests( | |
102 std::vector<std::string>* types); | |
103 NET_EXPORT void GetMediaCodecsBlacklistedForTests( | |
104 std::vector<std::string>* codecs); | |
105 | |
106 // Returns the IANA media type contained in |mime_type|, or an empty | 97 // Returns the IANA media type contained in |mime_type|, or an empty |
107 // string if |mime_type| does not specifify a known media type. | 98 // string if |mime_type| does not specifify a known media type. |
108 // Supported media types are defined at: | 99 // Supported media types are defined at: |
109 // http://www.iana.org/assignments/media-types/index.html | 100 // http://www.iana.org/assignments/media-types/index.html |
110 NET_EXPORT const std::string GetIANAMediaType(const std::string& mime_type); | 101 NET_EXPORT const std::string GetIANAMediaType(const std::string& mime_type); |
111 | 102 |
112 // A list of supported certificate-related mime types. | 103 // A list of supported certificate-related mime types. |
113 enum CertificateMimeType { | 104 enum CertificateMimeType { |
114 #define CERTIFICATE_MIME_TYPE(name, value) CERTIFICATE_MIME_TYPE_ ## name = valu
e, | 105 #define CERTIFICATE_MIME_TYPE(name, value) CERTIFICATE_MIME_TYPE_ ## name = valu
e, |
115 #include "net/base/mime_util_certificate_type_list.h" | 106 #include "net/base/mime_util_certificate_type_list.h" |
(...skipping 11 matching lines...) Expand all Loading... |
127 std::string* post_data); | 118 std::string* post_data); |
128 | 119 |
129 // Adds the final delimiter to a multi-part upload request. | 120 // Adds the final delimiter to a multi-part upload request. |
130 NET_EXPORT void AddMultipartFinalDelimiterForUpload( | 121 NET_EXPORT void AddMultipartFinalDelimiterForUpload( |
131 const std::string& mime_boundary, | 122 const std::string& mime_boundary, |
132 std::string* post_data); | 123 std::string* post_data); |
133 | 124 |
134 } // namespace net | 125 } // namespace net |
135 | 126 |
136 #endif // NET_BASE_MIME_UTIL_H__ | 127 #endif // NET_BASE_MIME_UTIL_H__ |
OLD | NEW |