Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(872)

Unified Diff: net/spdy/spdy_protocol.h

Issue 202383002: Add settings IDs to SpdyConstants. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test fix. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_network_transaction_unittest.cc ('k') | net/spdy/spdy_protocol.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « net/spdy/spdy_network_transaction_unittest.cc ('k') | net/spdy/spdy_protocol.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698