| 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 // Called when a GOAWAY frame has been parsed. | 203 // Called when a GOAWAY frame has been parsed. |
| 204 virtual void OnGoAway(SpdyStreamId last_accepted_stream_id, | 204 virtual void OnGoAway(SpdyStreamId last_accepted_stream_id, |
| 205 SpdyGoAwayStatus status) = 0; | 205 SpdyGoAwayStatus status) = 0; |
| 206 | 206 |
| 207 // Called when a WINDOW_UPDATE frame has been parsed. | 207 // Called when a WINDOW_UPDATE frame has been parsed. |
| 208 virtual void OnWindowUpdate(SpdyStreamId stream_id, | 208 virtual void OnWindowUpdate(SpdyStreamId stream_id, |
| 209 int delta_window_size) = 0; | 209 int delta_window_size) = 0; |
| 210 | 210 |
| 211 // Called after a control frame has been compressed to allow the visitor | 211 // Called after a control frame has been compressed to allow the visitor |
| 212 // to record compression statistics. | 212 // to record compression statistics. |
| 213 // |
| 214 // TODO(akalin): Upstream this function. |
| 213 virtual void OnControlFrameCompressed( | 215 virtual void OnControlFrameCompressed( |
| 214 const SpdyControlFrame& uncompressed_frame, | 216 const SpdyControlFrame& uncompressed_frame, |
| 215 const SpdyControlFrame& compressed_frame) = 0; | 217 const SpdyControlFrame& compressed_frame) = 0; |
| 216 }; | 218 }; |
| 217 | 219 |
| 218 // Optionally, and in addition to SpdyFramerVisitorInterface, a class supporting | 220 // Optionally, and in addition to SpdyFramerVisitorInterface, a class supporting |
| 219 // SpdyFramerDebugVisitorInterface may be used in conjunction with SpdyFramer in | 221 // SpdyFramerDebugVisitorInterface may be used in conjunction with SpdyFramer in |
| 220 // order to extract debug/internal information about the SpdyFramer as it | 222 // order to extract debug/internal information about the SpdyFramer as it |
| 221 // operates. | 223 // operates. |
| 222 // | 224 // |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 SPDY_FORWARD_STREAM_FRAME, | 259 SPDY_FORWARD_STREAM_FRAME, |
| 258 SPDY_CONTROL_FRAME_BEFORE_HEADER_BLOCK, | 260 SPDY_CONTROL_FRAME_BEFORE_HEADER_BLOCK, |
| 259 SPDY_CONTROL_FRAME_HEADER_BLOCK, | 261 SPDY_CONTROL_FRAME_HEADER_BLOCK, |
| 260 SPDY_CREDENTIAL_FRAME_PAYLOAD, | 262 SPDY_CREDENTIAL_FRAME_PAYLOAD, |
| 261 SPDY_SETTINGS_FRAME_PAYLOAD, | 263 SPDY_SETTINGS_FRAME_PAYLOAD, |
| 262 }; | 264 }; |
| 263 | 265 |
| 264 // SPDY error codes. | 266 // SPDY error codes. |
| 265 enum SpdyError { | 267 enum SpdyError { |
| 266 SPDY_NO_ERROR, | 268 SPDY_NO_ERROR, |
| 267 SPDY_INVALID_CONTROL_FRAME, // Control frame is mal-formatted. | 269 SPDY_INVALID_CONTROL_FRAME, // Control frame is mal-formatted. |
| 268 SPDY_CONTROL_PAYLOAD_TOO_LARGE, // Control frame payload was too large. | 270 SPDY_CONTROL_PAYLOAD_TOO_LARGE, // Control frame payload was too large. |
| 269 SPDY_ZLIB_INIT_FAILURE, // The Zlib library could not initialize. | 271 SPDY_ZLIB_INIT_FAILURE, // The Zlib library could not initialize. |
| 270 SPDY_UNSUPPORTED_VERSION, // Control frame has unsupported version. | 272 SPDY_UNSUPPORTED_VERSION, // Control frame has unsupported version. |
| 271 SPDY_DECOMPRESS_FAILURE, // There was an error decompressing. | 273 SPDY_DECOMPRESS_FAILURE, // There was an error decompressing. |
| 272 SPDY_COMPRESS_FAILURE, // There was an error compressing. | 274 SPDY_COMPRESS_FAILURE, // There was an error compressing. |
| 273 SPDY_CREDENTIAL_FRAME_CORRUPT, // CREDENTIAL frame could not be parsed. | 275 SPDY_CREDENTIAL_FRAME_CORRUPT, // CREDENTIAL frame could not be parsed. |
| 274 SPDY_INVALID_DATA_FRAME_FLAGS, // Data frame has invalid flags. | 276 SPDY_INVALID_DATA_FRAME_FLAGS, // Data frame has invalid flags. |
| 277 SPDY_INVALID_CONTROL_FRAME_FLAGS, // Control frame has invalid flags. |
| 275 | 278 |
| 276 LAST_ERROR, // Must be the last entry in the enum. | 279 LAST_ERROR, // Must be the last entry in the enum. |
| 277 }; | 280 }; |
| 278 | 281 |
| 279 // The minimum supported SPDY version that SpdyFramer can speak. | 282 // The minimum supported SPDY version that SpdyFramer can speak. |
| 280 static const int kMinSpdyVersion; | 283 static const int kMinSpdyVersion; |
| 281 | 284 |
| 282 // The maximum supported SPDY version that SpdyFramer can speak. | 285 // The maximum supported SPDY version that SpdyFramer can speak. |
| 283 static const int kMaxSpdyVersion; | 286 static const int kMaxSpdyVersion; |
| 284 | 287 |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 // starts with HTTP. If it does, we likely have an HTTP response. This | 634 // starts with HTTP. If it does, we likely have an HTTP response. This |
| 632 // isn't guaranteed though: we could have gotten a settings frame and then | 635 // isn't guaranteed though: we could have gotten a settings frame and then |
| 633 // corrupt data that just looks like HTTP, but deterministic checking requires | 636 // corrupt data that just looks like HTTP, but deterministic checking requires |
| 634 // a lot more state. | 637 // a lot more state. |
| 635 bool probable_http_response_; | 638 bool probable_http_response_; |
| 636 }; | 639 }; |
| 637 | 640 |
| 638 } // namespace net | 641 } // namespace net |
| 639 | 642 |
| 640 #endif // NET_SPDY_SPDY_FRAMER_H_ | 643 #endif // NET_SPDY_SPDY_FRAMER_H_ |
| OLD | NEW |