OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // WebSocketHandshake*Handler handles WebSocket handshake request message | 5 // WebSocketHandshake*Handler handles WebSocket handshake request message |
6 // from WebKit renderer process, and WebSocket handshake response message | 6 // from WebKit renderer process, and WebSocket handshake response message |
7 // from WebSocket server. | 7 // from WebSocket server. |
8 // It modifies messages for the following reason: | 8 // It modifies messages for the following reason: |
9 // - We don't trust WebKit renderer process, so we'll not expose HttpOnly | 9 // - We don't trust WebKit renderer process, so we'll not expose HttpOnly |
10 // cookies to the renderer process, so handles HttpOnly cookies in | 10 // cookies to the renderer process, so handles HttpOnly cookies in |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 std::string key3_; | 64 std::string key3_; |
65 int original_length_; | 65 int original_length_; |
66 int raw_length_; | 66 int raw_length_; |
67 | 67 |
68 DISALLOW_COPY_AND_ASSIGN(WebSocketHandshakeRequestHandler); | 68 DISALLOW_COPY_AND_ASSIGN(WebSocketHandshakeRequestHandler); |
69 }; | 69 }; |
70 | 70 |
71 class WebSocketHandshakeResponseHandler { | 71 class WebSocketHandshakeResponseHandler { |
72 public: | 72 public: |
73 WebSocketHandshakeResponseHandler(); | 73 WebSocketHandshakeResponseHandler(); |
74 ~WebSocketHandshakeResponseHandler() {} | 74 ~WebSocketHandshakeResponseHandler(); |
75 | 75 |
76 // Parses WebSocket handshake response from WebSocket server. | 76 // Parses WebSocket handshake response from WebSocket server. |
77 // Returns number of bytes in |data| used for WebSocket handshake response | 77 // Returns number of bytes in |data| used for WebSocket handshake response |
78 // message, including response key. If it already got whole WebSocket | 78 // message, including response key. If it already got whole WebSocket |
79 // handshake response message, returns zero. In other words, | 79 // handshake response message, returns zero. In other words, |
80 // [data + returned value, data + length) will be WebSocket frame data | 80 // [data + returned value, data + length) will be WebSocket frame data |
81 // after handshake response message. | 81 // after handshake response message. |
82 // TODO(ukai): fail fast when response gives wrong status code. | 82 // TODO(ukai): fail fast when response gives wrong status code. |
83 size_t ParseRawResponse(const char* data, int length); | 83 size_t ParseRawResponse(const char* data, int length); |
84 // Returns true if it already parses full handshake response message. | 84 // Returns true if it already parses full handshake response message. |
(...skipping 26 matching lines...) Expand all Loading... |
111 std::string headers_; | 111 std::string headers_; |
112 std::string header_separator_; | 112 std::string header_separator_; |
113 std::string key_; | 113 std::string key_; |
114 | 114 |
115 DISALLOW_COPY_AND_ASSIGN(WebSocketHandshakeResponseHandler); | 115 DISALLOW_COPY_AND_ASSIGN(WebSocketHandshakeResponseHandler); |
116 }; | 116 }; |
117 | 117 |
118 } // namespace net | 118 } // namespace net |
119 | 119 |
120 #endif // NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_HANDLER_H_ | 120 #endif // NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_HANDLER_H_ |
OLD | NEW |