Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Side by Side Diff: net/quic/quic_client_session.cc

Issue 318143002: Add a new histogram Net.QuicSession.HandshakeConfirmedTime which tracks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_client_session.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 ssl_info->client_cert_sent = false; 428 ssl_info->client_cert_sent = false;
429 ssl_info->channel_id_sent = false; 429 ssl_info->channel_id_sent = false;
430 ssl_info->security_bits = security_bits; 430 ssl_info->security_bits = security_bits;
431 ssl_info->handshake_type = SSLInfo::HANDSHAKE_FULL; 431 ssl_info->handshake_type = SSLInfo::HANDSHAKE_FULL;
432 return true; 432 return true;
433 } 433 }
434 434
435 int QuicClientSession::CryptoConnect(bool require_confirmation, 435 int QuicClientSession::CryptoConnect(bool require_confirmation,
436 const CompletionCallback& callback) { 436 const CompletionCallback& callback) {
437 require_confirmation_ = require_confirmation; 437 require_confirmation_ = require_confirmation;
438 handshake_start_ = base::TimeTicks::Now();
438 RecordHandshakeState(STATE_STARTED); 439 RecordHandshakeState(STATE_STARTED);
439 if (!crypto_stream_->CryptoConnect()) { 440 if (!crypto_stream_->CryptoConnect()) {
440 // TODO(wtc): change crypto_stream_.CryptoConnect() to return a 441 // TODO(wtc): change crypto_stream_.CryptoConnect() to return a
441 // QuicErrorCode and map it to a net error code. 442 // QuicErrorCode and map it to a net error code.
442 return ERR_CONNECTION_FAILED; 443 return ERR_CONNECTION_FAILED;
443 } 444 }
444 445
445 if (IsCryptoHandshakeConfirmed()) 446 if (IsCryptoHandshakeConfirmed())
446 return OK; 447 return OK;
447 448
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 void QuicClientSession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) { 538 void QuicClientSession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) {
538 if (!callback_.is_null() && 539 if (!callback_.is_null() &&
539 (!require_confirmation_ || event == HANDSHAKE_CONFIRMED)) { 540 (!require_confirmation_ || event == HANDSHAKE_CONFIRMED)) {
540 // TODO(rtenneti): Currently for all CryptoHandshakeEvent events, callback_ 541 // TODO(rtenneti): Currently for all CryptoHandshakeEvent events, callback_
541 // could be called because there are no error events in CryptoHandshakeEvent 542 // could be called because there are no error events in CryptoHandshakeEvent
542 // enum. If error events are added to CryptoHandshakeEvent, then the 543 // enum. If error events are added to CryptoHandshakeEvent, then the
543 // following code needs to changed. 544 // following code needs to changed.
544 base::ResetAndReturn(&callback_).Run(OK); 545 base::ResetAndReturn(&callback_).Run(OK);
545 } 546 }
546 if (event == HANDSHAKE_CONFIRMED) { 547 if (event == HANDSHAKE_CONFIRMED) {
548 UMA_HISTOGRAM_TIMES("Net.QuicSession.HandshakeConfirmedTime",
549 base::TimeTicks::Now() - handshake_start_);
547 ObserverSet::iterator it = observers_.begin(); 550 ObserverSet::iterator it = observers_.begin();
548 while (it != observers_.end()) { 551 while (it != observers_.end()) {
549 Observer* observer = *it; 552 Observer* observer = *it;
550 ++it; 553 ++it;
551 observer->OnCryptoHandshakeConfirmed(); 554 observer->OnCryptoHandshakeConfirmed();
552 } 555 }
553 } 556 }
554 QuicSession::OnCryptoHandshakeEvent(event); 557 QuicSession::OnCryptoHandshakeEvent(event);
555 } 558 }
556 559
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 838
836 if (IsCryptoHandshakeConfirmed()) 839 if (IsCryptoHandshakeConfirmed())
837 return; 840 return;
838 841
839 if (stream_factory_) 842 if (stream_factory_)
840 stream_factory_->OnSessionConnectTimeout(this); 843 stream_factory_->OnSessionConnectTimeout(this);
841 CloseAllStreams(ERR_QUIC_HANDSHAKE_FAILED); 844 CloseAllStreams(ERR_QUIC_HANDSHAKE_FAILED);
842 } 845 }
843 846
844 } // namespace net 847 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_client_session.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698