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_client_session.h" | 5 #include "net/quic/quic_client_session.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/metrics/sparse_histogram.h" | 10 #include "base/metrics/sparse_histogram.h" |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 596 if (!callback_.is_null() && | 596 if (!callback_.is_null() && |
| 597 (!require_confirmation_ || | 597 (!require_confirmation_ || |
| 598 event == HANDSHAKE_CONFIRMED || event == ENCRYPTION_REESTABLISHED)) { | 598 event == HANDSHAKE_CONFIRMED || event == ENCRYPTION_REESTABLISHED)) { |
| 599 // TODO(rtenneti): Currently for all CryptoHandshakeEvent events, callback_ | 599 // TODO(rtenneti): Currently for all CryptoHandshakeEvent events, callback_ |
| 600 // could be called because there are no error events in CryptoHandshakeEvent | 600 // could be called because there are no error events in CryptoHandshakeEvent |
| 601 // enum. If error events are added to CryptoHandshakeEvent, then the | 601 // enum. If error events are added to CryptoHandshakeEvent, then the |
| 602 // following code needs to changed. | 602 // following code needs to changed. |
| 603 base::ResetAndReturn(&callback_).Run(OK); | 603 base::ResetAndReturn(&callback_).Run(OK); |
| 604 } | 604 } |
| 605 if (event == HANDSHAKE_CONFIRMED) { | 605 if (event == HANDSHAKE_CONFIRMED) { |
| 606 if (stream_factory_) { | |
| 607 stream_factory_->ConfirmQuic(server_id_); | |
|
Ryan Hamilton
2015/03/25 18:27:46
This is a minor nit, but can you do this in QuicSt
Bence
2015/03/25 18:48:32
Done.
| |
| 608 } | |
| 606 UMA_HISTOGRAM_TIMES("Net.QuicSession.HandshakeConfirmedTime", | 609 UMA_HISTOGRAM_TIMES("Net.QuicSession.HandshakeConfirmedTime", |
| 607 base::TimeTicks::Now() - handshake_start_); | 610 base::TimeTicks::Now() - handshake_start_); |
| 608 if (server_info_) { | 611 if (server_info_) { |
| 609 // TODO(rtenneti): Should we delete this histogram? | 612 // TODO(rtenneti): Should we delete this histogram? |
| 610 // Track how long it has taken to finish handshake once we start waiting | 613 // Track how long it has taken to finish handshake once we start waiting |
| 611 // for reading of QUIC server information from disk cache. We could use | 614 // for reading of QUIC server information from disk cache. We could use |
| 612 // this data to compare total time taken if we were to cancel the disk | 615 // this data to compare total time taken if we were to cancel the disk |
| 613 // cache read vs waiting for the read to complete. | 616 // cache read vs waiting for the read to complete. |
| 614 base::TimeTicks wait_for_data_start_time = | 617 base::TimeTicks wait_for_data_start_time = |
| 615 server_info_->wait_for_data_start_time(); | 618 server_info_->wait_for_data_start_time(); |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 910 return; | 913 return; |
| 911 | 914 |
| 912 // TODO(rch): re-enable this code once beta is cut. | 915 // TODO(rch): re-enable this code once beta is cut. |
| 913 // if (stream_factory_) | 916 // if (stream_factory_) |
| 914 // stream_factory_->OnSessionConnectTimeout(this); | 917 // stream_factory_->OnSessionConnectTimeout(this); |
| 915 // CloseAllStreams(ERR_QUIC_HANDSHAKE_FAILED); | 918 // CloseAllStreams(ERR_QUIC_HANDSHAKE_FAILED); |
| 916 // DCHECK_EQ(0u, GetNumOpenStreams()); | 919 // DCHECK_EQ(0u, GetNumOpenStreams()); |
| 917 } | 920 } |
| 918 | 921 |
| 919 } // namespace net | 922 } // namespace net |
| OLD | NEW |