| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // Minimum seconds that unclaimed pushed streams will be kept in memory. | 54 // Minimum seconds that unclaimed pushed streams will be kept in memory. |
| 55 const int kMinPushedStreamLifetimeSeconds = 300; | 55 const int kMinPushedStreamLifetimeSeconds = 300; |
| 56 | 56 |
| 57 int NPNToSpdyVersion(NextProto next_proto) { | 57 int NPNToSpdyVersion(NextProto next_proto) { |
| 58 switch (next_proto) { | 58 switch (next_proto) { |
| 59 case kProtoSPDY2: | 59 case kProtoSPDY2: |
| 60 return kSpdyVersion2; | 60 return kSpdyVersion2; |
| 61 case kProtoSPDY3: | 61 case kProtoSPDY3: |
| 62 case kProtoSPDY31: | 62 case kProtoSPDY31: |
| 63 return kSpdyVersion3; | 63 return kSpdyVersion3; |
| 64 case kProtoSPDY4a1: | 64 case kProtoSPDY4a2: |
| 65 return kSpdyVersion4; | 65 return kSpdyVersion4; |
| 66 default: | 66 default: |
| 67 NOTREACHED(); | 67 NOTREACHED(); |
| 68 } | 68 } |
| 69 return kSpdyVersion2; | 69 return kSpdyVersion2; |
| 70 } | 70 } |
| 71 | 71 |
| 72 base::Value* NetLogSpdySynCallback(const SpdyHeaderBlock* headers, | 72 base::Value* NetLogSpdySynCallback(const SpdyHeaderBlock* headers, |
| 73 bool fin, | 73 bool fin, |
| 74 bool unidirectional, | 74 bool unidirectional, |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 | 425 |
| 426 SSLClientSocket* ssl_socket = GetSSLClientSocket(); | 426 SSLClientSocket* ssl_socket = GetSSLClientSocket(); |
| 427 if (ssl_socket && ssl_socket->WasChannelIDSent()) { | 427 if (ssl_socket && ssl_socket->WasChannelIDSent()) { |
| 428 // According to the SPDY spec, the credential associated with the TLS | 428 // According to the SPDY spec, the credential associated with the TLS |
| 429 // connection is stored in slot[1]. | 429 // connection is stored in slot[1]. |
| 430 credential_state_.SetHasCredential(GURL("https://" + | 430 credential_state_.SetHasCredential(GURL("https://" + |
| 431 host_port_pair().ToString())); | 431 host_port_pair().ToString())); |
| 432 } | 432 } |
| 433 | 433 |
| 434 DCHECK_GE(protocol, kProtoSPDY2); | 434 DCHECK_GE(protocol, kProtoSPDY2); |
| 435 DCHECK_LE(protocol, kProtoSPDY4a1); | 435 DCHECK_LE(protocol, kProtoSPDY4a2); |
| 436 if (protocol >= kProtoSPDY31) { | 436 if (protocol >= kProtoSPDY31) { |
| 437 flow_control_state_ = FLOW_CONTROL_STREAM_AND_SESSION; | 437 flow_control_state_ = FLOW_CONTROL_STREAM_AND_SESSION; |
| 438 session_send_window_size_ = kSpdySessionInitialWindowSize; | 438 session_send_window_size_ = kSpdySessionInitialWindowSize; |
| 439 session_recv_window_size_ = kSpdySessionInitialWindowSize; | 439 session_recv_window_size_ = kSpdySessionInitialWindowSize; |
| 440 } else if (protocol >= kProtoSPDY3) { | 440 } else if (protocol >= kProtoSPDY3) { |
| 441 flow_control_state_ = FLOW_CONTROL_STREAM; | 441 flow_control_state_ = FLOW_CONTROL_STREAM; |
| 442 } else { | 442 } else { |
| 443 flow_control_state_ = FLOW_CONTROL_NONE; | 443 flow_control_state_ = FLOW_CONTROL_NONE; |
| 444 } | 444 } |
| 445 | 445 |
| (...skipping 1972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2418 if (!queue->empty()) { | 2418 if (!queue->empty()) { |
| 2419 SpdyStreamId stream_id = queue->front(); | 2419 SpdyStreamId stream_id = queue->front(); |
| 2420 queue->pop_front(); | 2420 queue->pop_front(); |
| 2421 return stream_id; | 2421 return stream_id; |
| 2422 } | 2422 } |
| 2423 } | 2423 } |
| 2424 return 0; | 2424 return 0; |
| 2425 } | 2425 } |
| 2426 | 2426 |
| 2427 } // namespace net | 2427 } // namespace net |
| OLD | NEW |