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

Unified Diff: net/tools/quic/quic_http_response_cache.cc

Issue 2603723002: Add a new QUIC platform API for text utilities. (Closed)
Patch Set: net/tools/quic/quic_packet_printer_bin.cc Created 4 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 | « net/tools/quic/quic_dispatcher_test.cc ('k') | net/tools/quic/quic_http_response_cache_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_http_response_cache.cc
diff --git a/net/tools/quic/quic_http_response_cache.cc b/net/tools/quic/quic_http_response_cache.cc
index bc6c819f5249edd34b41407fb565b7b89ec4d4f0..c67ece77417389531c58a54bb97ece7d4b423b22 100644
--- a/net/tools/quic/quic_http_response_cache.cc
+++ b/net/tools/quic/quic_http_response_cache.cc
@@ -10,11 +10,9 @@
#include "base/files/file_util.h"
#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
-#include "base/strings/string_number_conversions.h"
-#include "base/strings/string_util.h"
-#include "base/strings/stringprintf.h"
#include "net/http/http_util.h"
#include "net/quic/core/quic_bug_tracker.h"
+#include "net/quic/platform/api/quic_text_utils.h"
#include "net/spdy/spdy_http_utils.h"
using base::FilePath;
@@ -88,7 +86,7 @@ void QuicHttpResponseCache::ResourceFile::Read() {
return;
}
spdy_headers_.AppendValueOrAddHeader(
- base::ToLowerASCII(line.substr(0, pos)), line.substr(pos + 2));
+ QuicTextUtils::ToLower(line.substr(0, pos)), line.substr(pos + 2));
}
// The connection header is prohibited in HTTP/2.
@@ -144,10 +142,9 @@ void QuicHttpResponseCache::ResourceFile::SetHostPathFromBase(
}
StringPiece QuicHttpResponseCache::ResourceFile::RemoveScheme(StringPiece url) {
- if (base::StartsWith(url, "https://", base::CompareCase::INSENSITIVE_ASCII)) {
+ if (QuicTextUtils::StartsWith(url, "https://")) {
url.remove_prefix(8);
- } else if (base::StartsWith(url, "http://",
- base::CompareCase::INSENSITIVE_ASCII)) {
+ } else if (QuicTextUtils::StartsWith(url, "http://")) {
url.remove_prefix(7);
}
return url;
@@ -184,9 +181,9 @@ void QuicHttpResponseCache::AddSimpleResponse(StringPiece host,
int response_code,
StringPiece body) {
SpdyHeaderBlock response_headers;
- response_headers[":status"] = IntToString(response_code);
+ response_headers[":status"] = QuicTextUtils::Uint64ToString(response_code);
response_headers["content-length"] =
- IntToString(static_cast<int>(body.length()));
+ QuicTextUtils::Uint64ToString(body.length());
AddResponse(host, path, std::move(response_headers), body);
}
« no previous file with comments | « net/tools/quic/quic_dispatcher_test.cc ('k') | net/tools/quic/quic_http_response_cache_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698