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 #ifndef NET_SPDY_SPDY_FRAMER_H_ | 5 #ifndef NET_SPDY_SPDY_FRAMER_H_ |
6 #define NET_SPDY_SPDY_FRAMER_H_ | 6 #define NET_SPDY_SPDY_FRAMER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // SettingsMap has unique (flags, value) pair for given SpdySettingsIds ID. | 78 // SettingsMap has unique (flags, value) pair for given SpdySettingsIds ID. |
79 typedef std::pair<SpdySettingsFlags, uint32> SettingsFlagsAndValue; | 79 typedef std::pair<SpdySettingsFlags, uint32> SettingsFlagsAndValue; |
80 typedef std::map<SpdySettingsIds, SettingsFlagsAndValue> SettingsMap; | 80 typedef std::map<SpdySettingsIds, SettingsFlagsAndValue> SettingsMap; |
81 | 81 |
82 // Scratch space necessary for processing SETTINGS frames. | 82 // Scratch space necessary for processing SETTINGS frames. |
83 struct NET_EXPORT_PRIVATE SpdySettingsScratch { | 83 struct NET_EXPORT_PRIVATE SpdySettingsScratch { |
84 SpdySettingsScratch() { Reset(); } | 84 SpdySettingsScratch() { Reset(); } |
85 | 85 |
86 void Reset() { | 86 void Reset() { |
87 setting_buf_len = 0; | 87 setting_buf_len = 0; |
88 last_setting_id = 0; | 88 last_setting_id = -1; |
89 } | 89 } |
90 | 90 |
91 // Buffer contains up to one complete key/value pair. | 91 // Buffer contains up to one complete key/value pair. |
92 char setting_buf[8]; | 92 char setting_buf[8]; |
93 | 93 |
94 // The amount of the buffer that is filled with valid data. | 94 // The amount of the buffer that is filled with valid data. |
95 size_t setting_buf_len; | 95 size_t setting_buf_len; |
96 | 96 |
97 // The ID of the last setting that was processed in the current SETTINGS | 97 // The ID of the last setting that was processed in the current SETTINGS |
98 // frame. Used for detecting out-of-order or duplicate keys within a settings | 98 // frame. Used for detecting out-of-order or duplicate keys within a settings |
99 // frame. Set to 0 before first key/value pair is processed. | 99 // frame. Set to -1 before first key/value pair is processed. |
100 uint32 last_setting_id; | 100 int last_setting_id; |
101 }; | 101 }; |
102 | 102 |
103 // SpdyFramerVisitorInterface is a set of callbacks for the SpdyFramer. | 103 // SpdyFramerVisitorInterface is a set of callbacks for the SpdyFramer. |
104 // Implement this interface to receive event callbacks as frames are | 104 // Implement this interface to receive event callbacks as frames are |
105 // decoded from the framer. | 105 // decoded from the framer. |
106 // | 106 // |
107 // Control frames that contain SPDY header blocks (SYN_STREAM, SYN_REPLY, | 107 // Control frames that contain SPDY header blocks (SYN_STREAM, SYN_REPLY, |
108 // HEADER, and PUSH_PROMISE) are processed in fashion that allows the | 108 // HEADER, and PUSH_PROMISE) are processed in fashion that allows the |
109 // decompressed header block to be delivered in chunks to the visitor. | 109 // decompressed header block to be delivered in chunks to the visitor. |
110 // The following steps are followed: | 110 // The following steps are followed: |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 // If a HEADERS frame is followed by a CONTINUATION frame, the FIN/END_STREAM | 713 // If a HEADERS frame is followed by a CONTINUATION frame, the FIN/END_STREAM |
714 // flag is still carried in the HEADERS frame. If it's set, flip this so that | 714 // flag is still carried in the HEADERS frame. If it's set, flip this so that |
715 // we know to terminate the stream when the entire header block has been | 715 // we know to terminate the stream when the entire header block has been |
716 // processed. | 716 // processed. |
717 bool end_stream_when_done_; | 717 bool end_stream_when_done_; |
718 }; | 718 }; |
719 | 719 |
720 } // namespace net | 720 } // namespace net |
721 | 721 |
722 #endif // NET_SPDY_SPDY_FRAMER_H_ | 722 #endif // NET_SPDY_SPDY_FRAMER_H_ |
OLD | NEW |