Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Unified Diff: third_party/WebKit/Source/platform/network/ParsedContentType.h

Issue 2708523003: Make ParsedContentType more conformant to the spec (Closed)
Patch Set: fix Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 9a8aae915435b61bd9be3e4c98ec453f9cd20e67..a6f90089577f75bad4afbbfd4c2322d655c6c258 100644
--- a/third_party/WebKit/Source/platform/network/ParsedContentType.h
+++ b/third_party/WebKit/Source/platform/network/ParsedContentType.h
@@ -46,10 +46,14 @@ class PLATFORM_EXPORT ParsedContentType final {
STACK_ALLOCATED();
public:
- // <index, length>
- using SubstringRange = std::pair<unsigned, unsigned>;
-
- explicit ParsedContentType(const String&);
+ // 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.
+ enum class Mode {
+ Normal,
+ Relaxed,
+ };
+ explicit ParsedContentType(const String&, Mode = Mode::Normal);
String mimeType() const { return m_mimeType; }
String charset() const;
@@ -64,7 +68,9 @@ class PLATFORM_EXPORT ParsedContentType final {
private:
bool parse(const String&);
+ const Mode m_mode;
bool m_isValid;
+
typedef HashMap<String, String> KeyValuePairs;
KeyValuePairs m_parameters;
String m_mimeType;

Powered by Google App Engine
This is Rietveld 408576698