1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/spdy/spdy_protocol.h"
namespace net {
bool SpdyConstants::IsValidFrameType(SpdyMajorVersion version,
int frame_type_field) {
switch (version) {
case SPDY3:
// SYN_STREAM is the first valid frame.
if (frame_type_field < SerializeFrameType(version, SYN_STREAM)) {
return false;
}
// WINDOW_UPDATE is the last valid frame.
if (frame_type_field > SerializeFrameType(version, WINDOW_UPDATE)) {
return false;
}
return true;
case HTTP2:
// Check for recognized extensions.
if (frame_type_field == SerializeFrameType(version, ALTSVC) ||
frame_type_field == SerializeFrameType(version, BLOCKED)) {
return true;
}
// DATA is the first valid frame.
if (frame_type_field < SerializeFrameType(version, DATA)) {
return false;
}
// CONTINUATION is the last valid frame.
if (frame_type_field > SerializeFrameType(version, CONTINUATION)) {
return false;
}
return true;
}
LOG(DFATAL) << "Unhandled SPDY version " << version;
return false;
}
SpdyFrameType SpdyConstants::ParseFrameType(SpdyMajorVersion version,
int frame_type_field) {
switch (version) {
case SPDY3:
switch (frame_type_field) {
case 1:
return SYN_STREAM;
case 2:
return SYN_REPLY;
case 3:
return RST_STREAM;
case 4:
return SETTINGS;
case 6:
return PING;
case 7:
return GOAWAY;
case 8:
return HEADERS;
case 9:
return WINDOW_UPDATE;
}
break;
case HTTP2:
switch (frame_type_field) {
case 0:
return DATA;
case 1:
return HEADERS;
case 2:
return PRIORITY;
case 3:
return RST_STREAM;
case 4:
return SETTINGS;
case 5:
return PUSH_PROMISE;
case 6:
return PING;
case 7:
return GOAWAY;
case 8:
return WINDOW_UPDATE;
case 9:
return CONTINUATION;
case 10:
return ALTSVC;
case 11:
return BLOCKED;
}
break;
}
LOG(DFATAL) << "Unhandled frame type " << frame_type_field;
return DATA;
}
int SpdyConstants::SerializeFrameType(SpdyMajorVersion version,
SpdyFrameType frame_type) {
switch (version) {
case SPDY3:
switch (frame_type) {
case SYN_STREAM:
return 1;
case SYN_REPLY:
return 2;
case RST_STREAM:
return 3;
case SETTINGS:
return 4;
case PING:
return 6;
case GOAWAY:
return 7;
case HEADERS:
return 8;
case WINDOW_UPDATE:
return 9;
default:
LOG(DFATAL) << "Serializing unhandled frame type " << frame_type;
return -1;
}
case HTTP2:
switch (frame_type) {
case DATA:
return 0;
case HEADERS:
return 1;
case PRIORITY:
return 2;
case RST_STREAM:
return 3;
case SETTINGS:
return 4;
case PUSH_PROMISE:
return 5;
case PING:
return 6;
case GOAWAY:
return 7;
case WINDOW_UPDATE:
return 8;
case CONTINUATION:
return 9;
// ALTSVC and BLOCKED are extensions.
case ALTSVC:
return 10;
case BLOCKED:
return 11;
default:
LOG(DFATAL) << "Serializing unhandled frame type " << frame_type;
return -1;
}
}
LOG(DFATAL) << "Unhandled SPDY version " << version;
return -1;
}
int SpdyConstants::DataFrameType(SpdyMajorVersion version) {
switch (version) {
case SPDY3:
return 0;
case HTTP2:
return SerializeFrameType(version, DATA);
}
LOG(DFATAL) << "Unhandled SPDY version " << version;
return 0;
}
bool SpdyConstants::IsValidSettingId(SpdyMajorVersion version,
int setting_id_field) {
switch (version) {
case SPDY3:
// UPLOAD_BANDWIDTH is the first valid setting id.
if (setting_id_field <
SerializeSettingId(version, SETTINGS_UPLOAD_BANDWIDTH)) {
return false;
}
// INITIAL_WINDOW_SIZE is the last valid setting id.
if (setting_id_field >
SerializeSettingId(version, SETTINGS_INITIAL_WINDOW_SIZE)) {
return false;
}
return true;
case HTTP2:
// HEADER_TABLE_SIZE is the first valid setting id.
if (setting_id_field <
SerializeSettingId(version, SETTINGS_HEADER_TABLE_SIZE)) {
return false;
}
// MAX_HEADER_LIST_SIZE is the last valid setting id.
if (setting_id_field >
SerializeSettingId(version, SETTINGS_MAX_HEADER_LIST_SIZE)) {
return false;
}
return true;
}
LOG(DFATAL) << "Unhandled SPDY version " << version;
return false;
}
SpdySettingsIds SpdyConstants::ParseSettingId(SpdyMajorVersion version,
int setting_id_field) {
switch (version) {
case SPDY3:
switch (setting_id_field) {
case 1:
return SETTINGS_UPLOAD_BANDWIDTH;
case 2:
return SETTINGS_DOWNLOAD_BANDWIDTH;
case 3:
return SETTINGS_ROUND_TRIP_TIME;
case 4:
return SETTINGS_MAX_CONCURRENT_STREAMS;
case 5:
return SETTINGS_CURRENT_CWND;
case 6:
return SETTINGS_DOWNLOAD_RETRANS_RATE;
case 7:
return SETTINGS_INITIAL_WINDOW_SIZE;
}
break;
case HTTP2:
switch (setting_id_field) {
case 1:
return SETTINGS_HEADER_TABLE_SIZE;
case 2:
return SETTINGS_ENABLE_PUSH;
case 3:
return SETTINGS_MAX_CONCURRENT_STREAMS;
case 4:
return SETTINGS_INITIAL_WINDOW_SIZE;
case 5:
return SETTINGS_MAX_FRAME_SIZE;
case 6:
return SETTINGS_MAX_HEADER_LIST_SIZE;
}
break;
}
LOG(DFATAL) << "Unhandled setting ID " << setting_id_field;
return SETTINGS_UPLOAD_BANDWIDTH;
}
int SpdyConstants::SerializeSettingId(SpdyMajorVersion version,
SpdySettingsIds id) {
switch (version) {
case SPDY3:
switch (id) {
case SETTINGS_UPLOAD_BANDWIDTH:
return 1;
case SETTINGS_DOWNLOAD_BANDWIDTH:
return 2;
case SETTINGS_ROUND_TRIP_TIME:
return 3;
case SETTINGS_MAX_CONCURRENT_STREAMS:
return 4;
case SETTINGS_CURRENT_CWND:
return 5;
case SETTINGS_DOWNLOAD_RETRANS_RATE:
return 6;
case SETTINGS_INITIAL_WINDOW_SIZE:
return 7;
default:
LOG(DFATAL) << "Serializing unhandled setting id " << id;
return -1;
}
case HTTP2:
switch (id) {
case SETTINGS_HEADER_TABLE_SIZE:
return 1;
case SETTINGS_ENABLE_PUSH:
return 2;
case SETTINGS_MAX_CONCURRENT_STREAMS:
return 3;
case SETTINGS_INITIAL_WINDOW_SIZE:
return 4;
case SETTINGS_MAX_FRAME_SIZE:
return 5;
case SETTINGS_MAX_HEADER_LIST_SIZE:
return 6;
default:
LOG(DFATAL) << "Serializing unhandled setting id " << id;
return -1;
}
}
LOG(DFATAL) << "Unhandled SPDY version " << version;
return -1;
}
bool SpdyConstants::IsValidRstStreamStatus(SpdyMajorVersion version,
int rst_stream_status_field) {
switch (version) {
case SPDY3:
// PROTOCOL_ERROR is the valid first status code.
if (rst_stream_status_field <
SerializeRstStreamStatus(version, RST_STREAM_PROTOCOL_ERROR)) {
return false;
}
// FRAME_TOO_LARGE is the valid last status code.
if (rst_stream_status_field >
SerializeRstStreamStatus(version, RST_STREAM_FRAME_TOO_LARGE)) {
return false;
}
return true;
case HTTP2:
// NO_ERROR is the first valid status code.
if (rst_stream_status_field <
SerializeRstStreamStatus(version, RST_STREAM_PROTOCOL_ERROR)) {
return false;
}
// TODO(hkhalil): Omit COMPRESSION_ERROR and SETTINGS_TIMEOUT
/*
// This works because GOAWAY and RST_STREAM share a namespace.
if (rst_stream_status_field ==
SerializeGoAwayStatus(version, GOAWAY_COMPRESSION_ERROR) ||
rst_stream_status_field ==
SerializeGoAwayStatus(version, GOAWAY_SETTINGS_TIMEOUT)) {
return false;
}
*/
// HTTP_1_1_REQUIRED is the last valid status code.
if (rst_stream_status_field >
SerializeRstStreamStatus(version, RST_STREAM_HTTP_1_1_REQUIRED)) {
return false;
}
return true;
}
LOG(DFATAL) << "Unhandled SPDY version " << version;
return false;
}
SpdyRstStreamStatus SpdyConstants::ParseRstStreamStatus(
SpdyMajorVersion version,
int rst_stream_status_field) {
switch (version) {
case SPDY3:
switch (rst_stream_status_field) {
case 1:
return RST_STREAM_PROTOCOL_ERROR;
case 2:
return RST_STREAM_INVALID_STREAM;
case 3:
return RST_STREAM_REFUSED_STREAM;
case 4:
return RST_STREAM_UNSUPPORTED_VERSION;
case 5:
return RST_STREAM_CANCEL;
case 6:
return RST_STREAM_INTERNAL_ERROR;
case 7:
return RST_STREAM_FLOW_CONTROL_ERROR;
case 8:
return RST_STREAM_STREAM_IN_USE;
case 9:
return RST_STREAM_STREAM_ALREADY_CLOSED;
case 11:
return RST_STREAM_FRAME_TOO_LARGE;
}
break;
case HTTP2:
switch (rst_stream_status_field) {
case 1:
return RST_STREAM_PROTOCOL_ERROR;
case 2:
return RST_STREAM_INTERNAL_ERROR;
case 3:
return RST_STREAM_FLOW_CONTROL_ERROR;
case 5:
return RST_STREAM_STREAM_CLOSED;
case 6:
return RST_STREAM_FRAME_SIZE_ERROR;
case 7:
return RST_STREAM_REFUSED_STREAM;
case 8:
return RST_STREAM_CANCEL;
case 10:
return RST_STREAM_CONNECT_ERROR;
case 11:
return RST_STREAM_ENHANCE_YOUR_CALM;
case 12:
return RST_STREAM_INADEQUATE_SECURITY;
case 13:
return RST_STREAM_HTTP_1_1_REQUIRED;
}
break;
}
LOG(DFATAL) << "Invalid RST_STREAM status " << rst_stream_status_field;
return RST_STREAM_PROTOCOL_ERROR;
}
int SpdyConstants::SerializeRstStreamStatus(
SpdyMajorVersion version,
SpdyRstStreamStatus rst_stream_status) {
switch (version) {
case SPDY3:
switch (rst_stream_status) {
case RST_STREAM_PROTOCOL_ERROR:
return 1;
case RST_STREAM_INVALID_STREAM:
return 2;
case RST_STREAM_REFUSED_STREAM:
return 3;
case RST_STREAM_UNSUPPORTED_VERSION:
return 4;
case RST_STREAM_CANCEL:
return 5;
case RST_STREAM_INTERNAL_ERROR:
return 6;
case RST_STREAM_FLOW_CONTROL_ERROR:
return 7;
case RST_STREAM_STREAM_IN_USE:
return 8;
case RST_STREAM_STREAM_ALREADY_CLOSED:
return 9;
case RST_STREAM_FRAME_TOO_LARGE:
return 11;
default:
LOG(DFATAL) << "Unhandled RST_STREAM status "
<< rst_stream_status;
return -1;
}
case HTTP2:
switch (rst_stream_status) {
case RST_STREAM_PROTOCOL_ERROR:
return 1;
case RST_STREAM_INTERNAL_ERROR:
return 2;
case RST_STREAM_FLOW_CONTROL_ERROR:
return 3;
case RST_STREAM_STREAM_CLOSED:
return 5;
case RST_STREAM_FRAME_SIZE_ERROR:
return 6;
case RST_STREAM_REFUSED_STREAM:
return 7;
case RST_STREAM_CANCEL:
return 8;
case RST_STREAM_CONNECT_ERROR:
return 10;
case RST_STREAM_ENHANCE_YOUR_CALM:
return 11;
case RST_STREAM_INADEQUATE_SECURITY:
return 12;
case RST_STREAM_HTTP_1_1_REQUIRED:
return 13;
default:
LOG(DFATAL) << "Unhandled RST_STREAM status "
<< rst_stream_status;
return -1;
}
}
LOG(DFATAL) << "Unhandled SPDY version " << version;
return -1;
}
bool SpdyConstants::IsValidGoAwayStatus(SpdyMajorVersion version,
int goaway_status_field) {
switch (version) {
case SPDY3:
// GOAWAY_OK is the first valid status.
if (goaway_status_field < SerializeGoAwayStatus(version, GOAWAY_OK)) {
return false;
}
// GOAWAY_INTERNAL_ERROR is the last valid status.
if (goaway_status_field > SerializeGoAwayStatus(version,
GOAWAY_INTERNAL_ERROR)) {
return false;
}
return true;
case HTTP2:
// GOAWAY_NO_ERROR is the first valid status.
if (goaway_status_field < SerializeGoAwayStatus(version,
GOAWAY_NO_ERROR)) {
return false;
}
// GOAWAY_HTTP_1_1_REQUIRED is the last valid status.
if (goaway_status_field >
SerializeGoAwayStatus(version, GOAWAY_HTTP_1_1_REQUIRED)) {
return false;
}
return true;
}
LOG(DFATAL) << "Unknown SpdyMajorVersion " << version;
return false;
}
SpdyGoAwayStatus SpdyConstants::ParseGoAwayStatus(SpdyMajorVersion version,
int goaway_status_field) {
switch (version) {
case SPDY3:
switch (goaway_status_field) {
case 0:
return GOAWAY_OK;
case 1:
return GOAWAY_PROTOCOL_ERROR;
case 2:
return GOAWAY_INTERNAL_ERROR;
}
break;
case HTTP2:
switch (goaway_status_field) {
case 0:
return GOAWAY_NO_ERROR;
case 1:
return GOAWAY_PROTOCOL_ERROR;
case 2:
return GOAWAY_INTERNAL_ERROR;
case 3:
return GOAWAY_FLOW_CONTROL_ERROR;
case 4:
return GOAWAY_SETTINGS_TIMEOUT;
case 5:
return GOAWAY_STREAM_CLOSED;
case 6:
return GOAWAY_FRAME_SIZE_ERROR;
case 7:
return GOAWAY_REFUSED_STREAM;
case 8:
return GOAWAY_CANCEL;
case 9:
return GOAWAY_COMPRESSION_ERROR;
case 10:
return GOAWAY_CONNECT_ERROR;
case 11:
return GOAWAY_ENHANCE_YOUR_CALM;
case 12:
return GOAWAY_INADEQUATE_SECURITY;
case 13:
return GOAWAY_HTTP_1_1_REQUIRED;
}
break;
}
LOG(DFATAL) << "Unhandled GOAWAY status " << goaway_status_field;
return GOAWAY_PROTOCOL_ERROR;
}
int SpdyConstants::SerializeGoAwayStatus(SpdyMajorVersion version,
SpdyGoAwayStatus status) {
switch (version) {
case SPDY3:
// TODO(jgraettinger): Merge this back to server-side.
switch (status) {
case GOAWAY_NO_ERROR:
return 0;
case GOAWAY_PROTOCOL_ERROR:
case GOAWAY_INTERNAL_ERROR:
case GOAWAY_FLOW_CONTROL_ERROR:
case GOAWAY_SETTINGS_TIMEOUT:
case GOAWAY_STREAM_CLOSED:
case GOAWAY_FRAME_SIZE_ERROR:
case GOAWAY_REFUSED_STREAM:
case GOAWAY_CANCEL:
case GOAWAY_COMPRESSION_ERROR:
case GOAWAY_CONNECT_ERROR:
case GOAWAY_ENHANCE_YOUR_CALM:
case GOAWAY_INADEQUATE_SECURITY:
case GOAWAY_HTTP_1_1_REQUIRED:
return 1; // PROTOCOL_ERROR.
default:
LOG(DFATAL) << "Serializing unhandled GOAWAY status " << status;
return -1;
}
case HTTP2:
switch (status) {
case GOAWAY_NO_ERROR:
return 0;
case GOAWAY_PROTOCOL_ERROR:
return 1;
case GOAWAY_INTERNAL_ERROR:
return 2;
case GOAWAY_FLOW_CONTROL_ERROR:
return 3;
case GOAWAY_SETTINGS_TIMEOUT:
return 4;
case GOAWAY_STREAM_CLOSED:
return 5;
case GOAWAY_FRAME_SIZE_ERROR:
return 6;
case GOAWAY_REFUSED_STREAM:
return 7;
case GOAWAY_CANCEL:
return 8;
case GOAWAY_COMPRESSION_ERROR:
return 9;
case GOAWAY_CONNECT_ERROR:
return 10;
case GOAWAY_ENHANCE_YOUR_CALM:
return 11;
case GOAWAY_INADEQUATE_SECURITY:
return 12;
case GOAWAY_HTTP_1_1_REQUIRED:
return 13;
default:
LOG(DFATAL) << "Serializing unhandled GOAWAY status " << status;
return -1;
}
}
LOG(DFATAL) << "Unknown SpdyMajorVersion " << version;
return -1;
}
size_t SpdyConstants::GetDataFrameMinimumSize(SpdyMajorVersion version) {
switch (version) {
case SPDY3:
return 8;
case HTTP2:
return 9;
}
LOG(DFATAL) << "Unhandled SPDY version.";
return 0;
}
size_t SpdyConstants::GetControlFrameHeaderSize(SpdyMajorVersion version) {
switch (version) {
case SPDY3:
return 8;
case HTTP2:
return 9;
}
LOG(DFATAL) << "Unhandled SPDY version.";
return 0;
}
size_t SpdyConstants::GetPrefixLength(SpdyFrameType type,
SpdyMajorVersion version) {
if (type != DATA) {
return GetControlFrameHeaderSize(version);
} else {
return GetDataFrameMinimumSize(version);
}
}
size_t SpdyConstants::GetFrameMaximumSize(SpdyMajorVersion version) {
if (version == SPDY3) {
// 24-bit length field plus eight-byte frame header.
return ((1 << 24) - 1) + 8;
} else {
// Max payload of 2^14 plus nine-byte frame header.
// TODO(mlavan): In HTTP/2 this is actually not a constant;
// payload size can be set using the MAX_FRAME_SIZE setting to
// anything between 1 << 14 and (1 << 24) - 1
return (1 << 14) + 9;
}
}
size_t SpdyConstants::GetSizeOfSizeField() {
return sizeof(uint32_t);
}
size_t SpdyConstants::GetSettingSize(SpdyMajorVersion version) {
return version == SPDY3 ? 8 : 6;
}
int32_t SpdyConstants::GetInitialStreamWindowSize(SpdyMajorVersion version) {
return (version == SPDY3) ? (64 * 1024) : (64 * 1024 - 1);
}
int32_t SpdyConstants::GetInitialSessionWindowSize(SpdyMajorVersion version) {
return (version == SPDY3) ? (64 * 1024) : (64 * 1024 - 1);
}
std::string SpdyConstants::GetVersionString(SpdyMajorVersion version) {
switch (version) {
case SPDY3:
return "spdy/3";
case HTTP2:
return "h2";
default:
LOG(DFATAL) << "Unsupported SPDY major version: " << version;
return "spdy/3";
}
}
SpdyFrameWithHeaderBlockIR::SpdyFrameWithHeaderBlockIR(SpdyStreamId stream_id)
: SpdyFrameWithFinIR(stream_id) {}
SpdyFrameWithHeaderBlockIR::~SpdyFrameWithHeaderBlockIR() {}
SpdyDataIR::SpdyDataIR(SpdyStreamId stream_id, base::StringPiece data)
: SpdyFrameWithFinIR(stream_id), padded_(false), padding_payload_len_(0) {
SetDataDeep(data);
}
SpdyDataIR::SpdyDataIR(SpdyStreamId stream_id)
: SpdyFrameWithFinIR(stream_id), padded_(false), padding_payload_len_(0) {}
SpdyDataIR::~SpdyDataIR() {}
void SpdyDataIR::Visit(SpdyFrameVisitor* visitor) const {
return visitor->VisitData(*this);
}
void SpdySynStreamIR::Visit(SpdyFrameVisitor* visitor) const {
return visitor->VisitSynStream(*this);
}
void SpdySynReplyIR::Visit(SpdyFrameVisitor* visitor) const {
return visitor->VisitSynReply(*this);
}
SpdyRstStreamIR::SpdyRstStreamIR(SpdyStreamId stream_id,
SpdyRstStreamStatus status)
: SpdyFrameWithStreamIdIR(stream_id) {
set_status(status);
}
SpdyRstStreamIR::~SpdyRstStreamIR() {}
void SpdyRstStreamIR::Visit(SpdyFrameVisitor* visitor) const {
return visitor->VisitRstStream(*this);
}
SpdySettingsIR::SpdySettingsIR()
: clear_settings_(false),
is_ack_(false) {}
SpdySettingsIR::~SpdySettingsIR() {}
void SpdySettingsIR::Visit(SpdyFrameVisitor* visitor) const {
return visitor->VisitSettings(*this);
}
void SpdyPingIR::Visit(SpdyFrameVisitor* visitor) const {
return visitor->VisitPing(*this);
}
SpdyGoAwayIR::SpdyGoAwayIR(SpdyStreamId last_good_stream_id,
SpdyGoAwayStatus status,
base::StringPiece description)
: description_(description) {
set_last_good_stream_id(last_good_stream_id);
set_status(status);
}
SpdyGoAwayIR::~SpdyGoAwayIR() {}
void SpdyGoAwayIR::Visit(SpdyFrameVisitor* visitor) const {
return visitor->VisitGoAway(*this);
}
void SpdyHeadersIR::Visit(SpdyFrameVisitor* visitor) const {
return visitor->VisitHeaders(*this);
}
void SpdyWindowUpdateIR::Visit(SpdyFrameVisitor* visitor) const {
return visitor->VisitWindowUpdate(*this);
}
void SpdyBlockedIR::Visit(SpdyFrameVisitor* visitor) const {
return visitor->VisitBlocked(*this);
}
void SpdyPushPromiseIR::Visit(SpdyFrameVisitor* visitor) const {
return visitor->VisitPushPromise(*this);
}
void SpdyContinuationIR::Visit(SpdyFrameVisitor* visitor) const {
return visitor->VisitContinuation(*this);
}
SpdyAltSvcIR::SpdyAltSvcIR(SpdyStreamId stream_id)
: SpdyFrameWithStreamIdIR(stream_id) {
}
SpdyAltSvcIR::~SpdyAltSvcIR() {
}
void SpdyAltSvcIR::Visit(SpdyFrameVisitor* visitor) const {
return visitor->VisitAltSvc(*this);
}
void SpdyPriorityIR::Visit(SpdyFrameVisitor* visitor) const {
return visitor->VisitPriority(*this);
}
} // namespace net
|