| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_WEBSOCKETS_WEBSOCKET_BASIC_HANDSHAKE_STREAM_H_ | 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_BASIC_HANDSHAKE_STREAM_H_ |
| 6 #define NET_WEBSOCKETS_WEBSOCKET_BASIC_HANDSHAKE_STREAM_H_ | 6 #define NET_WEBSOCKETS_WEBSOCKET_BASIC_HANDSHAKE_STREAM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 // A wrapper for the ReadResponseHeaders callback that checks whether or not | 82 // A wrapper for the ReadResponseHeaders callback that checks whether or not |
| 83 // the connection has been accepted. | 83 // the connection has been accepted. |
| 84 void ReadResponseHeadersCallback(const CompletionCallback& callback, | 84 void ReadResponseHeadersCallback(const CompletionCallback& callback, |
| 85 int result); | 85 int result); |
| 86 | 86 |
| 87 void OnFinishOpeningHandshake(); | 87 void OnFinishOpeningHandshake(); |
| 88 | 88 |
| 89 // Validates the response and sends the finished handshake event. | 89 // Validates the response and sends the finished handshake event. |
| 90 int ValidateResponse(int rv, bool* is_redirect); | 90 int ValidateResponse(int rv); |
| 91 | 91 |
| 92 // Check that the headers are well-formed for a 101 response, and returns | 92 // Check that the headers are well-formed for a 101 response, and returns |
| 93 // OK if they are, otherwise returns ERR_INVALID_RESPONSE. | 93 // OK if they are, otherwise returns ERR_INVALID_RESPONSE. |
| 94 int ValidateUpgradeResponse(const HttpResponseHeaders* headers); | 94 int ValidateUpgradeResponse(const HttpResponseHeaders* headers); |
| 95 | 95 |
| 96 HttpStreamParser* parser() const { return state_.parser(); } | 96 HttpStreamParser* parser() const { return state_.parser(); } |
| 97 | 97 |
| 98 void set_failure_message(const std::string& failure_message); | 98 void set_failure_message(const std::string& failure_message); |
| 99 | 99 |
| 100 // The request URL. | 100 // The request URL. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 scoped_ptr<WebSocketExtensionParams> extension_params_; | 134 scoped_ptr<WebSocketExtensionParams> extension_params_; |
| 135 | 135 |
| 136 std::string* failure_message_; | 136 std::string* failure_message_; |
| 137 | 137 |
| 138 DISALLOW_COPY_AND_ASSIGN(WebSocketBasicHandshakeStream); | 138 DISALLOW_COPY_AND_ASSIGN(WebSocketBasicHandshakeStream); |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 } // namespace net | 141 } // namespace net |
| 142 | 142 |
| 143 #endif // NET_WEBSOCKETS_WEBSOCKET_BASIC_HANDSHAKE_STREAM_H_ | 143 #endif // NET_WEBSOCKETS_WEBSOCKET_BASIC_HANDSHAKE_STREAM_H_ |
| OLD | NEW |