OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_chromium_client_session.h" | 5 #include "net/quic/quic_chromium_client_session.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 SpdyStreamId stream_id, | 134 SpdyStreamId stream_id, |
135 SpdyStreamId promised_stream_id, | 135 SpdyStreamId promised_stream_id, |
136 NetLogCaptureMode capture_mode) { | 136 NetLogCaptureMode capture_mode) { |
137 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 137 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
138 dict->Set("headers", ElideSpdyHeaderBlockForNetLog(*headers, capture_mode)); | 138 dict->Set("headers", ElideSpdyHeaderBlockForNetLog(*headers, capture_mode)); |
139 dict->SetInteger("id", stream_id); | 139 dict->SetInteger("id", stream_id); |
140 dict->SetInteger("promised_stream_id", promised_stream_id); | 140 dict->SetInteger("promised_stream_id", promised_stream_id); |
141 return std::move(dict); | 141 return std::move(dict); |
142 } | 142 } |
143 | 143 |
| 144 class HpackEncoderDebugVisitor : public QuicHeadersStream::HpackDebugVisitor { |
| 145 void OnUseEntry(QuicTime::Delta elapsed) override { |
| 146 UMA_HISTOGRAM_TIMES( |
| 147 "Net.QuicHpackEncoder.IndexedEntryAge", |
| 148 base::TimeDelta::FromMicroseconds(elapsed.ToMicroseconds())); |
| 149 } |
| 150 }; |
| 151 |
| 152 class HpackDecoderDebugVisitor : public QuicHeadersStream::HpackDebugVisitor { |
| 153 void OnUseEntry(QuicTime::Delta elapsed) override { |
| 154 UMA_HISTOGRAM_TIMES( |
| 155 "Net.QuicHpackDecoder.IndexedEntryAge", |
| 156 base::TimeDelta::FromMicroseconds(elapsed.ToMicroseconds())); |
| 157 } |
| 158 }; |
| 159 |
144 } // namespace | 160 } // namespace |
145 | 161 |
146 QuicChromiumClientSession::StreamRequest::StreamRequest() : stream_(nullptr) {} | 162 QuicChromiumClientSession::StreamRequest::StreamRequest() : stream_(nullptr) {} |
147 | 163 |
148 QuicChromiumClientSession::StreamRequest::~StreamRequest() { | 164 QuicChromiumClientSession::StreamRequest::~StreamRequest() { |
149 CancelRequest(); | 165 CancelRequest(); |
150 } | 166 } |
151 | 167 |
152 int QuicChromiumClientSession::StreamRequest::StartRequest( | 168 int QuicChromiumClientSession::StreamRequest::StartRequest( |
153 const base::WeakPtr<QuicChromiumClientSession>& session, | 169 const base::WeakPtr<QuicChromiumClientSession>& session, |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 0, kMaxReordering, 50); | 375 0, kMaxReordering, 50); |
360 if (stats.min_rtt_us > 100 * 1000) { | 376 if (stats.min_rtt_us > 100 * 1000) { |
361 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.MaxReorderingTimeLongRtt", | 377 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.MaxReorderingTimeLongRtt", |
362 reordering, 0, kMaxReordering, 50); | 378 reordering, 0, kMaxReordering, 50); |
363 } | 379 } |
364 UMA_HISTOGRAM_COUNTS( | 380 UMA_HISTOGRAM_COUNTS( |
365 "Net.QuicSession.MaxReordering", | 381 "Net.QuicSession.MaxReordering", |
366 static_cast<base::HistogramBase::Sample>(stats.max_sequence_reordering)); | 382 static_cast<base::HistogramBase::Sample>(stats.max_sequence_reordering)); |
367 } | 383 } |
368 | 384 |
| 385 void QuicChromiumClientSession::Initialize() { |
| 386 QuicClientSessionBase::Initialize(); |
| 387 headers_stream()->SetHpackEncoderDebugVisitor( |
| 388 base::WrapUnique(new HpackEncoderDebugVisitor())); |
| 389 headers_stream()->SetHpackDecoderDebugVisitor( |
| 390 base::WrapUnique(new HpackDecoderDebugVisitor())); |
| 391 } |
| 392 |
369 void QuicChromiumClientSession::OnHeadersHeadOfLineBlocking( | 393 void QuicChromiumClientSession::OnHeadersHeadOfLineBlocking( |
370 QuicTime::Delta delta) { | 394 QuicTime::Delta delta) { |
371 UMA_HISTOGRAM_TIMES( | 395 UMA_HISTOGRAM_TIMES( |
372 "Net.QuicSession.HeadersHOLBlockedTime", | 396 "Net.QuicSession.HeadersHOLBlockedTime", |
373 base::TimeDelta::FromMicroseconds(delta.ToMicroseconds())); | 397 base::TimeDelta::FromMicroseconds(delta.ToMicroseconds())); |
374 } | 398 } |
375 | 399 |
376 void QuicChromiumClientSession::OnStreamFrame(const QuicStreamFrame& frame) { | 400 void QuicChromiumClientSession::OnStreamFrame(const QuicStreamFrame& frame) { |
377 // Record total number of stream frames. | 401 // Record total number of stream frames. |
378 UMA_HISTOGRAM_COUNTS("Net.QuicNumStreamFramesInPacket", 1); | 402 UMA_HISTOGRAM_COUNTS("Net.QuicNumStreamFramesInPacket", 1); |
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1175 } | 1199 } |
1176 | 1200 |
1177 void QuicChromiumClientSession::DeletePromised( | 1201 void QuicChromiumClientSession::DeletePromised( |
1178 QuicClientPromisedInfo* promised) { | 1202 QuicClientPromisedInfo* promised) { |
1179 if (IsOpenStream(promised->id())) | 1203 if (IsOpenStream(promised->id())) |
1180 streams_pushed_and_claimed_count_++; | 1204 streams_pushed_and_claimed_count_++; |
1181 QuicClientSessionBase::DeletePromised(promised); | 1205 QuicClientSessionBase::DeletePromised(promised); |
1182 } | 1206 } |
1183 | 1207 |
1184 } // namespace net | 1208 } // namespace net |
OLD | NEW |