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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 return true; | 209 return true; |
210 case SPDY4: | 210 case SPDY4: |
211 case SPDY5: | 211 case SPDY5: |
212 // HEADER_TABLE_SIZE is the first valid setting id. | 212 // HEADER_TABLE_SIZE is the first valid setting id. |
213 if (setting_id_field < | 213 if (setting_id_field < |
214 SerializeSettingId(version, SETTINGS_HEADER_TABLE_SIZE)) { | 214 SerializeSettingId(version, SETTINGS_HEADER_TABLE_SIZE)) { |
215 return false; | 215 return false; |
216 } | 216 } |
217 | 217 |
218 // INITIAL_WINDOW_SIZE is the last valid setting id. | 218 // COMPRESS_DATA is the last valid setting id. |
219 if (setting_id_field > | 219 if (setting_id_field > |
220 SerializeSettingId(version, SETTINGS_INITIAL_WINDOW_SIZE)) { | 220 SerializeSettingId(version, SETTINGS_COMPRESS_DATA)) { |
221 return false; | 221 return false; |
222 } | 222 } |
223 | 223 |
224 return true; | 224 return true; |
225 } | 225 } |
226 | 226 |
227 LOG(DFATAL) << "Unhandled SPDY version " << version; | 227 LOG(DFATAL) << "Unhandled SPDY version " << version; |
228 return false; | 228 return false; |
229 } | 229 } |
230 | 230 |
(...skipping 23 matching lines...) Expand all Loading... |
254 case SPDY5: | 254 case SPDY5: |
255 switch (setting_id_field) { | 255 switch (setting_id_field) { |
256 case 1: | 256 case 1: |
257 return SETTINGS_HEADER_TABLE_SIZE; | 257 return SETTINGS_HEADER_TABLE_SIZE; |
258 case 2: | 258 case 2: |
259 return SETTINGS_ENABLE_PUSH; | 259 return SETTINGS_ENABLE_PUSH; |
260 case 3: | 260 case 3: |
261 return SETTINGS_MAX_CONCURRENT_STREAMS; | 261 return SETTINGS_MAX_CONCURRENT_STREAMS; |
262 case 4: | 262 case 4: |
263 return SETTINGS_INITIAL_WINDOW_SIZE; | 263 return SETTINGS_INITIAL_WINDOW_SIZE; |
| 264 case 5: |
| 265 return SETTINGS_COMPRESS_DATA; |
264 } | 266 } |
265 break; | 267 break; |
266 } | 268 } |
267 | 269 |
268 LOG(DFATAL) << "Unhandled setting ID " << setting_id_field; | 270 LOG(DFATAL) << "Unhandled setting ID " << setting_id_field; |
269 return SETTINGS_UPLOAD_BANDWIDTH; | 271 return SETTINGS_UPLOAD_BANDWIDTH; |
270 } | 272 } |
271 | 273 |
272 int SpdyConstants::SerializeSettingId(SpdyMajorVersion version, | 274 int SpdyConstants::SerializeSettingId(SpdyMajorVersion version, |
273 SpdySettingsIds id) { | 275 SpdySettingsIds id) { |
(...skipping 23 matching lines...) Expand all Loading... |
297 case SPDY5: | 299 case SPDY5: |
298 switch (id) { | 300 switch (id) { |
299 case SETTINGS_HEADER_TABLE_SIZE: | 301 case SETTINGS_HEADER_TABLE_SIZE: |
300 return 1; | 302 return 1; |
301 case SETTINGS_ENABLE_PUSH: | 303 case SETTINGS_ENABLE_PUSH: |
302 return 2; | 304 return 2; |
303 case SETTINGS_MAX_CONCURRENT_STREAMS: | 305 case SETTINGS_MAX_CONCURRENT_STREAMS: |
304 return 3; | 306 return 3; |
305 case SETTINGS_INITIAL_WINDOW_SIZE: | 307 case SETTINGS_INITIAL_WINDOW_SIZE: |
306 return 4; | 308 return 4; |
| 309 case SETTINGS_COMPRESS_DATA: |
| 310 return 5; |
307 default: | 311 default: |
308 LOG(DFATAL) << "Serializing unhandled setting id " << id; | 312 LOG(DFATAL) << "Serializing unhandled setting id " << id; |
309 return -1; | 313 return -1; |
310 } | 314 } |
311 } | 315 } |
312 LOG(DFATAL) << "Unhandled SPDY version " << version; | 316 LOG(DFATAL) << "Unhandled SPDY version " << version; |
313 return -1; | 317 return -1; |
314 } | 318 } |
315 | 319 |
316 bool SpdyConstants::IsValidRstStreamStatus(SpdyMajorVersion version, | 320 bool SpdyConstants::IsValidRstStreamStatus(SpdyMajorVersion version, |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 } | 799 } |
796 | 800 |
797 SpdyAltSvcIR::SpdyAltSvcIR(SpdyStreamId stream_id) | 801 SpdyAltSvcIR::SpdyAltSvcIR(SpdyStreamId stream_id) |
798 : SpdyFrameWithStreamIdIR(stream_id) {} | 802 : SpdyFrameWithStreamIdIR(stream_id) {} |
799 | 803 |
800 void SpdyAltSvcIR::Visit(SpdyFrameVisitor* visitor) const { | 804 void SpdyAltSvcIR::Visit(SpdyFrameVisitor* visitor) const { |
801 return visitor->VisitAltSvc(*this); | 805 return visitor->VisitAltSvc(*this); |
802 } | 806 } |
803 | 807 |
804 } // namespace net | 808 } // namespace net |
OLD | NEW |