Remove Http2String wrapper for std::string.
gfe-relnote: n/a, no functional change.
PiperOrigin-RevId: 263816460
Change-Id: I4f365540414e6a3d78fd00ce6b39a4cdd4c14140
diff --git a/http2/platform/api/http2_string.h b/http2/platform/api/http2_string.h
deleted file mode 100644
index 25f9e59..0000000
--- a/http2/platform/api/http2_string.h
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef QUICHE_HTTP2_PLATFORM_API_HTTP2_STRING_H_
-#define QUICHE_HTTP2_PLATFORM_API_HTTP2_STRING_H_
-
-#include "net/http2/platform/impl/http2_string_impl.h"
-
-namespace http2 {
-
-using Http2String = Http2StringImpl;
-
-} // namespace http2
-
-#endif // QUICHE_HTTP2_PLATFORM_API_HTTP2_STRING_H_
diff --git a/http2/platform/api/http2_string_utils.h b/http2/platform/api/http2_string_utils.h
index ba40560..1db9d66 100644
--- a/http2/platform/api/http2_string_utils.h
+++ b/http2/platform/api/http2_string_utils.h
@@ -5,48 +5,48 @@
#ifndef QUICHE_HTTP2_PLATFORM_API_HTTP2_STRING_UTILS_H_
#define QUICHE_HTTP2_PLATFORM_API_HTTP2_STRING_UTILS_H_
+#include <string>
#include <type_traits>
#include <utility>
-#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_piece.h"
#include "net/http2/platform/impl/http2_string_utils_impl.h"
namespace http2 {
template <typename... Args>
-inline Http2String Http2StrCat(const Args&... args) {
+inline std::string Http2StrCat(const Args&... args) {
return Http2StrCatImpl(std::forward<const Args&>(args)...);
}
template <typename... Args>
-inline void Http2StrAppend(Http2String* output, const Args&... args) {
+inline void Http2StrAppend(std::string* output, const Args&... args) {
Http2StrAppendImpl(output, std::forward<const Args&>(args)...);
}
template <typename... Args>
-inline Http2String Http2StringPrintf(const Args&... args) {
+inline std::string Http2StringPrintf(const Args&... args) {
return Http2StringPrintfImpl(std::forward<const Args&>(args)...);
}
-inline Http2String Http2HexEncode(const void* bytes, size_t size) {
+inline std::string Http2HexEncode(const void* bytes, size_t size) {
return Http2HexEncodeImpl(bytes, size);
}
-inline Http2String Http2HexDecode(Http2StringPiece data) {
+inline std::string Http2HexDecode(Http2StringPiece data) {
return Http2HexDecodeImpl(data);
}
-inline Http2String Http2HexDump(Http2StringPiece data) {
+inline std::string Http2HexDump(Http2StringPiece data) {
return Http2HexDumpImpl(data);
}
-inline Http2String Http2HexEscape(Http2StringPiece data) {
+inline std::string Http2HexEscape(Http2StringPiece data) {
return Http2HexEscapeImpl(data);
}
template <typename Number>
-inline Http2String Http2Hex(Number number) {
+inline std::string Http2Hex(Number number) {
static_assert(std::is_integral<Number>::value, "Number has to be an int");
return Http2HexImpl(number);
}
diff --git a/http2/platform/api/http2_string_utils_test.cc b/http2/platform/api/http2_string_utils_test.cc
index 254f9d7..6ffc4b4 100644
--- a/http2/platform/api/http2_string_utils_test.cc
+++ b/http2/platform/api/http2_string_utils_test.cc
@@ -19,7 +19,7 @@
// Single string-like argument.
const char kFoo[] = "foo";
- const Http2String string_foo(kFoo);
+ const std::string string_foo(kFoo);
const Http2StringPiece stringpiece_foo(string_foo);
EXPECT_EQ("foo", Http2StrCat(kFoo));
EXPECT_EQ("foo", Http2StrCat(string_foo));
@@ -28,7 +28,7 @@
// Two string-like arguments.
const char kBar[] = "bar";
const Http2StringPiece stringpiece_bar(kBar);
- const Http2String string_bar(kBar);
+ const std::string string_bar(kBar);
EXPECT_EQ("foobar", Http2StrCat(kFoo, kBar));
EXPECT_EQ("foobar", Http2StrCat(kFoo, string_bar));
EXPECT_EQ("foobar", Http2StrCat(kFoo, stringpiece_bar));
@@ -72,13 +72,13 @@
TEST(Http2StringUtilsTest, Http2StrAppend) {
// No arguments on empty string.
- Http2String output;
+ std::string output;
Http2StrAppend(&output);
EXPECT_TRUE(output.empty());
// Single string-like argument.
const char kFoo[] = "foo";
- const Http2String string_foo(kFoo);
+ const std::string string_foo(kFoo);
const Http2StringPiece stringpiece_foo(string_foo);
Http2StrAppend(&output, kFoo);
EXPECT_EQ("foo", output);
@@ -96,7 +96,7 @@
// Two string-like arguments.
const char kBar[] = "bar";
const Http2StringPiece stringpiece_bar(kBar);
- const Http2String string_bar(kBar);
+ const std::string string_bar(kBar);
Http2StrAppend(&output, kFoo, kBar);
EXPECT_EQ("foobar", output);
Http2StrAppend(&output, kFoo, string_bar);