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

Unified Diff: Source/platform/network/HTTPParsers.cpp

Issue 99733002: Update HTTPHeaderMap wrappers to use AtomicString type for header values (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years 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
« no previous file with comments | « Source/platform/network/HTTPParsers.h ('k') | Source/platform/network/HTTPRequest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/network/HTTPParsers.cpp
diff --git a/Source/platform/network/HTTPParsers.cpp b/Source/platform/network/HTTPParsers.cpp
index 772188d21ae5cd135882ab668c53a9a25f92c082..e557188493514fe12aec80518c21f6f428266bd0 100644
--- a/Source/platform/network/HTTPParsers.cpp
+++ b/Source/platform/network/HTTPParsers.cpp
@@ -266,7 +266,7 @@ String filenameFromHTTPContentDisposition(const String& value)
return String();
}
-String extractMIMETypeFromMediaType(const String& mediaType)
+AtomicString extractMIMETypeFromMediaType(const AtomicString& mediaType)
{
StringBuilder mimeType;
unsigned length = mediaType.length();
@@ -298,7 +298,7 @@ String extractMIMETypeFromMediaType(const String& mediaType)
if (mimeType.length() == length)
return mediaType;
- return mimeType.toString();
+ return mimeType.toAtomicString();
}
String extractCharsetFromMediaType(const String& mediaType)
@@ -607,15 +607,15 @@ size_t parseHTTPRequestLine(const char* data, size_t length, String& failureReas
return end - data;
}
-size_t parseHTTPHeader(const char* start, size_t length, String& failureReason, AtomicString& nameStr, String& valueStr)
+size_t parseHTTPHeader(const char* start, size_t length, String& failureReason, AtomicString& nameStr, AtomicString& valueStr)
{
const char* p = start;
const char* end = start + length;
Vector<char> name;
Vector<char> value;
- nameStr = AtomicString();
- valueStr = String();
+ nameStr = nullAtom;
+ valueStr = nullAtom;
for (; p < end; p++) {
switch (*p) {
@@ -665,7 +665,7 @@ size_t parseHTTPHeader(const char* start, size_t length, String& failureReason,
return 0;
}
nameStr = AtomicString::fromUTF8(name.data(), name.size());
- valueStr = String::fromUTF8(value.data(), value.size());
+ valueStr = AtomicString::fromUTF8(value.data(), value.size());
if (nameStr.isNull()) {
failureReason = "Invalid UTF-8 sequence in header name";
return 0;
« no previous file with comments | « Source/platform/network/HTTPParsers.h ('k') | Source/platform/network/HTTPRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698