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

Unified Diff: net/quic/quic_headers_stream.cc

Issue 1877703002: Landing Recent QUIC changes until 4/8/2016 17:17 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git sync 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
« no previous file with comments | « net/quic/quic_headers_stream.h ('k') | net/quic/quic_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_headers_stream.cc
diff --git a/net/quic/quic_headers_stream.cc b/net/quic/quic_headers_stream.cc
index 9f439272ba7d61c64cf378906dd402ce48b34296..6788ee66081406beff02f1077c19d21f55a17a54 100644
--- a/net/quic/quic_headers_stream.cc
+++ b/net/quic/quic_headers_stream.cc
@@ -9,6 +9,7 @@
#include "base/strings/stringprintf.h"
#include "net/quic/quic_bug_tracker.h"
#include "net/quic/quic_flags.h"
+#include "net/quic/quic_header_list.h"
#include "net/quic/quic_headers_stream.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 "
+ << 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;
}
@@ -364,4 +401,8 @@ bool QuicHeadersStream::IsConnected() {
return session()->connection()->connected();
}
+void QuicHeadersStream::DisableHpackDynamicTable() {
+ spdy_framer_.UpdateHeaderEncoderTableSize(0);
+}
+
} // namespace net
« no previous file with comments | « net/quic/quic_headers_stream.h ('k') | net/quic/quic_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698