OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 // On failure, returns NULL. | 279 // On failure, returns NULL. |
280 SpdyFrame* DecompressFrame(const SpdyFrame& frame); | 280 SpdyFrame* DecompressFrame(const SpdyFrame& frame); |
281 | 281 |
282 // Create a copy of a frame. | 282 // Create a copy of a frame. |
283 // Returned frame must be freed with "delete". | 283 // Returned frame must be freed with "delete". |
284 SpdyFrame* DuplicateFrame(const SpdyFrame& frame); | 284 SpdyFrame* DuplicateFrame(const SpdyFrame& frame); |
285 | 285 |
286 // Returns true if a frame could be compressed. | 286 // Returns true if a frame could be compressed. |
287 bool IsCompressible(const SpdyFrame& frame) const; | 287 bool IsCompressible(const SpdyFrame& frame) const; |
288 | 288 |
| 289 // Returns true if the frame is a PING frame. |
| 290 bool IsPingFrame(const SpdyFrame& frame) const; |
| 291 |
289 // Get the minimum size of the control frame for the given control frame | 292 // Get the minimum size of the control frame for the given control frame |
290 // type. This is useful for validating frame blocks. | 293 // type. This is useful for validating frame blocks. |
291 static size_t GetMinimumControlFrameSize(SpdyControlType type); | 294 static size_t GetMinimumControlFrameSize(SpdyControlType type); |
292 | 295 |
293 // Get the stream ID for the given control frame (SYN_STREAM, SYN_REPLY, and | 296 // Get the stream ID for the given control frame (SYN_STREAM, SYN_REPLY, and |
294 // HEADERS). If the control frame is NULL or of another type, this | 297 // HEADERS). If the control frame is NULL or of another type, this |
295 // function returns kInvalidStream. | 298 // function returns kInvalidStream. |
296 static SpdyStreamId GetControlFrameStreamId( | 299 static SpdyStreamId GetControlFrameStreamId( |
297 const SpdyControlFrame* control_frame); | 300 const SpdyControlFrame* control_frame); |
298 | 301 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 | 475 |
473 SpdyFramerVisitorInterface* visitor_; | 476 SpdyFramerVisitorInterface* visitor_; |
474 | 477 |
475 static bool compression_default_; | 478 static bool compression_default_; |
476 static int spdy_version_; | 479 static int spdy_version_; |
477 }; | 480 }; |
478 | 481 |
479 } // namespace spdy | 482 } // namespace spdy |
480 | 483 |
481 #endif // NET_SPDY_SPDY_FRAMER_H_ | 484 #endif // NET_SPDY_SPDY_FRAMER_H_ |
OLD | NEW |