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 if (connection_->socket()) { | |
552 DCHECK(connection_->socket()->IsConnected()); | |
553 if (!connection_->socket()->IsConnected()) { | |
554 UMA_HISTOGRAM_BOOLEAN("Net.SpdySessionSocketNotConnectedCreateStream", | |
555 true); | |
Ryan Hamilton
2013/05/01 03:30:19
nit: UMA_HISTOGRAM_BOOLEAN("Net.SpdySession.Create
ramant (doing other things)
2013/05/01 04:54:01
Done.
| |
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 } | |
563 | |
551 const std::string& path = request.url().PathForRequest(); | 564 const std::string& path = request.url().PathForRequest(); |
552 *stream = new SpdyStream(this, path, request.priority(), | 565 *stream = new SpdyStream(this, path, request.priority(), |
553 stream_initial_send_window_size_, | 566 stream_initial_send_window_size_, |
554 stream_initial_recv_window_size_, | 567 stream_initial_recv_window_size_, |
555 false, request.net_log()); | 568 false, request.net_log()); |
556 created_streams_.insert(*stream); | 569 created_streams_.insert(*stream); |
557 | 570 |
558 UMA_HISTOGRAM_CUSTOM_COUNTS( | 571 UMA_HISTOGRAM_CUSTOM_COUNTS( |
559 "Net.SpdyPriorityCount", | 572 "Net.SpdyPriorityCount", |
560 static_cast<int>(request.priority()), 0, 10, 11); | 573 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()) { | 2424 if (!queue->empty()) { |
2412 SpdyStreamId stream_id = queue->front(); | 2425 SpdyStreamId stream_id = queue->front(); |
2413 queue->pop_front(); | 2426 queue->pop_front(); |
2414 return stream_id; | 2427 return stream_id; |
2415 } | 2428 } |
2416 } | 2429 } |
2417 return 0; | 2430 return 0; |
2418 } | 2431 } |
2419 | 2432 |
2420 } // namespace net | 2433 } // namespace net |
OLD | NEW |