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

Unified Diff: net/quic/quic_headers_stream.cc

Issue 1870833005: relnote: Implements OnHeaderFrameStart and OnHeaderFrameEnd in QuicHeadersStream. Not used in produ… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@06_CL_119188441
Patch Set: Created 4 years, 8 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/quic/quic_headers_stream.cc
diff --git a/net/quic/quic_headers_stream.cc b/net/quic/quic_headers_stream.cc
index 786048d9a21b2a891024bb22608c99237e4583a1..6b3e23836108fe401514554dae071654f40b01ad 100644
--- a/net/quic/quic_headers_stream.cc
+++ b/net/quic/quic_headers_stream.cc
@@ -10,6 +10,7 @@
#include "net/quic/quic_bug_tracker.h"
#include "net/quic/quic_flags.h"
#include "net/quic/quic_headers_stream.h"
+#include "net/quic/quic_header_list.h"
#include "net/quic/quic_spdy_session.h"
#include "net/quic/quic_time.h"
@@ -75,13 +76,18 @@ class QuicHeadersStream::SpdyFramerVisitor
}
SpdyHeadersHandlerInterface* OnHeaderFrameStart(
- SpdyStreamId stream_id) override {
- LOG(FATAL);
- return nullptr;
+ SpdyStreamId /* stream_id */) override {
+ return &header_list_;
}
- void OnHeaderFrameEnd(SpdyStreamId stream_id, bool end_headers) override {
- LOG(FATAL);
+ void OnHeaderFrameEnd(SpdyStreamId /* stream_id */,
+ bool end_headers) override {
+ if (end_headers) {
+ if (stream_->IsConnected()) {
+ stream_->OnHeaderList(header_list_);
+ }
+ header_list_.Clear();
+ }
}
void OnError(SpdyFramer* framer) override {
@@ -184,6 +190,7 @@ class QuicHeadersStream::SpdyFramerVisitor
private:
QuicHeadersStream* stream_;
+ QuicHeaderList header_list_;
DISALLOW_COPY_AND_ASSIGN(SpdyFramerVisitor);
};
@@ -356,6 +363,36 @@ void QuicHeadersStream::OnControlFrameHeaderData(SpdyStreamId stream_id,
}
}
+void QuicHeadersStream::OnHeaderList(const QuicHeaderList& header_list) {
+ if (measure_headers_hol_blocking_time_) {
+ if (prev_max_timestamp_ > cur_max_timestamp_) {
+ // prev_max_timestamp_ > cur_max_timestamp_ implies that
+ // headers from lower numbered streams actually came off the
+ // wire after headers for the current stream, hence there was
+ // HOL blocking.
+ QuicTime::Delta delta = prev_max_timestamp_.Subtract(cur_max_timestamp_);
+ DVLOG(1) << "stream " << stream_id_
+ << ": Net.QuicSession.HeadersHOLBlockedTime "
ramant (doing other things) 2016/04/11 18:11:57 nit: indentation for lines 375-376.
Zhongyi Shi 2016/04/11 18:27:31 it's already fixed in Final.
+ << delta.ToMilliseconds();
+ spdy_session_->OnHeadersHeadOfLineBlocking(delta);
+ }
+ prev_max_timestamp_ = std::max(prev_max_timestamp_, cur_max_timestamp_);
+ cur_max_timestamp_ = QuicTime::Zero();
+ }
+ if (promised_stream_id_ == kInvalidStreamId) {
+ spdy_session_->OnStreamHeaderList(stream_id_, fin_, frame_len_,
+ header_list);
+ } else {
+ spdy_session_->OnPromiseHeaderList(stream_id_, promised_stream_id_,
+ frame_len_, header_list);
+ }
+ // Reset state for the next frame.
+ promised_stream_id_ = kInvalidStreamId;
+ stream_id_ = kInvalidStreamId;
+ fin_ = false;
+ frame_len_ = 0;
+}
+
void QuicHeadersStream::OnCompressedFrameSize(size_t frame_len) {
frame_len_ += frame_len;
}

Powered by Google App Engine
This is Rietveld 408576698