Chromium Code Reviews| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 136 SpdyStreamId stream_id, | 136 SpdyStreamId stream_id, |
| 137 SpdyStreamId promised_stream_id, | 137 SpdyStreamId promised_stream_id, |
| 138 NetLogCaptureMode capture_mode) { | 138 NetLogCaptureMode capture_mode) { |
| 139 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 139 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 140 dict->Set("headers", ElideSpdyHeaderBlockForNetLog(*headers, capture_mode)); | 140 dict->Set("headers", ElideSpdyHeaderBlockForNetLog(*headers, capture_mode)); |
| 141 dict->SetInteger("id", stream_id); | 141 dict->SetInteger("id", stream_id); |
| 142 dict->SetInteger("promised_stream_id", promised_stream_id); | 142 dict->SetInteger("promised_stream_id", promised_stream_id); |
| 143 return std::move(dict); | 143 return std::move(dict); |
| 144 } | 144 } |
| 145 | 145 |
| 146 class HpackEncoderDebugVisitor : public QuicHeadersStream::HpackDebugVisitor { | |
| 147 void OnUseEntry(QuicTime::Delta elapsed) override { | |
| 148 UMA_HISTOGRAM_TIMES( | |
| 149 "Net.QuicHpackEncoderIndexedEntryAge", | |
|
Alexei Svitkine (slow)
2016/05/24 18:00:30
Nit: Maybe slightly more readable if you add anoth
Buck
2016/05/24 18:15:06
Done.
| |
| 150 base::TimeDelta::FromMicroseconds(elapsed.ToMicroseconds())); | |
| 151 } | |
| 152 }; | |
| 153 | |
| 154 class HpackDecoderDebugVisitor : public QuicHeadersStream::HpackDebugVisitor { | |
| 155 void OnUseEntry(QuicTime::Delta elapsed) override { | |
| 156 UMA_HISTOGRAM_TIMES( | |
| 157 "Net.QuicHpackDecoderIndexedEntryAge", | |
| 158 base::TimeDelta::FromMicroseconds(elapsed.ToMicroseconds())); | |
| 159 } | |
| 160 }; | |
| 161 | |
| 146 } // namespace | 162 } // namespace |
| 147 | 163 |
| 148 QuicChromiumClientSession::StreamRequest::StreamRequest() : stream_(nullptr) {} | 164 QuicChromiumClientSession::StreamRequest::StreamRequest() : stream_(nullptr) {} |
| 149 | 165 |
| 150 QuicChromiumClientSession::StreamRequest::~StreamRequest() { | 166 QuicChromiumClientSession::StreamRequest::~StreamRequest() { |
| 151 CancelRequest(); | 167 CancelRequest(); |
| 152 } | 168 } |
| 153 | 169 |
| 154 int QuicChromiumClientSession::StreamRequest::StartRequest( | 170 int QuicChromiumClientSession::StreamRequest::StartRequest( |
| 155 const base::WeakPtr<QuicChromiumClientSession>& session, | 171 const base::WeakPtr<QuicChromiumClientSession>& session, |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 361 0, kMaxReordering, 50); | 377 0, kMaxReordering, 50); |
| 362 if (stats.min_rtt_us > 100 * 1000) { | 378 if (stats.min_rtt_us > 100 * 1000) { |
| 363 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.MaxReorderingTimeLongRtt", | 379 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.MaxReorderingTimeLongRtt", |
| 364 reordering, 0, kMaxReordering, 50); | 380 reordering, 0, kMaxReordering, 50); |
| 365 } | 381 } |
| 366 UMA_HISTOGRAM_COUNTS( | 382 UMA_HISTOGRAM_COUNTS( |
| 367 "Net.QuicSession.MaxReordering", | 383 "Net.QuicSession.MaxReordering", |
| 368 static_cast<base::HistogramBase::Sample>(stats.max_sequence_reordering)); | 384 static_cast<base::HistogramBase::Sample>(stats.max_sequence_reordering)); |
| 369 } | 385 } |
| 370 | 386 |
| 387 void QuicChromiumClientSession::Initialize() { | |
| 388 QuicClientSessionBase::Initialize(); | |
| 389 headers_stream()->SetHpackEncoderDebugVisitor( | |
| 390 base::WrapUnique(new HpackEncoderDebugVisitor())); | |
| 391 headers_stream()->SetHpackDecoderDebugVisitor( | |
| 392 base::WrapUnique(new HpackDecoderDebugVisitor())); | |
| 393 } | |
| 394 | |
| 371 void QuicChromiumClientSession::OnHeadersHeadOfLineBlocking( | 395 void QuicChromiumClientSession::OnHeadersHeadOfLineBlocking( |
| 372 QuicTime::Delta delta) { | 396 QuicTime::Delta delta) { |
| 373 UMA_HISTOGRAM_TIMES( | 397 UMA_HISTOGRAM_TIMES( |
| 374 "Net.QuicSession.HeadersHOLBlockedTime", | 398 "Net.QuicSession.HeadersHOLBlockedTime", |
| 375 base::TimeDelta::FromMicroseconds(delta.ToMicroseconds())); | 399 base::TimeDelta::FromMicroseconds(delta.ToMicroseconds())); |
| 376 } | 400 } |
| 377 | 401 |
| 378 void QuicChromiumClientSession::OnStreamFrame(const QuicStreamFrame& frame) { | 402 void QuicChromiumClientSession::OnStreamFrame(const QuicStreamFrame& frame) { |
| 379 // Record total number of stream frames. | 403 // Record total number of stream frames. |
| 380 UMA_HISTOGRAM_COUNTS("Net.QuicNumStreamFramesInPacket", 1); | 404 UMA_HISTOGRAM_COUNTS("Net.QuicNumStreamFramesInPacket", 1); |
| (...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1177 } | 1201 } |
| 1178 | 1202 |
| 1179 void QuicChromiumClientSession::DeletePromised( | 1203 void QuicChromiumClientSession::DeletePromised( |
| 1180 QuicClientPromisedInfo* promised) { | 1204 QuicClientPromisedInfo* promised) { |
| 1181 if (IsOpenStream(promised->id())) | 1205 if (IsOpenStream(promised->id())) |
| 1182 streams_pushed_and_claimed_count_++; | 1206 streams_pushed_and_claimed_count_++; |
| 1183 QuicClientSessionBase::DeletePromised(promised); | 1207 QuicClientSessionBase::DeletePromised(promised); |
| 1184 } | 1208 } |
| 1185 | 1209 |
| 1186 } // namespace net | 1210 } // namespace net |
| OLD | NEW |