| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 return true; | 218 return true; |
| 219 case SPDY4: | 219 case SPDY4: |
| 220 case SPDY5: | 220 case SPDY5: |
| 221 // HEADER_TABLE_SIZE is the first valid setting id. | 221 // HEADER_TABLE_SIZE is the first valid setting id. |
| 222 if (setting_id_field < | 222 if (setting_id_field < |
| 223 SerializeSettingId(version, SETTINGS_HEADER_TABLE_SIZE)) { | 223 SerializeSettingId(version, SETTINGS_HEADER_TABLE_SIZE)) { |
| 224 return false; | 224 return false; |
| 225 } | 225 } |
| 226 | 226 |
| 227 // COMPRESS_DATA is the last valid setting id. | 227 // INITIAL_WINDOW_SIZE is the last valid setting id. |
| 228 if (setting_id_field > | 228 if (setting_id_field > |
| 229 SerializeSettingId(version, SETTINGS_COMPRESS_DATA)) { | 229 SerializeSettingId(version, SETTINGS_INITIAL_WINDOW_SIZE)) { |
| 230 return false; | 230 return false; |
| 231 } | 231 } |
| 232 | 232 |
| 233 return true; | 233 return true; |
| 234 } | 234 } |
| 235 | 235 |
| 236 LOG(DFATAL) << "Unhandled SPDY version " << version; | 236 LOG(DFATAL) << "Unhandled SPDY version " << version; |
| 237 return false; | 237 return false; |
| 238 } | 238 } |
| 239 | 239 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 263 case SPDY5: | 263 case SPDY5: |
| 264 switch (setting_id_field) { | 264 switch (setting_id_field) { |
| 265 case 1: | 265 case 1: |
| 266 return SETTINGS_HEADER_TABLE_SIZE; | 266 return SETTINGS_HEADER_TABLE_SIZE; |
| 267 case 2: | 267 case 2: |
| 268 return SETTINGS_ENABLE_PUSH; | 268 return SETTINGS_ENABLE_PUSH; |
| 269 case 3: | 269 case 3: |
| 270 return SETTINGS_MAX_CONCURRENT_STREAMS; | 270 return SETTINGS_MAX_CONCURRENT_STREAMS; |
| 271 case 4: | 271 case 4: |
| 272 return SETTINGS_INITIAL_WINDOW_SIZE; | 272 return SETTINGS_INITIAL_WINDOW_SIZE; |
| 273 case 5: | |
| 274 return SETTINGS_COMPRESS_DATA; | |
| 275 } | 273 } |
| 276 break; | 274 break; |
| 277 } | 275 } |
| 278 | 276 |
| 279 LOG(DFATAL) << "Unhandled setting ID " << setting_id_field; | 277 LOG(DFATAL) << "Unhandled setting ID " << setting_id_field; |
| 280 return SETTINGS_UPLOAD_BANDWIDTH; | 278 return SETTINGS_UPLOAD_BANDWIDTH; |
| 281 } | 279 } |
| 282 | 280 |
| 283 int SpdyConstants::SerializeSettingId(SpdyMajorVersion version, | 281 int SpdyConstants::SerializeSettingId(SpdyMajorVersion version, |
| 284 SpdySettingsIds id) { | 282 SpdySettingsIds id) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 308 case SPDY5: | 306 case SPDY5: |
| 309 switch (id) { | 307 switch (id) { |
| 310 case SETTINGS_HEADER_TABLE_SIZE: | 308 case SETTINGS_HEADER_TABLE_SIZE: |
| 311 return 1; | 309 return 1; |
| 312 case SETTINGS_ENABLE_PUSH: | 310 case SETTINGS_ENABLE_PUSH: |
| 313 return 2; | 311 return 2; |
| 314 case SETTINGS_MAX_CONCURRENT_STREAMS: | 312 case SETTINGS_MAX_CONCURRENT_STREAMS: |
| 315 return 3; | 313 return 3; |
| 316 case SETTINGS_INITIAL_WINDOW_SIZE: | 314 case SETTINGS_INITIAL_WINDOW_SIZE: |
| 317 return 4; | 315 return 4; |
| 318 case SETTINGS_COMPRESS_DATA: | |
| 319 return 5; | |
| 320 default: | 316 default: |
| 321 LOG(DFATAL) << "Serializing unhandled setting id " << id; | 317 LOG(DFATAL) << "Serializing unhandled setting id " << id; |
| 322 return -1; | 318 return -1; |
| 323 } | 319 } |
| 324 } | 320 } |
| 325 LOG(DFATAL) << "Unhandled SPDY version " << version; | 321 LOG(DFATAL) << "Unhandled SPDY version " << version; |
| 326 return -1; | 322 return -1; |
| 327 } | 323 } |
| 328 | 324 |
| 329 bool SpdyConstants::IsValidRstStreamStatus(SpdyMajorVersion version, | 325 bool SpdyConstants::IsValidRstStreamStatus(SpdyMajorVersion version, |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 parent_stream_id_(parent_stream_id), | 834 parent_stream_id_(parent_stream_id), |
| 839 weight_(weight), | 835 weight_(weight), |
| 840 exclusive_(exclusive) { | 836 exclusive_(exclusive) { |
| 841 } | 837 } |
| 842 | 838 |
| 843 void SpdyPriorityIR::Visit(SpdyFrameVisitor* visitor) const { | 839 void SpdyPriorityIR::Visit(SpdyFrameVisitor* visitor) const { |
| 844 return visitor->VisitPriority(*this); | 840 return visitor->VisitPriority(*this); |
| 845 } | 841 } |
| 846 | 842 |
| 847 } // namespace net | 843 } // namespace net |
| OLD | NEW |