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..9a8aae915435b61bd9be3e4c98ec453f9cd20e67 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,13 @@ class PLATFORM_EXPORT ParsedContentType final { |
String parameterValueForName(const String&) const; |
size_t parameterCount() const; |
+ bool isValid() const { return m_isValid; } |
+ |
private: |
- template <class ReceiverType> |
- friend bool parseContentType(const String&, ReceiverType&); |
- void setContentType(const SubstringRange&); |
- void setContentTypeParameter(const SubstringRange&, const SubstringRange&); |
+ bool parse(const String&); |
+ bool m_isValid; |
typedef HashMap<String, String> KeyValuePairs; |
- String m_contentType; |
KeyValuePairs m_parameters; |
String m_mimeType; |
}; |