OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/quic/quic_headers_stream.h" | 5 #include "net/quic/quic_headers_stream.h" |
6 | 6 |
7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "net/quic/quic_flags.h" | 9 #include "net/quic/quic_flags.h" |
10 #include "net/quic/quic_headers_stream.h" | 10 #include "net/quic/quic_headers_stream.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 if (measure_headers_hol_blocking_time_) { | 282 if (measure_headers_hol_blocking_time_) { |
283 if (prev_max_timestamp_ > cur_max_timestamp_) { | 283 if (prev_max_timestamp_ > cur_max_timestamp_) { |
284 // prev_max_timestamp_ > cur_max_timestamp_ implies that | 284 // prev_max_timestamp_ > cur_max_timestamp_ implies that |
285 // headers from lower numbered streams actually came off the | 285 // headers from lower numbered streams actually came off the |
286 // wire after headers for the current stream, hence there was | 286 // wire after headers for the current stream, hence there was |
287 // HOL blocking. | 287 // HOL blocking. |
288 QuicTime::Delta delta(prev_max_timestamp_.Subtract(cur_max_timestamp_)); | 288 QuicTime::Delta delta(prev_max_timestamp_.Subtract(cur_max_timestamp_)); |
289 DVLOG(1) << "stream " << stream_id | 289 DVLOG(1) << "stream " << stream_id |
290 << ": Net.QuicSession.HeadersHOLBlockedTime " | 290 << ": Net.QuicSession.HeadersHOLBlockedTime " |
291 << delta.ToMilliseconds(); | 291 << delta.ToMilliseconds(); |
292 UMA_HISTOGRAM_TIMES( | 292 spdy_session_->OnHeadersHeadOfLineBlocking(delta); |
293 "Net.QuicSession.HeadersHOLBlockedTime", | |
294 base::TimeDelta::FromMicroseconds(delta.ToMicroseconds())); | |
295 } | 293 } |
296 prev_max_timestamp_ = std::max(prev_max_timestamp_, cur_max_timestamp_); | 294 prev_max_timestamp_ = std::max(prev_max_timestamp_, cur_max_timestamp_); |
297 cur_max_timestamp_ = QuicTime::Zero(); | 295 cur_max_timestamp_ = QuicTime::Zero(); |
298 } | 296 } |
299 spdy_session_->OnStreamHeadersComplete(stream_id_, fin_, frame_len_); | 297 spdy_session_->OnStreamHeadersComplete(stream_id_, fin_, frame_len_); |
300 // Reset state for the next frame. | 298 // Reset state for the next frame. |
301 stream_id_ = kInvalidStreamId; | 299 stream_id_ = kInvalidStreamId; |
302 fin_ = false; | 300 fin_ = false; |
303 frame_len_ = 0; | 301 frame_len_ = 0; |
304 } else { | 302 } else { |
305 spdy_session_->OnStreamHeaders(stream_id_, StringPiece(header_data, len)); | 303 spdy_session_->OnStreamHeaders(stream_id_, StringPiece(header_data, len)); |
306 } | 304 } |
307 } | 305 } |
308 | 306 |
309 void QuicHeadersStream::OnCompressedFrameSize(size_t frame_len) { | 307 void QuicHeadersStream::OnCompressedFrameSize(size_t frame_len) { |
310 frame_len_ += frame_len; | 308 frame_len_ += frame_len; |
311 } | 309 } |
312 | 310 |
313 bool QuicHeadersStream::IsConnected() { | 311 bool QuicHeadersStream::IsConnected() { |
314 return session()->connection()->connected(); | 312 return session()->connection()->connected(); |
315 } | 313 } |
316 | 314 |
317 } // namespace net | 315 } // namespace net |
OLD | NEW |