| 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_HANDSHAKE_STREAM_CREATE_HELPER_H_ | 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_STREAM_CREATE_HELPER_H_ |
| 6 #define NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_STREAM_CREATE_HELPER_H_ | 6 #define NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_STREAM_CREATE_HELPER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // Holds the information needed to construct a | 24 // Holds the information needed to construct a |
| 25 // WebSocketBasicHandshakeStreamBase. | 25 // WebSocketBasicHandshakeStreamBase. |
| 26 class NET_EXPORT_PRIVATE WebSocketHandshakeStreamCreateHelper | 26 class NET_EXPORT_PRIVATE WebSocketHandshakeStreamCreateHelper |
| 27 : public WebSocketHandshakeStreamBase::CreateHelper { | 27 : public WebSocketHandshakeStreamBase::CreateHelper { |
| 28 public: | 28 public: |
| 29 // |connect_delegate| must out-live this object. | 29 // |connect_delegate| must out-live this object. |
| 30 explicit WebSocketHandshakeStreamCreateHelper( | 30 explicit WebSocketHandshakeStreamCreateHelper( |
| 31 WebSocketStream::ConnectDelegate* connect_delegate, | 31 WebSocketStream::ConnectDelegate* connect_delegate, |
| 32 const std::vector<std::string>& requested_subprotocols); | 32 const std::vector<std::string>& requested_subprotocols); |
| 33 | 33 |
| 34 virtual ~WebSocketHandshakeStreamCreateHelper(); | 34 ~WebSocketHandshakeStreamCreateHelper() override; |
| 35 | 35 |
| 36 // WebSocketHandshakeStreamBase::CreateHelper methods | 36 // WebSocketHandshakeStreamBase::CreateHelper methods |
| 37 | 37 |
| 38 // Create a WebSocketBasicHandshakeStream. | 38 // Create a WebSocketBasicHandshakeStream. |
| 39 virtual WebSocketHandshakeStreamBase* CreateBasicStream( | 39 WebSocketHandshakeStreamBase* CreateBasicStream( |
| 40 scoped_ptr<ClientSocketHandle> connection, | 40 scoped_ptr<ClientSocketHandle> connection, |
| 41 bool using_proxy) override; | 41 bool using_proxy) override; |
| 42 | 42 |
| 43 // Unimplemented as of November 2013. | 43 // Unimplemented as of November 2013. |
| 44 virtual WebSocketHandshakeStreamBase* CreateSpdyStream( | 44 WebSocketHandshakeStreamBase* CreateSpdyStream( |
| 45 const base::WeakPtr<SpdySession>& session, | 45 const base::WeakPtr<SpdySession>& session, |
| 46 bool use_relative_url) override; | 46 bool use_relative_url) override; |
| 47 | 47 |
| 48 // Call Upgrade() on the WebSocketHandshakeStream and return the result. This | 48 // Call Upgrade() on the WebSocketHandshakeStream and return the result. This |
| 49 // must only be called if the handshake succeeded. | 49 // must only be called if the handshake succeeded. |
| 50 scoped_ptr<WebSocketStream> Upgrade(); | 50 scoped_ptr<WebSocketStream> Upgrade(); |
| 51 | 51 |
| 52 // Set a pointer to the std::string into which to write any failure messages | 52 // Set a pointer to the std::string into which to write any failure messages |
| 53 // that are encountered. This method must be called before CreateBasicStream() | 53 // that are encountered. This method must be called before CreateBasicStream() |
| 54 // or CreateSpdyStream(). The |failure_message| pointer must remain valid as | 54 // or CreateSpdyStream(). The |failure_message| pointer must remain valid as |
| (...skipping 19 matching lines...) Expand all Loading... |
| 74 | 74 |
| 75 WebSocketStream::ConnectDelegate* connect_delegate_; | 75 WebSocketStream::ConnectDelegate* connect_delegate_; |
| 76 std::string* failure_message_; | 76 std::string* failure_message_; |
| 77 | 77 |
| 78 DISALLOW_COPY_AND_ASSIGN(WebSocketHandshakeStreamCreateHelper); | 78 DISALLOW_COPY_AND_ASSIGN(WebSocketHandshakeStreamCreateHelper); |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 } // namespace net | 81 } // namespace net |
| 82 | 82 |
| 83 #endif // NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_STREAM_CREATE_HELPER_H_ | 83 #endif // NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_STREAM_CREATE_HELPER_H_ |
| OLD | NEW |