No public description
PiperOrigin-RevId: 666944918
diff --git a/quiche/http2/core/spdy_protocol.h b/quiche/http2/core/spdy_protocol.h
index f066a0a..ccf3e36 100644
--- a/quiche/http2/core/spdy_protocol.h
+++ b/quiche/http2/core/spdy_protocol.h
@@ -1011,6 +1011,9 @@
// Returns the actual size of the underlying buffer.
size_t size() const { return size_; }
+ char* begin() { return data(); }
+ char* end() { return data() + size(); }
+
operator absl::string_view() const {
return absl::string_view{frame_.get(), size_};
}
diff --git a/quiche/http2/core/spdy_protocol_test.cc b/quiche/http2/core/spdy_protocol_test.cc
index 7dbbe02..1adef29 100644
--- a/quiche/http2/core/spdy_protocol_test.cc
+++ b/quiche/http2/core/spdy_protocol_test.cc
@@ -270,5 +270,17 @@
EXPECT_EQ(28, d8.flow_control_window_consumed());
}
+TEST(SpdySerializedFrameTest, Basic) {
+ const std::string data = "0123456789";
+ auto buffer = std::make_unique<char[]>(data.length());
+ memcpy(buffer.get(), &data[0], data.length());
+
+ SpdySerializedFrame frame(std::move(buffer), data.length());
+ EXPECT_EQ(data.length(), frame.size());
+ EXPECT_EQ(data, std::string(frame.data(), frame.size()));
+ EXPECT_EQ(frame.begin(), frame.data());
+ EXPECT_EQ(frame.end(), frame.data() + frame.size());
+}
+
} // namespace test
} // namespace spdy