Chromium Code Reviews| Index: net/base/mime_util.h |
| diff --git a/net/base/mime_util.h b/net/base/mime_util.h |
| index 9662e9656e397de2d48adedbfae590a3249ff4a7..9fb26184606caedaecd1e5a9d69d566d33ba13c9 100644 |
| --- a/net/base/mime_util.h |
| +++ b/net/base/mime_util.h |
| @@ -55,10 +55,26 @@ NET_EXPORT bool IsSupportedMimeType(const std::string& mime_type); |
| NET_EXPORT bool MatchesMimeType(const std::string& mime_type_pattern, |
| const std::string& mime_type); |
| -// Returns true if the |type_string| is a correctly-formed mime type specifier. |
| -// Allows strings of the form x/y[;params], where "x" is a legal mime type name. |
| -// Also allows wildcard types -- "x/*", "*/*", and "*". |
| -NET_EXPORT bool IsMimeType(const std::string& type_string); |
| +// Returns true if the |type_string| is a correctly-formed mime type specifier |
| +// with no parameter, i.e. string that matches the following ABNF. |
| +// |
| +// token "/" token |
| +// |
| +// If |top_level_type| is non-NULL, sets it to parsed top-level type string. |
| +// If |subtype| is non-NULL, sets it to parsed subtype string. |
|
asanka
2014/03/27 18:59:52
nit: Can you add a comment pointing to the RFC tha
tyoshino (SeeGerritForStatus)
2014/03/31 13:02:45
Done.
|
| +NET_EXPORT bool ParseMimeTypeWithoutParameter(const std::string& type_string, |
| + std::string* top_level_type, |
| + std::string* subtype); |
| + |
| +// Returns true if the |type_string| is a top-level type of any media type |
| +// registered with IANA media types registry at |
| +// http://www.iana.org/assignments/media-types/media-types.xhtml or an |
| +// experimental type (type with x- prefix). |
| +// |
| +// This method doesn't check that the input conforms to token ABNF, so if input |
| +// is experimental type strings, you need to check check that before using |
| +// this method. |
| +NET_EXPORT bool IsValidTopLevelMimeType(const std::string& type_string); |
|
asanka
2014/03/27 18:59:52
Nit: I wouldn't object if this was removed if no-
tyoshino (SeeGerritForStatus)
2014/03/31 13:02:45
OK. For now, I'd like to keep this not to make any
|
| // Returns true if and only if all codecs are supported, false otherwise. |
| NET_EXPORT bool AreSupportedMediaCodecs(const std::vector<std::string>& codecs); |