Automated g4 rollback of changelist 363922592.
*** Reason for rollback ***
third_party/absl/strings/string_view_utils.h does not exist in Chromium, therefore SpdyStringPieceCaseHash and SpdyStringPieceCaseEq still need to be platformized.
*** Original change description ***
Remove SpdyStringPieceCaseHash and SpdyStringPieceCaseEq.
Their Abseil implementation can be used directly from QUICHE now that Abseil is
allowed in Chromium (in QUICHE only).
***
PiperOrigin-RevId: 363952702
Change-Id: I42635e07892fcce20856a18aa8ab22f82abb075d
diff --git a/spdy/core/spdy_header_block.h b/spdy/core/spdy_header_block.h
index 3639128..76ec436 100644
--- a/spdy/core/spdy_header_block.h
+++ b/spdy/core/spdy_header_block.h
@@ -94,8 +94,8 @@
typedef SpdyLinkedHashMap<absl::string_view,
HeaderValue,
- StringPieceCaseHash,
- StringPieceCaseEqual>
+ SpdyStringPieceCaseHash,
+ SpdyStringPieceCaseEq>
MapType;
public:
diff --git a/spdy/platform/api/spdy_string_utils.h b/spdy/platform/api/spdy_string_utils.h
index 7e755d8..81a0866 100644
--- a/spdy/platform/api/spdy_string_utils.h
+++ b/spdy/platform/api/spdy_string_utils.h
@@ -48,6 +48,10 @@
return SpdyHexDumpImpl(data);
}
+using SpdyStringPieceCaseHash = SpdyStringPieceCaseHashImpl;
+
+using SpdyStringPieceCaseEq = SpdyStringPieceCaseEqImpl;
+
} // namespace spdy
#endif // QUICHE_SPDY_PLATFORM_API_SPDY_STRING_UTILS_H_
diff --git a/spdy/platform/api/spdy_string_utils_test.cc b/spdy/platform/api/spdy_string_utils_test.cc
index 5866a1e..2964876 100644
--- a/spdy/platform/api/spdy_string_utils_test.cc
+++ b/spdy/platform/api/spdy_string_utils_test.cc
@@ -180,6 +180,28 @@
EXPECT_EQ("10000001", SpdyHexEncodeUInt32AndTrim(0x10000001));
}
+TEST(SpdyStringUtilsTest, SpdyStringPieceCaseHash) {
+ SpdyStringPieceCaseHash hasher;
+ auto mixed = hasher("To Be Or Not To Be, That is The Question");
+ auto lower = hasher("to be or not to be, that is the question");
+ EXPECT_EQ(mixed, lower);
+ auto lower2 = hasher("to be or not to be, that is the question");
+ EXPECT_EQ(lower, lower2);
+ auto different = hasher("to see or not to see, that is the question");
+ EXPECT_NE(lower, different);
+ EXPECT_NE(lower, hasher(""));
+}
+
+TEST(SpdyStringUtilsTest, SpdyStringPieceCaseEq) {
+ SpdyStringPieceCaseEq eq;
+ EXPECT_TRUE(eq("To Be Or Not To Be, That is The Question",
+ "to be or not to be, that is the question"));
+ EXPECT_TRUE(eq("to be or not to be, that is the question",
+ "to be or not to be, that is the question"));
+ EXPECT_FALSE(eq("to be or not to be, that is the question",
+ "to see or not to see, that is the question"));
+}
+
} // namespace
} // namespace test
} // namespace spdy