Index: net/spdy/spdy_protocol.h |
diff --git a/net/spdy/spdy_protocol.h b/net/spdy/spdy_protocol.h |
index e871d2c24c8d1a47f20162864ff94be5267212a8..499f84e448e6eeb53ceec15b5abdc00f87d4bb68 100644 |
--- a/net/spdy/spdy_protocol.h |
+++ b/net/spdy/spdy_protocol.h |
@@ -336,17 +336,22 @@ enum SpdySettingsFlags { |
// List of known settings. |
enum SpdySettingsIds { |
- SETTINGS_UPLOAD_BANDWIDTH = 0x1, |
- SETTINGS_DOWNLOAD_BANDWIDTH = 0x2, |
+ SETTINGS_UPLOAD_BANDWIDTH, |
+ SETTINGS_DOWNLOAD_BANDWIDTH, |
// Network round trip time in milliseconds. |
- SETTINGS_ROUND_TRIP_TIME = 0x3, |
- SETTINGS_MAX_CONCURRENT_STREAMS = 0x4, |
+ SETTINGS_ROUND_TRIP_TIME, |
+ // The maximum number of simultaneous live streams in each direction. |
+ SETTINGS_MAX_CONCURRENT_STREAMS, |
// TCP congestion window in packets. |
- SETTINGS_CURRENT_CWND = 0x5, |
+ SETTINGS_CURRENT_CWND, |
// Downstream byte retransmission rate in percentage. |
- SETTINGS_DOWNLOAD_RETRANS_RATE = 0x6, |
+ SETTINGS_DOWNLOAD_RETRANS_RATE, |
// Initial window size in bytes |
- SETTINGS_INITIAL_WINDOW_SIZE = 0x7 |
+ SETTINGS_INITIAL_WINDOW_SIZE, |
+ // HPACK header table maximum size. |
+ SETTINGS_HEADER_TABLE_SIZE, |
+ // Whether or not server push (PUSH_PROMISE) is enabled. |
+ SETTINGS_ENABLE_PUSH, |
}; |
// Status codes for RST_STREAM frames. |
@@ -386,7 +391,7 @@ typedef uint64 SpdyPingId; |
// TODO(hkhalil): Add direct testing for this? It won't increase coverage any, |
// but is good to do anyway. |
-class SpdyConstants { |
+class NET_EXPORT_PRIVATE SpdyConstants { |
public: |
// Returns true if a given on-the-wire enumeration of a frame type is valid |
// for a given protocol version, false otherwise. |
@@ -404,6 +409,22 @@ class SpdyConstants { |
// Returns -1 on failure (I.E. Invalid frame type for the given version). |
static int SerializeFrameType(SpdyMajorVersion version, |
SpdyFrameType frame_type); |
+ |
+ // Returns true if a given on-the-wire enumeration of a setting id is valid |
+ // for a given protocol version, false otherwise. |
+ static bool IsValidSettingId(SpdyMajorVersion version, int setting_id_field); |
+ |
+ // Parses a setting id from an on-the-wire enumeration of a given protocol |
+ // version. |
+ // Behavior is undefined for invalid setting id fields; consumers should first |
+ // use IsValidSettingId() to verify validity of setting id fields. |
+ static SpdySettingsIds ParseSettingId(SpdyMajorVersion version, |
+ int setting_id_field); |
+ |
+ // Serializes a given setting id to the on-the-wire enumeration value for the |
+ // given protocol version. |
+ // Returns -1 on failure (I.E. Invalid setting id for the given version). |
+ static int SerializeSettingId(SpdyMajorVersion version, SpdySettingsIds id); |
}; |
class SpdyFrame; |
@@ -654,8 +675,6 @@ class NET_EXPORT_PRIVATE SpdySettingsIR : public SpdyFrameIR { |
bool persist_value, |
bool persisted, |
int32 value) { |
- // TODO(hkhalil): DCHECK_LE(SETTINGS_UPLOAD_BANDWIDTH, id); |
- // TODO(hkhalil): DCHECK_GE(SETTINGS_INITIAL_WINDOW_SIZE, id); |
values_[id].persist_value = persist_value; |
values_[id].persisted = persisted; |
values_[id].value = value; |