| Index: third_party/WebKit/Source/platform/network/ParsedContentType.h
|
| diff --git a/third_party/WebKit/Source/platform/network/ParsedContentType.h b/third_party/WebKit/Source/platform/network/ParsedContentType.h
|
| index d59f6047edd150f1e33f1c1cd0abc2593340a8e8..228639821babfc4dbd0ae6f30cf11b29fd76673d 100644
|
| --- a/third_party/WebKit/Source/platform/network/ParsedContentType.h
|
| +++ b/third_party/WebKit/Source/platform/network/ParsedContentType.h
|
| @@ -39,15 +39,16 @@
|
|
|
| namespace blink {
|
|
|
| -// <index, length>
|
| -typedef std::pair<unsigned, unsigned> SubstringRange;
|
| -PLATFORM_EXPORT bool isValidContentType(const String&);
|
| -
|
| +// ParsedContentType parses the constructor argument as specified in RFC2045
|
| +// and stores the result.
|
| // FIXME: add support for comments.
|
| class PLATFORM_EXPORT ParsedContentType final {
|
| STACK_ALLOCATED();
|
|
|
| public:
|
| + // <index, length>
|
| + using SubstringRange = std::pair<unsigned, unsigned>;
|
| +
|
| explicit ParsedContentType(const String&);
|
|
|
| String mimeType() const { return m_mimeType; }
|
| @@ -58,14 +59,14 @@ class PLATFORM_EXPORT ParsedContentType final {
|
| String parameterValueForName(const String&) const;
|
| size_t parameterCount() const;
|
|
|
| + static bool isValid(const String&);
|
| +
|
| private:
|
| - template <class ReceiverType>
|
| - friend bool parseContentType(const String&, ReceiverType&);
|
| - void setContentType(const SubstringRange&);
|
| - void setContentTypeParameter(const SubstringRange&, const SubstringRange&);
|
| + ParsedContentType() {}
|
| +
|
| + bool parse(const String&);
|
|
|
| typedef HashMap<String, String> KeyValuePairs;
|
| - String m_contentType;
|
| KeyValuePairs m_parameters;
|
| String m_mimeType;
|
| };
|
|
|