| Index: third_party/WebKit/Source/platform/network/mime/ContentType.cpp
|
| diff --git a/third_party/WebKit/Source/platform/network/mime/ContentType.cpp b/third_party/WebKit/Source/platform/network/mime/ContentType.cpp
|
| index cc1fa9dc02c8f872d4a015e597d53688f0c28d14..c47ac91a4d384250fea66cc3631a566f8a0aff6d 100644
|
| --- a/third_party/WebKit/Source/platform/network/mime/ContentType.cpp
|
| +++ b/third_party/WebKit/Source/platform/network/mime/ContentType.cpp
|
| @@ -30,48 +30,15 @@
|
|
|
| namespace blink {
|
|
|
| -ContentType::ContentType(const String& contentType) : m_type(contentType) {}
|
| +ContentType::ContentType(const String& contentType)
|
| + : m_type(contentType), m_content(contentType) {}
|
|
|
| String ContentType::parameter(const String& parameterName) const {
|
| - String parameterValue;
|
| - String strippedType = m_type.stripWhiteSpace();
|
| -
|
| - // a MIME type can have one or more "param=value" after a semi-colon, and
|
| - // separated from each other by semi-colons
|
| - size_t semi = strippedType.find(';');
|
| - if (semi != kNotFound) {
|
| - size_t start =
|
| - strippedType.find(parameterName, semi + 1, TextCaseASCIIInsensitive);
|
| - if (start != kNotFound) {
|
| - start = strippedType.find('=', start + parameterName.length());
|
| - if (start != kNotFound) {
|
| - size_t quote = strippedType.find('\"', start + 1);
|
| - size_t end = strippedType.find('\"', start + 2);
|
| - if (quote != kNotFound && end != kNotFound) {
|
| - start = quote;
|
| - } else {
|
| - end = strippedType.find(';', start + 1);
|
| - if (end == kNotFound)
|
| - end = strippedType.length();
|
| - }
|
| - parameterValue = strippedType.substring(start + 1, end - (start + 1))
|
| - .stripWhiteSpace();
|
| - }
|
| - }
|
| - }
|
| -
|
| - return parameterValue;
|
| + return m_content.parameterValueForName(parameterName);
|
| }
|
|
|
| String ContentType::type() const {
|
| - String strippedType = m_type.stripWhiteSpace();
|
| -
|
| - // "type" can have parameters after a semi-colon, strip them
|
| - size_t semi = strippedType.find(';');
|
| - if (semi != kNotFound)
|
| - strippedType = strippedType.left(semi).stripWhiteSpace();
|
| -
|
| - return strippedType;
|
| + return m_content.mimeType();
|
| }
|
|
|
| } // namespace blink
|
|
|