Chromium Code Reviews| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 // |codecs_out| will contain {"aaa.b.c", "dd.eee"}. | 69 // |codecs_out| will contain {"aaa.b.c", "dd.eee"}. |
| 70 // See http://www.ietf.org/rfc/rfc4281.txt. | 70 // See http://www.ietf.org/rfc/rfc4281.txt. |
| 71 NET_EXPORT void ParseCodecString(const std::string& codecs, | 71 NET_EXPORT void ParseCodecString(const std::string& codecs, |
| 72 std::vector<std::string>* codecs_out, | 72 std::vector<std::string>* codecs_out, |
| 73 bool strip); | 73 bool strip); |
| 74 | 74 |
| 75 // Check to see if a particular MIME type is in our list which only supports a | 75 // Check to see if a particular MIME type is in our list which only supports a |
| 76 // certain subset of codecs. | 76 // certain subset of codecs. |
| 77 NET_EXPORT bool IsStrictMediaMimeType(const std::string& mime_type); | 77 NET_EXPORT bool IsStrictMediaMimeType(const std::string& mime_type); |
| 78 | 78 |
| 79 enum CanPlayType { IsNotSupported, IsSupported, MayBeSupported }; | |
| 80 | |
| 79 // Check to see if a particular MIME type is in our list which only supports a | 81 // Check to see if a particular MIME type is in our list which only supports a |
| 80 // certain subset of codecs. Returns true if and only if all codecs are | 82 // certain subset of codecs. Returns true if and only if all codecs are |
| 81 // supported for that specific MIME type, false otherwise. If this returns | 83 // supported for that specific MIME type, false otherwise. If this returns |
| 82 // false you will still need to check if the media MIME tpyes and codecs are | 84 // false you will still need to check if the media MIME tpyes and codecs are |
| 83 // supported. | 85 // supported. |
|
Ryan Sleevi
2014/05/15 22:48:35
This comment block is now out of date and needs to
amogh.bihani
2014/05/16 11:25:29
done.
| |
| 84 NET_EXPORT bool IsSupportedStrictMediaMimeType( | 86 NET_EXPORT CanPlayType IsSupportedStrictMediaMimeType( |
| 85 const std::string& mime_type, | 87 const std::string& mime_type, |
| 86 const std::vector<std::string>& codecs); | 88 const std::vector<std::string>& codecs); |
| 87 | 89 |
| 88 // Get the extensions associated with the given mime type. This should be passed | 90 // 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 | 91 // 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/*". | 92 // "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. | 93 // Note that we do not erase the existing elements in the the provided vector. |
| 92 // Instead, we append the result to it. | 94 // Instead, we append the result to it. |
| 93 NET_EXPORT void GetExtensionsForMimeType( | 95 NET_EXPORT void GetExtensionsForMimeType( |
| 94 const std::string& mime_type, | 96 const std::string& mime_type, |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 124 std::string* post_data); | 126 std::string* post_data); |
| 125 | 127 |
| 126 // Adds the final delimiter to a multi-part upload request. | 128 // Adds the final delimiter to a multi-part upload request. |
| 127 NET_EXPORT void AddMultipartFinalDelimiterForUpload( | 129 NET_EXPORT void AddMultipartFinalDelimiterForUpload( |
| 128 const std::string& mime_boundary, | 130 const std::string& mime_boundary, |
| 129 std::string* post_data); | 131 std::string* post_data); |
| 130 | 132 |
| 131 } // namespace net | 133 } // namespace net |
| 132 | 134 |
| 133 #endif // NET_BASE_MIME_UTIL_H__ | 135 #endif // NET_BASE_MIME_UTIL_H__ |
| OLD | NEW |