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() && !connection_->socket()->IsConnected()) { | |
554 UMA_HISTOGRAM_BOOLEAN("Net.SpdySession.CreateStreamWithSocketConnected", | |
Ryan Hamilton
2013/05/01 15:29:21
I think I meant this:
if (connection_->socket())
ramant (doing other things)
2013/05/01 17:53:15
Done.
| |
555 connection_->socket()->IsConnected()); | |
556 CloseSessionOnError( | |
557 ERR_CONNECTION_CLOSED, | |
558 true, | |
559 "Tried to create SPDY stream for a closed socket connection."); | |
560 return ERR_CONNECTION_CLOSED; | |
561 } | |
562 | |
551 const std::string& path = request.url().PathForRequest(); | 563 const std::string& path = request.url().PathForRequest(); |
552 *stream = new SpdyStream(this, path, request.priority(), | 564 *stream = new SpdyStream(this, path, request.priority(), |
553 stream_initial_send_window_size_, | 565 stream_initial_send_window_size_, |
554 stream_initial_recv_window_size_, | 566 stream_initial_recv_window_size_, |
555 false, request.net_log()); | 567 false, request.net_log()); |
556 created_streams_.insert(*stream); | 568 created_streams_.insert(*stream); |
557 | 569 |
558 UMA_HISTOGRAM_CUSTOM_COUNTS( | 570 UMA_HISTOGRAM_CUSTOM_COUNTS( |
559 "Net.SpdyPriorityCount", | 571 "Net.SpdyPriorityCount", |
560 static_cast<int>(request.priority()), 0, 10, 11); | 572 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()) { | 2423 if (!queue->empty()) { |
2412 SpdyStreamId stream_id = queue->front(); | 2424 SpdyStreamId stream_id = queue->front(); |
2413 queue->pop_front(); | 2425 queue->pop_front(); |
2414 return stream_id; | 2426 return stream_id; |
2415 } | 2427 } |
2416 } | 2428 } |
2417 return 0; | 2429 return 0; |
2418 } | 2430 } |
2419 | 2431 |
2420 } // namespace net | 2432 } // namespace net |
OLD | NEW |