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

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

Issue 656303004: When QUIC sessions require confirmation from the server, allow either a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | 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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 request->OnRequestCompleteSuccess(CreateOutgoingReliableStreamImpl()); 556 request->OnRequestCompleteSuccess(CreateOutgoingReliableStreamImpl());
557 } 557 }
558 558
559 if (GetNumOpenStreams() == 0) { 559 if (GetNumOpenStreams() == 0) {
560 stream_factory_->OnIdleSession(this); 560 stream_factory_->OnIdleSession(this);
561 } 561 }
562 } 562 }
563 563
564 void QuicClientSession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) { 564 void QuicClientSession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) {
565 if (!callback_.is_null() && 565 if (!callback_.is_null() &&
566 (!require_confirmation_ || event == HANDSHAKE_CONFIRMED)) { 566 (!require_confirmation_ ||
567 event == HANDSHAKE_CONFIRMED || event == ENCRYPTION_REESTABLISHED)) {
567 // TODO(rtenneti): Currently for all CryptoHandshakeEvent events, callback_ 568 // TODO(rtenneti): Currently for all CryptoHandshakeEvent events, callback_
568 // could be called because there are no error events in CryptoHandshakeEvent 569 // could be called because there are no error events in CryptoHandshakeEvent
569 // enum. If error events are added to CryptoHandshakeEvent, then the 570 // enum. If error events are added to CryptoHandshakeEvent, then the
570 // following code needs to changed. 571 // following code needs to changed.
571 base::ResetAndReturn(&callback_).Run(OK); 572 base::ResetAndReturn(&callback_).Run(OK);
572 } 573 }
573 if (event == HANDSHAKE_CONFIRMED) { 574 if (event == HANDSHAKE_CONFIRMED) {
574 UMA_HISTOGRAM_TIMES("Net.QuicSession.HandshakeConfirmedTime", 575 UMA_HISTOGRAM_TIMES("Net.QuicSession.HandshakeConfirmedTime",
575 base::TimeTicks::Now() - handshake_start_); 576 base::TimeTicks::Now() - handshake_start_);
576 ObserverSet::iterator it = observers_.begin(); 577 ObserverSet::iterator it = observers_.begin();
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 return; 877 return;
877 878
878 // TODO(rch): re-enable this code once beta is cut. 879 // TODO(rch): re-enable this code once beta is cut.
879 // if (stream_factory_) 880 // if (stream_factory_)
880 // stream_factory_->OnSessionConnectTimeout(this); 881 // stream_factory_->OnSessionConnectTimeout(this);
881 // CloseAllStreams(ERR_QUIC_HANDSHAKE_FAILED); 882 // CloseAllStreams(ERR_QUIC_HANDSHAKE_FAILED);
882 // DCHECK_EQ(0u, GetNumOpenStreams()); 883 // DCHECK_EQ(0u, GetNumOpenStreams());
883 } 884 }
884 885
885 } // namespace net 886 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698