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

Unified Diff: third_party/WebKit/Source/core/fetch/FetchUtils.cpp

Issue 2184973002: Add UMA to count the usage of sendBeacon with non-simple Content-Type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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/core/fetch/FetchUtils.cpp
diff --git a/third_party/WebKit/Source/core/fetch/FetchUtils.cpp b/third_party/WebKit/Source/core/fetch/FetchUtils.cpp
index d1996855a3e43363a44a02204c8fb10bd8a52d38..566de164f40244a19d107e98717f39ae037db21f 100644
--- a/third_party/WebKit/Source/core/fetch/FetchUtils.cpp
+++ b/third_party/WebKit/Source/core/fetch/FetchUtils.cpp
@@ -105,16 +105,20 @@ bool FetchUtils::isSimpleHeader(const AtomicString& name, const AtomicString& va
|| equalIgnoringCase(name, "save-data"))
return true;
- if (equalIgnoringCase(name, "content-type")) {
- AtomicString mimeType = extractMIMETypeFromMediaType(value);
- return equalIgnoringCase(mimeType, "application/x-www-form-urlencoded")
- || equalIgnoringCase(mimeType, "multipart/form-data")
- || equalIgnoringCase(mimeType, "text/plain");
- }
+ if (equalIgnoringCase(name, "content-type"))
+ return isSimpleContentType(value);
return false;
}
+bool FetchUtils::isSimpleContentType(const AtomicString& mediaType)
+{
+ AtomicString mimeType = extractMIMETypeFromMediaType(mediaType);
+ return equalIgnoringCase(mimeType, "application/x-www-form-urlencoded")
+ || equalIgnoringCase(mimeType, "multipart/form-data")
+ || equalIgnoringCase(mimeType, "text/plain");
+}
+
bool FetchUtils::isSimpleRequest(const String& method, const HTTPHeaderMap& headerMap)
{
if (!isSimpleMethod(method))
« no previous file with comments | « third_party/WebKit/Source/core/fetch/FetchUtils.h ('k') | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698