| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 
| 11 //   browser process. | 11 //   browser process. | 
| 12 // | 12 // | 
| 13 #ifndef NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_HANDLER_H_ | 13 #ifndef NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_HANDLER_H_ | 
| 14 #define NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_HANDLER_H_ | 14 #define NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_HANDLER_H_ | 
| 15 | 15 | 
| 16 #include <string> | 16 #include <string> | 
| 17 #include <vector> | 17 #include <vector> | 
| 18 | 18 | 
| 19 #include "net/base/net_export.h" | 19 #include "net/base/net_export.h" | 
| 20 #include "net/http/http_request_info.h" | 20 #include "net/http/http_request_info.h" | 
| 21 #include "net/http/http_response_info.h" | 21 #include "net/http/http_response_info.h" | 
| 22 #include "net/spdy/spdy_header_block.h" | 22 #include "net/spdy/spdy_header_block.h" | 
| 23 | 23 | 
| 24 namespace net { | 24 namespace net { | 
| 25 | 25 | 
|  | 26 void ComputeSecWebSocketAccept(const std::string& key, | 
|  | 27                                std::string* accept); | 
|  | 28 | 
| 26 class NET_EXPORT_PRIVATE WebSocketHandshakeRequestHandler { | 29 class NET_EXPORT_PRIVATE WebSocketHandshakeRequestHandler { | 
| 27  public: | 30  public: | 
| 28   WebSocketHandshakeRequestHandler(); | 31   WebSocketHandshakeRequestHandler(); | 
| 29   ~WebSocketHandshakeRequestHandler() {} | 32   ~WebSocketHandshakeRequestHandler() {} | 
| 30 | 33 | 
| 31   // Parses WebSocket handshake request from renderer process. | 34   // Parses WebSocket handshake request from renderer process. | 
| 32   // It assumes a WebSocket handshake request message is given at once, and | 35   // It assumes a WebSocket handshake request message is given at once, and | 
| 33   // no other data is added to the request message. | 36   // no other data is added to the request message. | 
| 34   bool ParseRequest(const char* data, int length); | 37   bool ParseRequest(const char* data, int length); | 
| 35 | 38 | 
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 112   std::string status_line_; | 115   std::string status_line_; | 
| 113   std::string headers_; | 116   std::string headers_; | 
| 114   std::string header_separator_; | 117   std::string header_separator_; | 
| 115 | 118 | 
| 116   DISALLOW_COPY_AND_ASSIGN(WebSocketHandshakeResponseHandler); | 119   DISALLOW_COPY_AND_ASSIGN(WebSocketHandshakeResponseHandler); | 
| 117 }; | 120 }; | 
| 118 | 121 | 
| 119 }  // namespace net | 122 }  // namespace net | 
| 120 | 123 | 
| 121 #endif  // NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_HANDLER_H_ | 124 #endif  // NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_HANDLER_H_ | 
| OLD | NEW | 
|---|