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

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

Issue 1706243002: Don't use SVG resource documents with an unrecognized MIME-type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use testharness; add unit test for extractMIMETypeFromMediaType Created 4 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/HTTPParsers.h
diff --git a/third_party/WebKit/Source/platform/network/HTTPParsers.h b/third_party/WebKit/Source/platform/network/HTTPParsers.h
index 58c66bc9dedc8b5484554e8038ce2383939862c6..bd15e885faa3b0df75a6c170f3c6fbcd66237738 100644
--- a/third_party/WebKit/Source/platform/network/HTTPParsers.h
+++ b/third_party/WebKit/Source/platform/network/HTTPParsers.h
@@ -97,6 +97,12 @@ PLATFORM_EXPORT bool isValidHTTPFieldContentRFC7230(const String&);
PLATFORM_EXPORT bool isValidHTTPToken(const String&);
PLATFORM_EXPORT bool parseHTTPRefresh(const String& refresh, bool fromHttpEquivMeta, double& delay, String& url);
PLATFORM_EXPORT double parseDate(const String&);
+
+// Given a Media Type (like "foo/bar; baz=gazonk" - usually from the
+// 'Content-Type' HTTP header), extract and return the "type/subtype" portion
+// ("foo/bar").
+// Note: This function does not in any way check that the "type/subtype" pair
+// is well-formed.
PLATFORM_EXPORT AtomicString extractMIMETypeFromMediaType(const AtomicString&);
PLATFORM_EXPORT String extractCharsetFromMediaType(const String&);
PLATFORM_EXPORT void findCharsetInMediaType(const String& mediaType, unsigned& charsetPos, unsigned& charsetLen, unsigned start = 0);
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGUseElement.cpp ('k') | third_party/WebKit/Source/platform/network/HTTPParsersTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698