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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 void QuicClientSession::CancelRequest(StreamRequest* request) { | 207 void QuicClientSession::CancelRequest(StreamRequest* request) { |
208 // Remove |request| from the queue while preserving the order of the | 208 // Remove |request| from the queue while preserving the order of the |
209 // other elements. | 209 // other elements. |
210 StreamRequestQueue::iterator it = | 210 StreamRequestQueue::iterator it = |
211 std::find(stream_requests_.begin(), stream_requests_.end(), request); | 211 std::find(stream_requests_.begin(), stream_requests_.end(), request); |
212 if (it != stream_requests_.end()) { | 212 if (it != stream_requests_.end()) { |
213 it = stream_requests_.erase(it); | 213 it = stream_requests_.erase(it); |
214 } | 214 } |
215 } | 215 } |
216 | 216 |
217 QuicReliableClientStream* QuicClientSession::CreateOutgoingReliableStream() { | 217 QuicReliableClientStream* QuicClientSession::CreateOutgoingDataStream() { |
218 if (!crypto_stream_->encryption_established()) { | 218 if (!crypto_stream_->encryption_established()) { |
219 DVLOG(1) << "Encryption not active so no outgoing stream created."; | 219 DVLOG(1) << "Encryption not active so no outgoing stream created."; |
220 return NULL; | 220 return NULL; |
221 } | 221 } |
222 if (GetNumOpenStreams() >= get_max_open_streams()) { | 222 if (GetNumOpenStreams() >= get_max_open_streams()) { |
223 DVLOG(1) << "Failed to create a new outgoing stream. " | 223 DVLOG(1) << "Failed to create a new outgoing stream. " |
224 << "Already " << GetNumOpenStreams() << " open."; | 224 << "Already " << GetNumOpenStreams() << " open."; |
225 return NULL; | 225 return NULL; |
226 } | 226 } |
227 if (goaway_received()) { | 227 if (goaway_received()) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 } | 270 } |
271 | 271 |
272 callback_ = callback; | 272 callback_ = callback; |
273 return ERR_IO_PENDING; | 273 return ERR_IO_PENDING; |
274 } | 274 } |
275 | 275 |
276 int QuicClientSession::GetNumSentClientHellos() const { | 276 int QuicClientSession::GetNumSentClientHellos() const { |
277 return crypto_stream_->num_sent_client_hellos(); | 277 return crypto_stream_->num_sent_client_hellos(); |
278 } | 278 } |
279 | 279 |
280 ReliableQuicStream* QuicClientSession::CreateIncomingReliableStream( | 280 QuicDataStream* QuicClientSession::CreateIncomingDataStream( |
281 QuicStreamId id) { | 281 QuicStreamId id) { |
282 DLOG(ERROR) << "Server push not supported"; | 282 DLOG(ERROR) << "Server push not supported"; |
283 return NULL; | 283 return NULL; |
284 } | 284 } |
285 | 285 |
286 void QuicClientSession::CloseStream(QuicStreamId stream_id) { | 286 void QuicClientSession::CloseStream(QuicStreamId stream_id) { |
287 QuicSession::CloseStream(stream_id); | 287 QuicSession::CloseStream(stream_id); |
288 OnClosedStream(); | 288 OnClosedStream(); |
289 } | 289 } |
290 | 290 |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 } | 513 } |
514 | 514 |
515 void QuicClientSession::NotifyFactoryOfSessionClosed() { | 515 void QuicClientSession::NotifyFactoryOfSessionClosed() { |
516 DCHECK_EQ(0u, GetNumOpenStreams()); | 516 DCHECK_EQ(0u, GetNumOpenStreams()); |
517 // Will delete |this|. | 517 // Will delete |this|. |
518 if (stream_factory_) | 518 if (stream_factory_) |
519 stream_factory_->OnSessionClosed(this); | 519 stream_factory_->OnSessionClosed(this); |
520 } | 520 } |
521 | 521 |
522 } // namespace net | 522 } // namespace net |
OLD | NEW |