| 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 307 |
| 308 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicSession.QuicVersion", | 308 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicSession.QuicVersion", |
| 309 connection()->version()); | 309 connection()->version()); |
| 310 if (!callback_.is_null()) { | 310 if (!callback_.is_null()) { |
| 311 base::ResetAndReturn(&callback_).Run(ERR_QUIC_PROTOCOL_ERROR); | 311 base::ResetAndReturn(&callback_).Run(ERR_QUIC_PROTOCOL_ERROR); |
| 312 } | 312 } |
| 313 QuicSession::ConnectionClose(error, from_peer); | 313 QuicSession::ConnectionClose(error, from_peer); |
| 314 NotifyFactoryOfSessionCloseLater(); | 314 NotifyFactoryOfSessionCloseLater(); |
| 315 } | 315 } |
| 316 | 316 |
| 317 void QuicClientSession::OnSuccessfulVersionNegotiation( |
| 318 const QuicVersion& version) { |
| 319 logger_.OnSuccessfulVersionNegotiation(version); |
| 320 QuicSession::OnSuccessfulVersionNegotiation(version); |
| 321 } |
| 322 |
| 317 void QuicClientSession::StartReading() { | 323 void QuicClientSession::StartReading() { |
| 318 if (read_pending_) { | 324 if (read_pending_) { |
| 319 return; | 325 return; |
| 320 } | 326 } |
| 321 read_pending_ = true; | 327 read_pending_ = true; |
| 322 int rv = socket_->Read(read_buffer_.get(), | 328 int rv = socket_->Read(read_buffer_.get(), |
| 323 read_buffer_->size(), | 329 read_buffer_->size(), |
| 324 base::Bind(&QuicClientSession::OnReadComplete, | 330 base::Bind(&QuicClientSession::OnReadComplete, |
| 325 weak_factory_.GetWeakPtr())); | 331 weak_factory_.GetWeakPtr())); |
| 326 if (rv == ERR_IO_PENDING) { | 332 if (rv == ERR_IO_PENDING) { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 } | 422 } |
| 417 | 423 |
| 418 void QuicClientSession::NotifyFactoryOfSessionClose() { | 424 void QuicClientSession::NotifyFactoryOfSessionClose() { |
| 419 DCHECK_EQ(0u, GetNumOpenStreams()); | 425 DCHECK_EQ(0u, GetNumOpenStreams()); |
| 420 DCHECK(stream_factory_); | 426 DCHECK(stream_factory_); |
| 421 // Will delete |this|. | 427 // Will delete |this|. |
| 422 stream_factory_->OnSessionClose(this); | 428 stream_factory_->OnSessionClose(this); |
| 423 } | 429 } |
| 424 | 430 |
| 425 } // namespace net | 431 } // namespace net |
| OLD | NEW |