Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(557)

Side by Side Diff: net/spdy/spdy_protocol.cc

Issue 862133002: Update from https://crrev.com/312398 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 24 matching lines...) Expand all
35 return false; 35 return false;
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:
46 // Check for recognized extensions. 45 // Check for recognized extensions.
47 if (frame_type_field == SerializeFrameType(version, ALTSVC) || 46 if (frame_type_field == SerializeFrameType(version, ALTSVC) ||
48 frame_type_field == SerializeFrameType(version, BLOCKED)) { 47 frame_type_field == SerializeFrameType(version, BLOCKED)) {
49 return true; 48 return true;
50 } 49 }
51 50
52 // DATA is the first valid frame. 51 // DATA is the first valid frame.
53 if (frame_type_field < SerializeFrameType(version, DATA)) { 52 if (frame_type_field < SerializeFrameType(version, DATA)) {
54 return false; 53 return false;
55 } 54 }
(...skipping 28 matching lines...) Expand all
84 return PING; 83 return PING;
85 case 7: 84 case 7:
86 return GOAWAY; 85 return GOAWAY;
87 case 8: 86 case 8:
88 return HEADERS; 87 return HEADERS;
89 case 9: 88 case 9:
90 return WINDOW_UPDATE; 89 return WINDOW_UPDATE;
91 } 90 }
92 break; 91 break;
93 case SPDY4: 92 case SPDY4:
94 case SPDY5:
95 switch (frame_type_field) { 93 switch (frame_type_field) {
96 case 0: 94 case 0:
97 return DATA; 95 return DATA;
98 case 1: 96 case 1:
99 return HEADERS; 97 return HEADERS;
100 case 2: 98 case 2:
101 return PRIORITY; 99 return PRIORITY;
102 case 3: 100 case 3:
103 return RST_STREAM; 101 return RST_STREAM;
104 case 4: 102 case 4:
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 return 7; 143 return 7;
146 case HEADERS: 144 case HEADERS:
147 return 8; 145 return 8;
148 case WINDOW_UPDATE: 146 case WINDOW_UPDATE:
149 return 9; 147 return 9;
150 default: 148 default:
151 LOG(DFATAL) << "Serializing unhandled frame type " << frame_type; 149 LOG(DFATAL) << "Serializing unhandled frame type " << frame_type;
152 return -1; 150 return -1;
153 } 151 }
154 case SPDY4: 152 case SPDY4:
155 case SPDY5:
156 switch (frame_type) { 153 switch (frame_type) {
157 case DATA: 154 case DATA:
158 return 0; 155 return 0;
159 case HEADERS: 156 case HEADERS:
160 return 1; 157 return 1;
161 case PRIORITY: 158 case PRIORITY:
162 return 2; 159 return 2;
163 case RST_STREAM: 160 case RST_STREAM:
164 return 3; 161 return 3;
165 case SETTINGS: 162 case SETTINGS:
(...skipping 22 matching lines...) Expand all
188 LOG(DFATAL) << "Unhandled SPDY version " << version; 185 LOG(DFATAL) << "Unhandled SPDY version " << version;
189 return -1; 186 return -1;
190 } 187 }
191 188
192 int SpdyConstants::DataFrameType(SpdyMajorVersion version) { 189 int SpdyConstants::DataFrameType(SpdyMajorVersion version) {
193 switch (version) { 190 switch (version) {
194 case SPDY2: 191 case SPDY2:
195 case SPDY3: 192 case SPDY3:
196 return 0; 193 return 0;
197 case SPDY4: 194 case SPDY4:
198 case SPDY5:
199 return SerializeFrameType(version, DATA); 195 return SerializeFrameType(version, DATA);
200 } 196 }
201 197
202 LOG(DFATAL) << "Unhandled SPDY version " << version; 198 LOG(DFATAL) << "Unhandled SPDY version " << version;
203 return 0; 199 return 0;
204 } 200 }
205 201
206 bool SpdyConstants::IsValidSettingId(SpdyMajorVersion version, 202 bool SpdyConstants::IsValidSettingId(SpdyMajorVersion version,
207 int setting_id_field) { 203 int setting_id_field) {
208 switch (version) { 204 switch (version) {
209 case SPDY2: 205 case SPDY2:
210 case SPDY3: 206 case SPDY3:
211 // UPLOAD_BANDWIDTH is the first valid setting id. 207 // UPLOAD_BANDWIDTH is the first valid setting id.
212 if (setting_id_field < 208 if (setting_id_field <
213 SerializeSettingId(version, SETTINGS_UPLOAD_BANDWIDTH)) { 209 SerializeSettingId(version, SETTINGS_UPLOAD_BANDWIDTH)) {
214 return false; 210 return false;
215 } 211 }
216 212
217 // INITIAL_WINDOW_SIZE is the last valid setting id. 213 // INITIAL_WINDOW_SIZE is the last valid setting id.
218 if (setting_id_field > 214 if (setting_id_field >
219 SerializeSettingId(version, SETTINGS_INITIAL_WINDOW_SIZE)) { 215 SerializeSettingId(version, SETTINGS_INITIAL_WINDOW_SIZE)) {
220 return false; 216 return false;
221 } 217 }
222 218
223 return true; 219 return true;
224 case SPDY4: 220 case SPDY4:
225 case SPDY5:
226 // HEADER_TABLE_SIZE is the first valid setting id. 221 // HEADER_TABLE_SIZE is the first valid setting id.
227 if (setting_id_field < 222 if (setting_id_field <
228 SerializeSettingId(version, SETTINGS_HEADER_TABLE_SIZE)) { 223 SerializeSettingId(version, SETTINGS_HEADER_TABLE_SIZE)) {
229 return false; 224 return false;
230 } 225 }
231 226
232 // MAX_HEADER_LIST_SIZE is the last valid setting id. 227 // MAX_HEADER_LIST_SIZE is the last valid setting id.
233 if (setting_id_field > 228 if (setting_id_field >
234 SerializeSettingId(version, SETTINGS_MAX_HEADER_LIST_SIZE)) { 229 SerializeSettingId(version, SETTINGS_MAX_HEADER_LIST_SIZE)) {
235 return false; 230 return false;
(...skipping 22 matching lines...) Expand all
258 return SETTINGS_MAX_CONCURRENT_STREAMS; 253 return SETTINGS_MAX_CONCURRENT_STREAMS;
259 case 5: 254 case 5:
260 return SETTINGS_CURRENT_CWND; 255 return SETTINGS_CURRENT_CWND;
261 case 6: 256 case 6:
262 return SETTINGS_DOWNLOAD_RETRANS_RATE; 257 return SETTINGS_DOWNLOAD_RETRANS_RATE;
263 case 7: 258 case 7:
264 return SETTINGS_INITIAL_WINDOW_SIZE; 259 return SETTINGS_INITIAL_WINDOW_SIZE;
265 } 260 }
266 break; 261 break;
267 case SPDY4: 262 case SPDY4:
268 case SPDY5:
269 switch (setting_id_field) { 263 switch (setting_id_field) {
270 case 1: 264 case 1:
271 return SETTINGS_HEADER_TABLE_SIZE; 265 return SETTINGS_HEADER_TABLE_SIZE;
272 case 2: 266 case 2:
273 return SETTINGS_ENABLE_PUSH; 267 return SETTINGS_ENABLE_PUSH;
274 case 3: 268 case 3:
275 return SETTINGS_MAX_CONCURRENT_STREAMS; 269 return SETTINGS_MAX_CONCURRENT_STREAMS;
276 case 4: 270 case 4:
277 return SETTINGS_INITIAL_WINDOW_SIZE; 271 return SETTINGS_INITIAL_WINDOW_SIZE;
278 case 5: 272 case 5:
(...skipping 26 matching lines...) Expand all
305 return 5; 299 return 5;
306 case SETTINGS_DOWNLOAD_RETRANS_RATE: 300 case SETTINGS_DOWNLOAD_RETRANS_RATE:
307 return 6; 301 return 6;
308 case SETTINGS_INITIAL_WINDOW_SIZE: 302 case SETTINGS_INITIAL_WINDOW_SIZE:
309 return 7; 303 return 7;
310 default: 304 default:
311 LOG(DFATAL) << "Serializing unhandled setting id " << id; 305 LOG(DFATAL) << "Serializing unhandled setting id " << id;
312 return -1; 306 return -1;
313 } 307 }
314 case SPDY4: 308 case SPDY4:
315 case SPDY5:
316 switch (id) { 309 switch (id) {
317 case SETTINGS_HEADER_TABLE_SIZE: 310 case SETTINGS_HEADER_TABLE_SIZE:
318 return 1; 311 return 1;
319 case SETTINGS_ENABLE_PUSH: 312 case SETTINGS_ENABLE_PUSH:
320 return 2; 313 return 2;
321 case SETTINGS_MAX_CONCURRENT_STREAMS: 314 case SETTINGS_MAX_CONCURRENT_STREAMS:
322 return 3; 315 return 3;
323 case SETTINGS_INITIAL_WINDOW_SIZE: 316 case SETTINGS_INITIAL_WINDOW_SIZE:
324 return 4; 317 return 4;
325 case SETTINGS_MAX_FRAME_SIZE: 318 case SETTINGS_MAX_FRAME_SIZE:
(...skipping 21 matching lines...) Expand all
347 } 340 }
348 341
349 // FRAME_TOO_LARGE is the valid last status code. 342 // FRAME_TOO_LARGE is the valid last status code.
350 if (rst_stream_status_field > 343 if (rst_stream_status_field >
351 SerializeRstStreamStatus(version, RST_STREAM_FRAME_TOO_LARGE)) { 344 SerializeRstStreamStatus(version, RST_STREAM_FRAME_TOO_LARGE)) {
352 return false; 345 return false;
353 } 346 }
354 347
355 return true; 348 return true;
356 case SPDY4: 349 case SPDY4:
357 case SPDY5:
358 // NO_ERROR is the first valid status code. 350 // NO_ERROR is the first valid status code.
359 if (rst_stream_status_field < 351 if (rst_stream_status_field <
360 SerializeRstStreamStatus(version, RST_STREAM_PROTOCOL_ERROR)) { 352 SerializeRstStreamStatus(version, RST_STREAM_PROTOCOL_ERROR)) {
361 return false; 353 return false;
362 } 354 }
363 355
364 // TODO(hkhalil): Omit COMPRESSION_ERROR and SETTINGS_TIMEOUT 356 // TODO(hkhalil): Omit COMPRESSION_ERROR and SETTINGS_TIMEOUT
365 /* 357 /*
366 // This works because GOAWAY and RST_STREAM share a namespace. 358 // This works because GOAWAY and RST_STREAM share a namespace.
367 if (rst_stream_status_field == 359 if (rst_stream_status_field ==
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 return RST_STREAM_STREAM_IN_USE; 401 return RST_STREAM_STREAM_IN_USE;
410 case 9: 402 case 9:
411 return RST_STREAM_STREAM_ALREADY_CLOSED; 403 return RST_STREAM_STREAM_ALREADY_CLOSED;
412 case 10: 404 case 10:
413 return RST_STREAM_INVALID_CREDENTIALS; 405 return RST_STREAM_INVALID_CREDENTIALS;
414 case 11: 406 case 11:
415 return RST_STREAM_FRAME_TOO_LARGE; 407 return RST_STREAM_FRAME_TOO_LARGE;
416 } 408 }
417 break; 409 break;
418 case SPDY4: 410 case SPDY4:
419 case SPDY5:
420 switch (rst_stream_status_field) { 411 switch (rst_stream_status_field) {
421 case 1: 412 case 1:
422 return RST_STREAM_PROTOCOL_ERROR; 413 return RST_STREAM_PROTOCOL_ERROR;
423 case 2: 414 case 2:
424 return RST_STREAM_INTERNAL_ERROR; 415 return RST_STREAM_INTERNAL_ERROR;
425 case 3: 416 case 3:
426 return RST_STREAM_FLOW_CONTROL_ERROR; 417 return RST_STREAM_FLOW_CONTROL_ERROR;
427 case 5: 418 case 5:
428 return RST_STREAM_STREAM_CLOSED; 419 return RST_STREAM_STREAM_CLOSED;
429 case 6: 420 case 6:
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 case RST_STREAM_INVALID_CREDENTIALS: 467 case RST_STREAM_INVALID_CREDENTIALS:
477 return 10; 468 return 10;
478 case RST_STREAM_FRAME_TOO_LARGE: 469 case RST_STREAM_FRAME_TOO_LARGE:
479 return 11; 470 return 11;
480 default: 471 default:
481 LOG(DFATAL) << "Unhandled RST_STREAM status " 472 LOG(DFATAL) << "Unhandled RST_STREAM status "
482 << rst_stream_status; 473 << rst_stream_status;
483 return -1; 474 return -1;
484 } 475 }
485 case SPDY4: 476 case SPDY4:
486 case SPDY5:
487 switch (rst_stream_status) { 477 switch (rst_stream_status) {
488 case RST_STREAM_PROTOCOL_ERROR: 478 case RST_STREAM_PROTOCOL_ERROR:
489 return 1; 479 return 1;
490 case RST_STREAM_INTERNAL_ERROR: 480 case RST_STREAM_INTERNAL_ERROR:
491 return 2; 481 return 2;
492 case RST_STREAM_FLOW_CONTROL_ERROR: 482 case RST_STREAM_FLOW_CONTROL_ERROR:
493 return 3; 483 return 3;
494 case RST_STREAM_STREAM_CLOSED: 484 case RST_STREAM_STREAM_CLOSED:
495 return 5; 485 return 5;
496 case RST_STREAM_FRAME_SIZE_ERROR: 486 case RST_STREAM_FRAME_SIZE_ERROR:
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 } 518 }
529 519
530 // GOAWAY_INTERNAL_ERROR is the last valid status. 520 // GOAWAY_INTERNAL_ERROR is the last valid status.
531 if (goaway_status_field > SerializeGoAwayStatus(version, 521 if (goaway_status_field > SerializeGoAwayStatus(version,
532 GOAWAY_INTERNAL_ERROR)) { 522 GOAWAY_INTERNAL_ERROR)) {
533 return false; 523 return false;
534 } 524 }
535 525
536 return true; 526 return true;
537 case SPDY4: 527 case SPDY4:
538 case SPDY5:
539 // GOAWAY_NO_ERROR is the first valid status. 528 // GOAWAY_NO_ERROR is the first valid status.
540 if (goaway_status_field < SerializeGoAwayStatus(version, 529 if (goaway_status_field < SerializeGoAwayStatus(version,
541 GOAWAY_NO_ERROR)) { 530 GOAWAY_NO_ERROR)) {
542 return false; 531 return false;
543 } 532 }
544 533
545 // GOAWAY_HTTP_1_1_REQUIRED is the last valid status. 534 // GOAWAY_HTTP_1_1_REQUIRED is the last valid status.
546 if (goaway_status_field > 535 if (goaway_status_field >
547 SerializeGoAwayStatus(version, GOAWAY_HTTP_1_1_REQUIRED)) { 536 SerializeGoAwayStatus(version, GOAWAY_HTTP_1_1_REQUIRED)) {
548 return false; 537 return false;
(...skipping 13 matching lines...) Expand all
562 switch (goaway_status_field) { 551 switch (goaway_status_field) {
563 case 0: 552 case 0:
564 return GOAWAY_OK; 553 return GOAWAY_OK;
565 case 1: 554 case 1:
566 return GOAWAY_PROTOCOL_ERROR; 555 return GOAWAY_PROTOCOL_ERROR;
567 case 2: 556 case 2:
568 return GOAWAY_INTERNAL_ERROR; 557 return GOAWAY_INTERNAL_ERROR;
569 } 558 }
570 break; 559 break;
571 case SPDY4: 560 case SPDY4:
572 case SPDY5:
573 switch (goaway_status_field) { 561 switch (goaway_status_field) {
574 case 0: 562 case 0:
575 return GOAWAY_NO_ERROR; 563 return GOAWAY_NO_ERROR;
576 case 1: 564 case 1:
577 return GOAWAY_PROTOCOL_ERROR; 565 return GOAWAY_PROTOCOL_ERROR;
578 case 2: 566 case 2:
579 return GOAWAY_INTERNAL_ERROR; 567 return GOAWAY_INTERNAL_ERROR;
580 case 3: 568 case 3:
581 return GOAWAY_FLOW_CONTROL_ERROR; 569 return GOAWAY_FLOW_CONTROL_ERROR;
582 case 4: 570 case 4:
(...skipping 25 matching lines...) Expand all
608 } 596 }
609 597
610 SpdyMajorVersion SpdyConstants::ParseMajorVersion(int version_number) { 598 SpdyMajorVersion SpdyConstants::ParseMajorVersion(int version_number) {
611 switch (version_number) { 599 switch (version_number) {
612 case 2: 600 case 2:
613 return SPDY2; 601 return SPDY2;
614 case 3: 602 case 3:
615 return SPDY3; 603 return SPDY3;
616 case 4: 604 case 4:
617 return SPDY4; 605 return SPDY4;
618 case 5:
619 return SPDY5;
620 default: 606 default:
621 LOG(DFATAL) << "Unsupported SPDY version number: " << version_number; 607 LOG(DFATAL) << "Unsupported SPDY version number: " << version_number;
622 return SPDY3; 608 return SPDY3;
623 } 609 }
624 } 610 }
625 611
626 int SpdyConstants::SerializeMajorVersion(SpdyMajorVersion version) { 612 int SpdyConstants::SerializeMajorVersion(SpdyMajorVersion version) {
627 switch (version) { 613 switch (version) {
628 case SPDY2: 614 case SPDY2:
629 return 2; 615 return 2;
630 case SPDY3: 616 case SPDY3:
631 return 3; 617 return 3;
632 case SPDY4: 618 case SPDY4:
633 return 4; 619 return 4;
634 case SPDY5:
635 return 5;
636 default: 620 default:
637 LOG(DFATAL) << "Unsupported SPDY major version: " << version; 621 LOG(DFATAL) << "Unsupported SPDY major version: " << version;
638 return -1; 622 return -1;
639 } 623 }
640 } 624 }
641 625
642 std::string SpdyConstants::GetVersionString(SpdyMajorVersion version) { 626 std::string SpdyConstants::GetVersionString(SpdyMajorVersion version) {
643 switch (version) { 627 switch (version) {
644 case SPDY2: 628 case SPDY2:
645 return "spdy/2"; 629 return "spdy/2";
646 case SPDY3: 630 case SPDY3:
647 return "spdy/3"; 631 return "spdy/3";
648 case SPDY4: 632 case SPDY4:
649 return "spdy/4"; 633 return "h2-14";
650 case SPDY5:
651 return "spdy/5";
652 default: 634 default:
653 LOG(DFATAL) << "Unsupported SPDY major version: " << version; 635 LOG(DFATAL) << "Unsupported SPDY major version: " << version;
654 return "spdy/3"; 636 return "spdy/3";
655 } 637 }
656 } 638 }
657 639
658 int SpdyConstants::SerializeGoAwayStatus(SpdyMajorVersion version, 640 int SpdyConstants::SerializeGoAwayStatus(SpdyMajorVersion version,
659 SpdyGoAwayStatus status) { 641 SpdyGoAwayStatus status) {
660 switch (version) { 642 switch (version) {
661 case SPDY2: 643 case SPDY2:
(...skipping 14 matching lines...) Expand all
676 case GOAWAY_CONNECT_ERROR: 658 case GOAWAY_CONNECT_ERROR:
677 case GOAWAY_ENHANCE_YOUR_CALM: 659 case GOAWAY_ENHANCE_YOUR_CALM:
678 case GOAWAY_INADEQUATE_SECURITY: 660 case GOAWAY_INADEQUATE_SECURITY:
679 case GOAWAY_HTTP_1_1_REQUIRED: 661 case GOAWAY_HTTP_1_1_REQUIRED:
680 return 1; // PROTOCOL_ERROR. 662 return 1; // PROTOCOL_ERROR.
681 default: 663 default:
682 LOG(DFATAL) << "Serializing unhandled GOAWAY status " << status; 664 LOG(DFATAL) << "Serializing unhandled GOAWAY status " << status;
683 return -1; 665 return -1;
684 } 666 }
685 case SPDY4: 667 case SPDY4:
686 case SPDY5:
687 switch (status) { 668 switch (status) {
688 case GOAWAY_NO_ERROR: 669 case GOAWAY_NO_ERROR:
689 return 0; 670 return 0;
690 case GOAWAY_PROTOCOL_ERROR: 671 case GOAWAY_PROTOCOL_ERROR:
691 return 1; 672 return 1;
692 case GOAWAY_INTERNAL_ERROR: 673 case GOAWAY_INTERNAL_ERROR:
693 return 2; 674 return 2;
694 case GOAWAY_FLOW_CONTROL_ERROR: 675 case GOAWAY_FLOW_CONTROL_ERROR:
695 return 3; 676 return 3;
696 case GOAWAY_SETTINGS_TIMEOUT: 677 case GOAWAY_SETTINGS_TIMEOUT:
(...skipping 24 matching lines...) Expand all
721 LOG(DFATAL) << "Unknown SpdyMajorVersion " << version; 702 LOG(DFATAL) << "Unknown SpdyMajorVersion " << version;
722 return -1; 703 return -1;
723 } 704 }
724 705
725 size_t SpdyConstants::GetDataFrameMinimumSize(SpdyMajorVersion version) { 706 size_t SpdyConstants::GetDataFrameMinimumSize(SpdyMajorVersion version) {
726 switch (version) { 707 switch (version) {
727 case SPDY2: 708 case SPDY2:
728 case SPDY3: 709 case SPDY3:
729 return 8; 710 return 8;
730 case SPDY4: 711 case SPDY4:
731 case SPDY5:
732 return 9; 712 return 9;
733 } 713 }
734 LOG(DFATAL) << "Unhandled SPDY version."; 714 LOG(DFATAL) << "Unhandled SPDY version.";
735 return 0; 715 return 0;
736 } 716 }
737 717
738 size_t SpdyConstants::GetControlFrameHeaderSize(SpdyMajorVersion version) { 718 size_t SpdyConstants::GetControlFrameHeaderSize(SpdyMajorVersion version) {
739 switch (version) { 719 switch (version) {
740 case SPDY2: 720 case SPDY2:
741 case SPDY3: 721 case SPDY3:
742 return 8; 722 return 8;
743 case SPDY4: 723 case SPDY4:
744 case SPDY5:
745 return 9; 724 return 9;
746 } 725 }
747 LOG(DFATAL) << "Unhandled SPDY version."; 726 LOG(DFATAL) << "Unhandled SPDY version.";
748 return 0; 727 return 0;
749 } 728 }
750 729
751 size_t SpdyConstants::GetPrefixLength(SpdyFrameType type, 730 size_t SpdyConstants::GetPrefixLength(SpdyFrameType type,
752 SpdyMajorVersion version) { 731 SpdyMajorVersion version) {
753 if (type != DATA) { 732 if (type != DATA) {
754 return GetControlFrameHeaderSize(version); 733 return GetControlFrameHeaderSize(version);
(...skipping 16 matching lines...) Expand all
771 } 750 }
772 751
773 size_t SpdyConstants::GetSizeOfSizeField(SpdyMajorVersion version) { 752 size_t SpdyConstants::GetSizeOfSizeField(SpdyMajorVersion version) {
774 return (version < SPDY3) ? sizeof(uint16) : sizeof(uint32); 753 return (version < SPDY3) ? sizeof(uint16) : sizeof(uint32);
775 } 754 }
776 755
777 size_t SpdyConstants::GetSettingSize(SpdyMajorVersion version) { 756 size_t SpdyConstants::GetSettingSize(SpdyMajorVersion version) {
778 return version <= SPDY3 ? 8 : 6; 757 return version <= SPDY3 ? 8 : 6;
779 } 758 }
780 759
760 int32 SpdyConstants::GetInitialStreamWindowSize(SpdyMajorVersion version) {
761 return (version <= SPDY3) ? (64 * 1024) : (64 * 1024 - 1);
762 }
763
764 int32 SpdyConstants::GetInitialSessionWindowSize(SpdyMajorVersion version) {
765 return (version <= SPDY3) ? (64 * 1024) : (64 * 1024 - 1);
766 }
767
781 void SpdyDataIR::Visit(SpdyFrameVisitor* visitor) const { 768 void SpdyDataIR::Visit(SpdyFrameVisitor* visitor) const {
782 return visitor->VisitData(*this); 769 return visitor->VisitData(*this);
783 } 770 }
784 771
785 void SpdySynStreamIR::Visit(SpdyFrameVisitor* visitor) const { 772 void SpdySynStreamIR::Visit(SpdyFrameVisitor* visitor) const {
786 return visitor->VisitSynStream(*this); 773 return visitor->VisitSynStream(*this);
787 } 774 }
788 775
789 void SpdySynReplyIR::Visit(SpdyFrameVisitor* visitor) const { 776 void SpdySynReplyIR::Visit(SpdyFrameVisitor* visitor) const {
790 return visitor->VisitSynReply(*this); 777 return visitor->VisitSynReply(*this);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 parent_stream_id_(parent_stream_id), 864 parent_stream_id_(parent_stream_id),
878 weight_(weight), 865 weight_(weight),
879 exclusive_(exclusive) { 866 exclusive_(exclusive) {
880 } 867 }
881 868
882 void SpdyPriorityIR::Visit(SpdyFrameVisitor* visitor) const { 869 void SpdyPriorityIR::Visit(SpdyFrameVisitor* visitor) const {
883 return visitor->VisitPriority(*this); 870 return visitor->VisitPriority(*this);
884 } 871 }
885 872
886 } // namespace net 873 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_protocol.h ('k') | net/spdy/spdy_session.h » ('j') | shell/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698