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

Unified Diff: net/spdy/spdy_framer.cc

Issue 1777163003: OnStreamEnd is now called instead of the sentinel call of OnStreamFrameData(stream_id, nullptr, 0, … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@116266391
Patch Set: Merge spdy_framer_test.cc Created 4 years, 9 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/spdy/spdy_framer.cc
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
index c51ea5842e800c94b95eca0ae19b951bdbe141f8..dfafd514338db8adac1b68872544dfc18331a14e 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -14,6 +14,7 @@
#include "base/lazy_instance.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram_macros.h"
+#include "net/quic/quic_flags.h"
#include "net/spdy/hpack/hpack_constants.h"
#include "net/spdy/spdy_frame_builder.h"
#include "net/spdy/spdy_frame_reader.h"
@@ -171,7 +172,8 @@ SpdyFramer::SpdyFramer(SpdyMajorVersion version)
enable_compression_(true),
syn_frame_processed_(false),
probable_http_response_(false),
- end_stream_when_done_(false) {
+ end_stream_when_done_(false),
+ spdy_on_stream_end_(FLAGS_spdy_on_stream_end) {
DCHECK(protocol_version_ == SPDY3 || protocol_version_ == HTTP2);
DCHECK_LE(kMaxControlFrameSize,
SpdyConstants::GetFrameMaximumSize(protocol_version_) +
@@ -830,8 +832,12 @@ size_t SpdyFramer::ProcessCommonHeader(const char* data, size_t len) {
} else {
// Empty data frame.
if (current_frame_flags_ & DATA_FLAG_FIN) {
- visitor_->OnStreamFrameData(
- current_frame_stream_id_, NULL, 0, true);
+ if (spdy_on_stream_end_) {
+ visitor_->OnStreamEnd(current_frame_stream_id_);
+ } else {
+ visitor_->OnStreamFrameData(current_frame_stream_id_, nullptr, 0,
+ true);
+ }
}
CHANGE_STATE(SPDY_FRAME_COMPLETE);
}
@@ -2110,7 +2116,11 @@ size_t SpdyFramer::ProcessFramePadding(const char* data, size_t len) {
((current_frame_flags_ & CONTROL_FLAG_FIN) != 0 ||
end_stream_when_done_)) {
end_stream_when_done_ = false;
- visitor_->OnStreamFrameData(current_frame_stream_id_, NULL, 0, true);
+ if (spdy_on_stream_end_) {
+ visitor_->OnStreamEnd(current_frame_stream_id_);
+ } else {
+ visitor_->OnStreamFrameData(current_frame_stream_id_, nullptr, 0, true);
+ }
}
CHANGE_STATE(SPDY_FRAME_COMPLETE);
}

Powered by Google App Engine
This is Rietveld 408576698