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

Unified Diff: net/spdy/spdy_framer.cc

Issue 12259004: Remove SpdyPingControlFrame struct. Useful for SPDY 4 development. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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
« no previous file with comments | « net/spdy/spdy_framer.h ('k') | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_framer.cc
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
index 4d716fab12f9d453306bbe2a7f72a947dc41a742..d49b05e4f1ddde30f3b29e5b5897c97b3cc59b2f 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -1183,9 +1183,14 @@ size_t SpdyFramer::ProcessControlFramePayload(const char* data, size_t len) {
// Use frame-specific handlers.
switch (control_frame.type()) {
case PING: {
- SpdyPingControlFrame* ping_frame =
- reinterpret_cast<SpdyPingControlFrame*>(&control_frame);
- visitor_->OnPing(ping_frame->unique_id());
+ SpdyFrameReader reader(current_frame_buffer_.get(),
+ current_frame_len_);
+ reader.Seek(GetControlFrameMinimumSize()); // Skip frame header.
+ SpdyPingId id = 0;
+ bool successful_read = reader.ReadUInt32(&id);
+ DCHECK(successful_read);
+ DCHECK(reader.IsDoneReading());
+ visitor_->OnPing(id);
}
break;
case WINDOW_UPDATE: {
@@ -1574,9 +1579,9 @@ SpdySerializedFrame* SpdyFramer::SerializeSettings(
return builder.take();
}
-SpdyPingControlFrame* SpdyFramer::CreatePingFrame(uint32 unique_id) const {
+SpdyFrame* SpdyFramer::CreatePingFrame(uint32 unique_id) const {
SpdyPingIR ping(unique_id);
- return reinterpret_cast<SpdyPingControlFrame*>(SerializePing(ping));
+ return SerializePing(ping);
}
SpdySerializedFrame* SpdyFramer::SerializePing(const SpdyPingIR& ping) const {
« no previous file with comments | « net/spdy/spdy_framer.h ('k') | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698