| 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 #ifndef NET_WEBSOCKETS_WEBSOCKET_STREAM_H_ | 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_STREAM_H_ |
| 6 #define NET_WEBSOCKETS_WEBSOCKET_STREAM_H_ | 6 #define NET_WEBSOCKETS_WEBSOCKET_STREAM_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 public: | 34 public: |
| 35 WebSocketStream() {} | 35 WebSocketStream() {} |
| 36 | 36 |
| 37 // Derived classes must make sure Close() is called when the stream is not | 37 // Derived classes must make sure Close() is called when the stream is not |
| 38 // closed on destruction. | 38 // closed on destruction. |
| 39 virtual ~WebSocketStream() {} | 39 virtual ~WebSocketStream() {} |
| 40 | 40 |
| 41 // Initializes stream. Must be called before calling SendHandshakeRequest(). | 41 // Initializes stream. Must be called before calling SendHandshakeRequest(). |
| 42 // Returns a net error code, possibly ERR_IO_PENDING, as stated above. | 42 // Returns a net error code, possibly ERR_IO_PENDING, as stated above. |
| 43 // | 43 // |
| 44 // |request_info->url| must be a URL starting with "ws://" or "wss://". | 44 // |request_info.url| must be a URL starting with "ws://" or "wss://". |
| 45 // |request_info->method| must be "GET". |request_info->upload_data| is | 45 // |request_info.method| must be "GET". |request_info.upload_data| is |
| 46 // ignored. | 46 // ignored. |
| 47 virtual int InitializeStream(const HttpRequestInfo& request_info, | 47 virtual int InitializeStream(const HttpRequestInfo& request_info, |
| 48 const BoundNetLog& net_log, | 48 const BoundNetLog& net_log, |
| 49 const CompletionCallback& callback) = 0; | 49 const CompletionCallback& callback) = 0; |
| 50 | 50 |
| 51 // Writes WebSocket handshake request to the underlying socket. Must be | 51 // Writes WebSocket handshake request to the underlying socket. Must be |
| 52 // called after InitializeStream() completes and before | 52 // called after InitializeStream() completes and before |
| 53 // ReadHandshakeResponse() is called. | 53 // ReadHandshakeResponse() is called. |
| 54 // | 54 // |
| 55 // |response_info| must remain valid until the stream is destroyed. | 55 // |response_info| must remain valid until the stream is destroyed. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // - RenewStreamForAuth for authentication (is this necessary?) | 95 // - RenewStreamForAuth for authentication (is this necessary?) |
| 96 // - GetSSLInfo, GetSSLCertRequsetInfo for SSL | 96 // - GetSSLInfo, GetSSLCertRequsetInfo for SSL |
| 97 | 97 |
| 98 private: | 98 private: |
| 99 DISALLOW_COPY_AND_ASSIGN(WebSocketStream); | 99 DISALLOW_COPY_AND_ASSIGN(WebSocketStream); |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 } // namespace net | 102 } // namespace net |
| 103 | 103 |
| 104 #endif // NET_WEBSOCKETS_WEBSOCKET_STREAM_H_ | 104 #endif // NET_WEBSOCKETS_WEBSOCKET_STREAM_H_ |
| OLD | NEW |