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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 // On success, returns a new SpdyFrame with the payload compressed. | 459 // On success, returns a new SpdyFrame with the payload compressed. |
460 // Compression state is maintained as part of the SpdyFramer. | 460 // Compression state is maintained as part of the SpdyFramer. |
461 // Returned frame must be freed with "delete". | 461 // Returned frame must be freed with "delete". |
462 // On failure, returns NULL. | 462 // On failure, returns NULL. |
463 SpdyFrame* CompressFrame(const SpdyFrame& frame); | 463 SpdyFrame* CompressFrame(const SpdyFrame& frame); |
464 | 464 |
465 // Create a copy of a frame. | 465 // Create a copy of a frame. |
466 // Returned frame must be freed with "delete". | 466 // Returned frame must be freed with "delete". |
467 SpdyFrame* DuplicateFrame(const SpdyFrame& frame); | 467 SpdyFrame* DuplicateFrame(const SpdyFrame& frame); |
468 | 468 |
469 // Returns true if a frame could be compressed. | |
470 bool IsCompressible(const SpdyFrame& frame) const; | |
471 | |
472 // For ease of testing and experimentation we can tweak compression on/off. | 469 // For ease of testing and experimentation we can tweak compression on/off. |
473 void set_enable_compression(bool value) { | 470 void set_enable_compression(bool value) { |
474 enable_compression_ = value; | 471 enable_compression_ = value; |
475 } | 472 } |
476 | 473 |
477 // Used only in log messages. | 474 // Used only in log messages. |
478 void set_display_protocol(const std::string& protocol) { | 475 void set_display_protocol(const std::string& protocol) { |
479 display_protocol_ = protocol; | 476 display_protocol_ = protocol; |
480 } | 477 } |
481 | 478 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 // starts with HTTP. If it does, we likely have an HTTP response. This | 655 // starts with HTTP. If it does, we likely have an HTTP response. This |
659 // isn't guaranteed though: we could have gotten a settings frame and then | 656 // isn't guaranteed though: we could have gotten a settings frame and then |
660 // corrupt data that just looks like HTTP, but deterministic checking requires | 657 // corrupt data that just looks like HTTP, but deterministic checking requires |
661 // a lot more state. | 658 // a lot more state. |
662 bool probable_http_response_; | 659 bool probable_http_response_; |
663 }; | 660 }; |
664 | 661 |
665 } // namespace net | 662 } // namespace net |
666 | 663 |
667 #endif // NET_SPDY_SPDY_FRAMER_H_ | 664 #endif // NET_SPDY_SPDY_FRAMER_H_ |
OLD | NEW |