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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
178 *stream_ = stream; | 178 *stream_ = stream; |
179 base::ResetAndReturn(&callback_).Run(OK); | 179 base::ResetAndReturn(&callback_).Run(OK); |
180 } | 180 } |
181 | 181 |
182 void QuicChromiumClientSession::StreamRequest::OnRequestCompleteFailure( | 182 void QuicChromiumClientSession::StreamRequest::OnRequestCompleteFailure( |
183 int rv) { | 183 int rv) { |
184 session_.reset(); | 184 session_.reset(); |
185 base::ResetAndReturn(&callback_).Run(rv); | 185 base::ResetAndReturn(&callback_).Run(rv); |
186 } | 186 } |
187 | 187 |
188 void QuicChromiumClientSession::HpackEncoderDebugVisitor::OnUseEntry( | |
189 const QuicTime::Delta elapsed) { | |
190 UMA_HISTOGRAM_TIMES( | |
191 "Net.QuicHpackEncoderIndexedEntryAge", | |
192 base::TimeDelta::FromMicroseconds(elapsed.ToMicroseconds())); | |
193 } | |
194 | |
195 void QuicChromiumClientSession::HpackDecoderDebugVisitor::OnUseEntry( | |
196 const QuicTime::Delta elapsed) { | |
197 UMA_HISTOGRAM_TIMES( | |
198 "Net.QuicHpackDecoderIndexedEntryAge", | |
199 base::TimeDelta::FromMicroseconds(elapsed.ToMicroseconds())); | |
200 } | |
201 | |
188 QuicChromiumClientSession::QuicChromiumClientSession( | 202 QuicChromiumClientSession::QuicChromiumClientSession( |
189 QuicConnection* connection, | 203 QuicConnection* connection, |
190 std::unique_ptr<DatagramClientSocket> socket, | 204 std::unique_ptr<DatagramClientSocket> socket, |
191 QuicStreamFactory* stream_factory, | 205 QuicStreamFactory* stream_factory, |
192 QuicCryptoClientStreamFactory* crypto_client_stream_factory, | 206 QuicCryptoClientStreamFactory* crypto_client_stream_factory, |
193 QuicClock* clock, | 207 QuicClock* clock, |
194 TransportSecurityState* transport_security_state, | 208 TransportSecurityState* transport_security_state, |
195 std::unique_ptr<QuicServerInfo> server_info, | 209 std::unique_ptr<QuicServerInfo> server_info, |
196 const QuicServerId& server_id, | 210 const QuicServerId& server_id, |
197 int yield_after_packets, | 211 int yield_after_packets, |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
361 0, kMaxReordering, 50); | 375 0, kMaxReordering, 50); |
362 if (stats.min_rtt_us > 100 * 1000) { | 376 if (stats.min_rtt_us > 100 * 1000) { |
363 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.MaxReorderingTimeLongRtt", | 377 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.MaxReorderingTimeLongRtt", |
364 reordering, 0, kMaxReordering, 50); | 378 reordering, 0, kMaxReordering, 50); |
365 } | 379 } |
366 UMA_HISTOGRAM_COUNTS( | 380 UMA_HISTOGRAM_COUNTS( |
367 "Net.QuicSession.MaxReordering", | 381 "Net.QuicSession.MaxReordering", |
368 static_cast<base::HistogramBase::Sample>(stats.max_sequence_reordering)); | 382 static_cast<base::HistogramBase::Sample>(stats.max_sequence_reordering)); |
369 } | 383 } |
370 | 384 |
385 void QuicChromiumClientSession::Initialize() { | |
386 QuicClientSessionBase::Initialize(); | |
387 headers_stream()->SetHpackEncoderDebugVisitor( | |
388 std::unique_ptr<HpackEncoderDebugVisitor>( | |
Ryan Hamilton
2016/05/20 21:27:18
fwiw, you can use base::WrapUnique(new ...) to sav
Buck
2016/05/20 21:41:31
Done.
| |
389 new HpackEncoderDebugVisitor())); | |
390 headers_stream()->SetHpackDecoderDebugVisitor( | |
391 std::unique_ptr<HpackDecoderDebugVisitor>( | |
392 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 |