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_protocol.h" | 5 #include "net/spdy/spdy_protocol.h" |
6 | 6 |
7 namespace net { | 7 namespace net { |
8 | 8 |
9 SpdyFrameWithNameValueBlockIR::SpdyFrameWithNameValueBlockIR( | 9 SpdyFrameWithNameValueBlockIR::SpdyFrameWithNameValueBlockIR( |
10 SpdyStreamId stream_id) : SpdyFrameWithFinIR(stream_id) {} | 10 SpdyStreamId stream_id) : SpdyFrameWithFinIR(stream_id) {} |
(...skipping 25 matching lines...) Expand all Loading... |
36 } | 36 } |
37 | 37 |
38 // WINDOW_UPDATE is the last valid frame. | 38 // WINDOW_UPDATE is the last valid frame. |
39 if (frame_type_field > SerializeFrameType(version, WINDOW_UPDATE)) { | 39 if (frame_type_field > SerializeFrameType(version, WINDOW_UPDATE)) { |
40 return false; | 40 return false; |
41 } | 41 } |
42 | 42 |
43 return true; | 43 return true; |
44 case SPDY4: | 44 case SPDY4: |
45 case SPDY5: | 45 case SPDY5: |
| 46 // Check for recognized extensions. |
| 47 if (frame_type_field == SerializeFrameType(version, ALTSVC) || |
| 48 frame_type_field == SerializeFrameType(version, BLOCKED)) { |
| 49 return true; |
| 50 } |
| 51 |
46 // DATA is the first valid frame. | 52 // DATA is the first valid frame. |
47 if (frame_type_field < SerializeFrameType(version, DATA)) { | 53 if (frame_type_field < SerializeFrameType(version, DATA)) { |
48 return false; | 54 return false; |
49 } | 55 } |
50 | 56 |
51 // BLOCKED is the last valid frame. | 57 // CONTINUATION is the last valid frame. |
52 if (frame_type_field > SerializeFrameType(version, BLOCKED)) { | 58 if (frame_type_field > SerializeFrameType(version, CONTINUATION)) { |
53 return false; | 59 return false; |
54 } | 60 } |
55 | 61 |
56 return true; | 62 return true; |
57 } | 63 } |
58 | 64 |
59 LOG(DFATAL) << "Unhandled SPDY version " << version; | 65 LOG(DFATAL) << "Unhandled SPDY version " << version; |
60 return false; | 66 return false; |
61 } | 67 } |
62 | 68 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 case PUSH_PROMISE: | 167 case PUSH_PROMISE: |
162 return 5; | 168 return 5; |
163 case PING: | 169 case PING: |
164 return 6; | 170 return 6; |
165 case GOAWAY: | 171 case GOAWAY: |
166 return 7; | 172 return 7; |
167 case WINDOW_UPDATE: | 173 case WINDOW_UPDATE: |
168 return 8; | 174 return 8; |
169 case CONTINUATION: | 175 case CONTINUATION: |
170 return 9; | 176 return 9; |
| 177 // ALTSVC and BLOCKED are extensions. |
171 case ALTSVC: | 178 case ALTSVC: |
172 return 10; | 179 return 10; |
173 case BLOCKED: | 180 case BLOCKED: |
174 return 11; | 181 return 11; |
175 default: | 182 default: |
176 LOG(DFATAL) << "Serializing unhandled frame type " << frame_type; | 183 LOG(DFATAL) << "Serializing unhandled frame type " << frame_type; |
177 return -1; | 184 return -1; |
178 } | 185 } |
179 } | 186 } |
180 | 187 |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 parent_stream_id_(parent_stream_id), | 843 parent_stream_id_(parent_stream_id), |
837 weight_(weight), | 844 weight_(weight), |
838 exclusive_(exclusive) { | 845 exclusive_(exclusive) { |
839 } | 846 } |
840 | 847 |
841 void SpdyPriorityIR::Visit(SpdyFrameVisitor* visitor) const { | 848 void SpdyPriorityIR::Visit(SpdyFrameVisitor* visitor) const { |
842 return visitor->VisitPriority(*this); | 849 return visitor->VisitPriority(*this); |
843 } | 850 } |
844 | 851 |
845 } // namespace net | 852 } // namespace net |
OLD | NEW |