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