OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 28 matching lines...) Expand all Loading... |
39 | 39 |
40 // Convenience function. | 40 // Convenience function. |
41 bool IsSupportedMimeType(const std::string& mime_type); | 41 bool IsSupportedMimeType(const std::string& mime_type); |
42 | 42 |
43 // Returns true if this the mime_type_pattern matches a given mime-type. | 43 // Returns true if this the mime_type_pattern matches a given mime-type. |
44 // Checks for absolute matching and wildcards. mime-types should be in | 44 // Checks for absolute matching and wildcards. mime-types should be in |
45 // lower case. | 45 // lower case. |
46 bool MatchesMimeType(const std::string &mime_type_pattern, | 46 bool MatchesMimeType(const std::string &mime_type_pattern, |
47 const std::string &mime_type); | 47 const std::string &mime_type); |
48 | 48 |
| 49 // Returns true if and only if all codecs are supported, false otherwise. |
| 50 bool AreSupportedMediaCodecs(const std::vector<std::string>& codecs); |
| 51 |
49 // Parses a codec string, populating |codecs_out| with the prefix of each codec | 52 // Parses a codec string, populating |codecs_out| with the prefix of each codec |
50 // in the string |codecs_in|. For example, passed "aaa.b.c,dd.eee", |codecs_out| | 53 // in the string |codecs_in|. For example, passed "aaa.b.c,dd.eee", |codecs_out| |
51 // will contain {"aaa", "dd"}. | 54 // will contain {"aaa", "dd"}. |
52 // See http://www.ietf.org/rfc/rfc4281.txt. | 55 // See http://www.ietf.org/rfc/rfc4281.txt. |
53 void ParseCodecString(const std::string& codecs, | 56 void ParseCodecString(const std::string& codecs, |
54 std::vector<std::string>* codecs_out); | 57 std::vector<std::string>* codecs_out); |
55 | 58 |
56 } // namespace net | 59 } // namespace net |
57 | 60 |
58 #endif // NET_BASE_MIME_UTIL_H__ | 61 #endif // NET_BASE_MIME_UTIL_H__ |
OLD | NEW |