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/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 RecordProtocolErrorHistogram( | 541 RecordProtocolErrorHistogram( |
542 PROTOCOL_ERROR_REQUEST_FOR_SECURE_CONTENT_OVER_INSECURE_SESSION); | 542 PROTOCOL_ERROR_REQUEST_FOR_SECURE_CONTENT_OVER_INSECURE_SESSION); |
543 CloseSessionOnError( | 543 CloseSessionOnError( |
544 static_cast<Error>(certificate_error_code_), | 544 static_cast<Error>(certificate_error_code_), |
545 true, | 545 true, |
546 "Tried to create SPDY stream for secure content over an " | 546 "Tried to create SPDY stream for secure content over an " |
547 "unauthenticated session."); | 547 "unauthenticated session."); |
548 return ERR_SPDY_PROTOCOL_ERROR; | 548 return ERR_SPDY_PROTOCOL_ERROR; |
549 } | 549 } |
550 | 550 |
| 551 DCHECK(connection_->socket()); |
| 552 DCHECK(connection_->socket()->IsConnected()); |
| 553 if (connection_->socket()) { |
| 554 UMA_HISTOGRAM_BOOLEAN("Net.SpdySession.CreateStreamWithSocketConnected", |
| 555 connection_->socket()->IsConnected()); |
| 556 if (!connection_->socket()->IsConnected()) { |
| 557 CloseSessionOnError( |
| 558 ERR_CONNECTION_CLOSED, |
| 559 true, |
| 560 "Tried to create SPDY stream for a closed socket connection."); |
| 561 return ERR_CONNECTION_CLOSED; |
| 562 } |
| 563 } |
| 564 |
551 const std::string& path = request.url().PathForRequest(); | 565 const std::string& path = request.url().PathForRequest(); |
552 *stream = new SpdyStream(this, path, request.priority(), | 566 *stream = new SpdyStream(this, path, request.priority(), |
553 stream_initial_send_window_size_, | 567 stream_initial_send_window_size_, |
554 stream_initial_recv_window_size_, | 568 stream_initial_recv_window_size_, |
555 false, request.net_log()); | 569 false, request.net_log()); |
556 created_streams_.insert(*stream); | 570 created_streams_.insert(*stream); |
557 | 571 |
558 UMA_HISTOGRAM_CUSTOM_COUNTS( | 572 UMA_HISTOGRAM_CUSTOM_COUNTS( |
559 "Net.SpdyPriorityCount", | 573 "Net.SpdyPriorityCount", |
560 static_cast<int>(request.priority()), 0, 10, 11); | 574 static_cast<int>(request.priority()), 0, 10, 11); |
(...skipping 1850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2411 if (!queue->empty()) { | 2425 if (!queue->empty()) { |
2412 SpdyStreamId stream_id = queue->front(); | 2426 SpdyStreamId stream_id = queue->front(); |
2413 queue->pop_front(); | 2427 queue->pop_front(); |
2414 return stream_id; | 2428 return stream_id; |
2415 } | 2429 } |
2416 } | 2430 } |
2417 return 0; | 2431 return 0; |
2418 } | 2432 } |
2419 | 2433 |
2420 } // namespace net | 2434 } // namespace net |
OLD | NEW |