| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SERVER_WEB_SOCKET_ENCODER_H_ | 5 #ifndef NET_SERVER_WEB_SOCKET_ENCODER_H_ |
| 6 #define NET_SERVER_WEB_SOCKET_ENCODER_H_ | 6 #define NET_SERVER_WEB_SOCKET_ENCODER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // defaults to 15. | 50 // defaults to 15. |
| 51 // - If the client_max_window_bits parameter has an invalid value, | 51 // - If the client_max_window_bits parameter has an invalid value, |
| 52 // *client_window_bits will be set to 0. | 52 // *client_window_bits will be set to 0. |
| 53 // - If the server_max_window_bits parameter is missing, *server_window_bits | 53 // - If the server_max_window_bits parameter is missing, *server_window_bits |
| 54 // defaults to 15. | 54 // defaults to 15. |
| 55 // - If the server_max_window_bits parameter has an invalid value, | 55 // - If the server_max_window_bits parameter has an invalid value, |
| 56 // *client_window_bits will be set to 0. | 56 // *client_window_bits will be set to 0. |
| 57 // | 57 // |
| 58 // TODO(tyoshino): Consider using a struct than taking a lot of pointers for | 58 // TODO(tyoshino): Consider using a struct than taking a lot of pointers for |
| 59 // output. | 59 // output. |
| 60 static void ParseExtensions(const std::string& extensions, | 60 static void ParseExtensions(const std::string& header_value, |
| 61 bool* deflate, | 61 bool* deflate, |
| 62 bool* has_client_window_bits, | 62 bool* has_client_window_bits, |
| 63 int* client_window_bits, | 63 int* client_window_bits, |
| 64 int* server_window_bits, | 64 int* server_window_bits, |
| 65 bool* client_no_context_takeover, | 65 bool* client_no_context_takeover, |
| 66 bool* server_no_context_takeover); | 66 bool* server_no_context_takeover); |
| 67 | 67 |
| 68 bool Inflate(std::string* message); | 68 bool Inflate(std::string* message); |
| 69 bool Deflate(const std::string& message, std::string* output); | 69 bool Deflate(const std::string& message, std::string* output); |
| 70 | 70 |
| 71 scoped_ptr<WebSocketDeflater> deflater_; | 71 scoped_ptr<WebSocketDeflater> deflater_; |
| 72 scoped_ptr<WebSocketInflater> inflater_; | 72 scoped_ptr<WebSocketInflater> inflater_; |
| 73 bool is_server_; | 73 bool is_server_; |
| 74 | 74 |
| 75 DISALLOW_COPY_AND_ASSIGN(WebSocketEncoder); | 75 DISALLOW_COPY_AND_ASSIGN(WebSocketEncoder); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 } // namespace net | 78 } // namespace net |
| 79 | 79 |
| 80 #endif // NET_SERVER_WEB_SOCKET_ENCODER_H_ | 80 #endif // NET_SERVER_WEB_SOCKET_ENCODER_H_ |
| OLD | NEW |