Chromium Code Reviews| 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 a014b6df29e96afdd1f980bc9a05e4d54e79c728..5971e7cb682cc5b5b4161934e3f161231e369a39 100644 |
| --- a/third_party/WebKit/Source/platform/network/ParsedContentType.h |
| +++ b/third_party/WebKit/Source/platform/network/ParsedContentType.h |
| @@ -33,6 +33,7 @@ |
| #define ParsedContentType_h |
| #include "platform/PlatformExport.h" |
| +#include "platform/network/ParsedParameterizedContentHeaderField.h" |
| #include "platform/wtf/Allocator.h" |
| #include "platform/wtf/HashMap.h" |
| #include "platform/wtf/text/StringHash.h" |
| @@ -42,42 +43,20 @@ namespace blink { |
| // ParsedContentType parses the constructor argument as specified in RFC2045 |
| // and stores the result. |
| // FIXME: add support for comments. |
| -class PLATFORM_EXPORT ParsedContentType final { |
| +class PLATFORM_EXPORT ParsedContentType final |
| + : public ParsedParameterizedContentHeaderField { |
|
yhirano
2017/05/15 11:14:51
Please use delegation rather than inheritance.
e_hakkinen
2017/05/18 09:35:48
Done.
|
| STACK_ALLOCATED(); |
| public: |
| - // When |Relaxed| is specified, the parser parses parameter values in a sloppy |
| - // manner, i.e., only ';' and '"' are treated as special characters. |
| - // See https://chromiumcodereview.appspot.com/23043002. |
| - // When |Strict| is specified, the parser does not allow multiple values |
| - // for the same parameter. Some RFCs based on RFC2045 (e.g. RFC6838) note that |
| - // "It is an error for a specific parameter to be specified more than once." |
| - enum class Mode { |
| - kNormal, |
| - kRelaxed, |
| - kStrict, |
| - }; |
| explicit ParsedContentType(const String&, Mode = Mode::kNormal); |
| - String MimeType() const { return mime_type_; } |
| + String MimeType() const { return Type(); } |
| String Charset() const; |
| - // Note that in the case of multiple values for the same name, the last value |
| - // is returned. |
| - String ParameterValueForName(const String&) const; |
| - size_t ParameterCount() const; |
| - |
| - bool IsValid() const { return is_valid_; } |
| - |
| private: |
| - bool Parse(const String&); |
| + bool Parse(const String&, Mode); |
| - const Mode mode_; |
| bool is_valid_; |
| - |
| - typedef HashMap<String, String> KeyValuePairs; |
| - KeyValuePairs parameters_; |
| - String mime_type_; |
| }; |
| } // namespace blink |