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

Side by Side Diff: net/server/web_socket_encoder.h

Issue 1047623002: Support parsing a Sec-WebSocket-Extensions header with multiple elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed #12 Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | net/server/web_socket_encoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « no previous file | net/server/web_socket_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698