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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 395 |
396 // Get the stream ID for the given control frame (SYN_STREAM, SYN_REPLY, and | 396 // Get the stream ID for the given control frame (SYN_STREAM, SYN_REPLY, and |
397 // HEADERS). If the control frame is NULL or of another type, this | 397 // HEADERS). If the control frame is NULL or of another type, this |
398 // function returns kInvalidStream. | 398 // function returns kInvalidStream. |
399 static SpdyStreamId GetControlFrameStreamId( | 399 static SpdyStreamId GetControlFrameStreamId( |
400 const SpdyControlFrame* control_frame); | 400 const SpdyControlFrame* control_frame); |
401 | 401 |
402 // For ease of testing and experimentation we can tweak compression on/off. | 402 // For ease of testing and experimentation we can tweak compression on/off. |
403 void set_enable_compression(bool value); | 403 void set_enable_compression(bool value); |
404 | 404 |
405 static void set_enable_compression_default(bool value); | |
406 | |
407 // Used only in log messages. | 405 // Used only in log messages. |
408 void set_display_protocol(const std::string& protocol) { | 406 void set_display_protocol(const std::string& protocol) { |
409 display_protocol_ = protocol; | 407 display_protocol_ = protocol; |
410 } | 408 } |
411 | 409 |
412 // For debugging. | 410 // For debugging. |
413 static const char* StateToString(int state); | 411 static const char* StateToString(int state); |
414 static const char* ErrorCodeToString(int error_code); | 412 static const char* ErrorCodeToString(int error_code); |
415 static const char* StatusCodeToString(int status_code); | 413 static const char* StatusCodeToString(int status_code); |
416 static const char* ControlTypeToString(SpdyControlType type); | 414 static const char* ControlTypeToString(SpdyControlType type); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 // starts with HTTP. If it does, we likely have an HTTP response. This | 566 // starts with HTTP. If it does, we likely have an HTTP response. This |
569 // isn't guaranteed though: we could have gotten a settings frame and then | 567 // isn't guaranteed though: we could have gotten a settings frame and then |
570 // corrupt data that just looks like HTTP, but deterministic checking requires | 568 // corrupt data that just looks like HTTP, but deterministic checking requires |
571 // a lot more state. | 569 // a lot more state. |
572 bool probable_http_response_; | 570 bool probable_http_response_; |
573 }; | 571 }; |
574 | 572 |
575 } // namespace net | 573 } // namespace net |
576 | 574 |
577 #endif // NET_SPDY_SPDY_FRAMER_H_ | 575 #endif // NET_SPDY_SPDY_FRAMER_H_ |
OLD | NEW |