| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 231 } |
| 232 | 232 |
| 233 ReliableQuicStream* QuicClientSession::CreateIncomingReliableStream( | 233 ReliableQuicStream* QuicClientSession::CreateIncomingReliableStream( |
| 234 QuicStreamId id) { | 234 QuicStreamId id) { |
| 235 DLOG(ERROR) << "Server push not supported"; | 235 DLOG(ERROR) << "Server push not supported"; |
| 236 return NULL; | 236 return NULL; |
| 237 } | 237 } |
| 238 | 238 |
| 239 void QuicClientSession::CloseStream(QuicStreamId stream_id) { | 239 void QuicClientSession::CloseStream(QuicStreamId stream_id) { |
| 240 QuicSession::CloseStream(stream_id); | 240 QuicSession::CloseStream(stream_id); |
| 241 OnClosedStream(); |
| 242 } |
| 241 | 243 |
| 244 void QuicClientSession::SendRstStream(QuicStreamId id, |
| 245 QuicRstStreamErrorCode error) { |
| 246 QuicSession::SendRstStream(id, error); |
| 247 OnClosedStream(); |
| 248 } |
| 249 |
| 250 void QuicClientSession::OnClosedStream() { |
| 242 if (GetNumOpenStreams() < get_max_open_streams() && | 251 if (GetNumOpenStreams() < get_max_open_streams() && |
| 243 !stream_requests_.empty() && | 252 !stream_requests_.empty() && |
| 244 crypto_stream_->encryption_established() && | 253 crypto_stream_->encryption_established() && |
| 245 !goaway_received() && | 254 !goaway_received() && |
| 246 connection()->connected()) { | 255 connection()->connected()) { |
| 247 StreamRequest* request = stream_requests_.front(); | 256 StreamRequest* request = stream_requests_.front(); |
| 248 stream_requests_.pop_front(); | 257 stream_requests_.pop_front(); |
| 249 request->OnRequestCompleteSuccess(CreateOutgoingReliableStreamImpl()); | 258 request->OnRequestCompleteSuccess(CreateOutgoingReliableStreamImpl()); |
| 250 } | 259 } |
| 251 | 260 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 } | 410 } |
| 402 | 411 |
| 403 void QuicClientSession::NotifyFactoryOfSessionClose() { | 412 void QuicClientSession::NotifyFactoryOfSessionClose() { |
| 404 DCHECK_EQ(0u, GetNumOpenStreams()); | 413 DCHECK_EQ(0u, GetNumOpenStreams()); |
| 405 DCHECK(stream_factory_); | 414 DCHECK(stream_factory_); |
| 406 // Will delete |this|. | 415 // Will delete |this|. |
| 407 stream_factory_->OnSessionClose(this); | 416 stream_factory_->OnSessionClose(this); |
| 408 } | 417 } |
| 409 | 418 |
| 410 } // namespace net | 419 } // namespace net |
| OLD | NEW |