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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 | 437 |
438 SSLClientSocket* ssl_socket = GetSSLClientSocket(); | 438 SSLClientSocket* ssl_socket = GetSSLClientSocket(); |
439 if (ssl_socket && ssl_socket->WasChannelIDSent()) { | 439 if (ssl_socket && ssl_socket->WasChannelIDSent()) { |
440 // According to the SPDY spec, the credential associated with the TLS | 440 // According to the SPDY spec, the credential associated with the TLS |
441 // connection is stored in slot[1]. | 441 // connection is stored in slot[1]. |
442 credential_state_.SetHasCredential(GURL("https://" + | 442 credential_state_.SetHasCredential(GURL("https://" + |
443 host_port_pair().ToString())); | 443 host_port_pair().ToString())); |
444 } | 444 } |
445 | 445 |
446 DCHECK_GE(protocol, kProtoSPDY2); | 446 DCHECK_GE(protocol, kProtoSPDY2); |
447 DCHECK_LE(protocol, kProtoSPDY4a1); | 447 DCHECK_LE(protocol, kProtoSPDY4a2); |
448 if (protocol >= kProtoSPDY31) { | 448 if (protocol >= kProtoSPDY31) { |
449 flow_control_state_ = FLOW_CONTROL_STREAM_AND_SESSION; | 449 flow_control_state_ = FLOW_CONTROL_STREAM_AND_SESSION; |
450 session_send_window_size_ = kSpdySessionInitialWindowSize; | 450 session_send_window_size_ = kSpdySessionInitialWindowSize; |
451 session_recv_window_size_ = kSpdySessionInitialWindowSize; | 451 session_recv_window_size_ = kSpdySessionInitialWindowSize; |
452 } else if (protocol >= kProtoSPDY3) { | 452 } else if (protocol >= kProtoSPDY3) { |
453 flow_control_state_ = FLOW_CONTROL_STREAM; | 453 flow_control_state_ = FLOW_CONTROL_STREAM; |
454 } else { | 454 } else { |
455 flow_control_state_ = FLOW_CONTROL_NONE; | 455 flow_control_state_ = FLOW_CONTROL_NONE; |
456 } | 456 } |
457 | 457 |
(...skipping 2016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2474 if (!queue->empty()) { | 2474 if (!queue->empty()) { |
2475 SpdyStreamId stream_id = queue->front(); | 2475 SpdyStreamId stream_id = queue->front(); |
2476 queue->pop_front(); | 2476 queue->pop_front(); |
2477 return stream_id; | 2477 return stream_id; |
2478 } | 2478 } |
2479 } | 2479 } |
2480 return 0; | 2480 return 0; |
2481 } | 2481 } |
2482 | 2482 |
2483 } // namespace net | 2483 } // namespace net |
OLD | NEW |