Index: net/websockets/websocket_deflate_parameters.h |
diff --git a/net/websockets/websocket_deflate_parameters.h b/net/websockets/websocket_deflate_parameters.h |
index d0c73bfff5a14157356c2a9ae8c42ca9f108abad..5d6d9965e87ec6e0413cc4f044f42398ec7d6ffd 100644 |
--- a/net/websockets/websocket_deflate_parameters.h |
+++ b/net/websockets/websocket_deflate_parameters.h |
@@ -95,6 +95,13 @@ class NET_EXPORT_PRIVATE WebSocketDeflateParameters { |
client_max_window_bits_ = WindowBits(bits, true, true); |
} |
+ int PermissiveServerMaxWindowBits() const { |
+ return server_max_window_bits_.PermissiveBits(); |
+ } |
+ int PermissiveClientMaxWindowBits() const { |
+ return client_max_window_bits_.PermissiveBits(); |
+ } |
+ |
// Return true if |bits| is valid as a max_window_bits value. |
static bool IsValidWindowBits(int bits) { return 8 <= bits && bits <= 15; } |
@@ -104,6 +111,8 @@ class NET_EXPORT_PRIVATE WebSocketDeflateParameters { |
WindowBits(int16_t bits, bool is_specified, bool has_value) |
: bits(bits), is_specified(is_specified), has_value(has_value) {} |
+ int PermissiveBits() const { return is_specified && has_value ? bits : 15; } |
davidben
2015/09/22 19:44:01
Nit: I'd put parens around the conditional. Not ob
yhirano
2015/09/28 03:17:06
Done.
|
+ |
int16_t bits; |
// True when "window bits" parameter appears in the parameters. |
bool is_specified; |