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

Unified Diff: net/quic/spdy_utils.cc

Issue 1878083002: Implement IsAsciiUpper and IsAsciiLower in base/strings/string_util.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git sync Created 4 years, 8 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: net/quic/spdy_utils.cc
diff --git a/net/quic/spdy_utils.cc b/net/quic/spdy_utils.cc
index fc6eb9fd4b90293c68aeedb00a5213d281331220..68dadb5700c730572dfab2752cacf095a98ffc11 100644
--- a/net/quic/spdy_utils.cc
+++ b/net/quic/spdy_utils.cc
@@ -10,6 +10,7 @@
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
+#include "base/strings/string_util.h"
#include "net/spdy/spdy_frame_builder.h"
#include "net/spdy/spdy_framer.h"
#include "net/spdy/spdy_protocol.h"
@@ -20,10 +21,6 @@ using std::vector;
namespace net {
-bool ascii_isupper(unsigned char c) {
- return c >= 'A' && c <= 'Z';
-}
-
// static
string SpdyUtils::SerializeUncompressedHeaders(const SpdyHeaderBlock& headers) {
SpdyMajorVersion spdy_version = HTTP2;
@@ -122,7 +119,7 @@ bool SpdyUtils::CopyAndValidateTrailers(const QuicHeaderList& header_list,
return false;
}
- if (std::any_of(name.begin(), name.end(), ascii_isupper)) {
+ if (std::any_of(name.begin(), name.end(), base::IsAsciiUpper<char>)) {
DVLOG(1) << "Malformed header: Header name " << name
<< " contains upper-case characters.";
return false;

Powered by Google App Engine
This is Rietveld 408576698