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_BASE_H_ | 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_STREAM_BASE_H_ |
6 #define NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_STREAM_BASE_H_ | 6 #define NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_STREAM_BASE_H_ |
7 | 7 |
8 // This file is included from net/http files. | 8 // This file is included from net/http files. |
9 // Since net/http can be built without linking net/websockets code, | 9 // Since net/http can be built without linking net/websockets code, |
10 // this file must not introduce any link-time dependencies on websockets. | 10 // this file must not introduce any link-time dependencies on websockets. |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/supports_user_data.h" | 17 #include "base/supports_user_data.h" |
18 #include "net/http/http_stream_base.h" | 18 #include "net/http/http_stream.h" |
19 #include "net/url_request/websocket_handshake_userdata_key.h" | 19 #include "net/url_request/websocket_handshake_userdata_key.h" |
20 #include "net/websockets/websocket_stream.h" | 20 #include "net/websockets/websocket_stream.h" |
21 | 21 |
22 namespace net { | 22 namespace net { |
23 | 23 |
24 class ClientSocketHandle; | 24 class ClientSocketHandle; |
25 class SpdySession; | 25 class SpdySession; |
26 | 26 |
27 // WebSocketHandshakeStreamBase is the base class of | 27 // WebSocketHandshakeStreamBase is the base class of |
28 // WebSocketBasicHandshakeStream. net/http code uses this interface to handle | 28 // WebSocketBasicHandshakeStream. net/http code uses this interface to handle |
29 // WebSocketBasicHandshakeStream when it needs to be treated differently from | 29 // WebSocketBasicHandshakeStream when it needs to be treated differently from |
30 // HttpStreamBase. | 30 // HttpStreamBase. |
31 class NET_EXPORT WebSocketHandshakeStreamBase : public HttpStreamBase { | 31 class NET_EXPORT WebSocketHandshakeStreamBase : public HttpStream { |
32 public: | 32 public: |
33 // An object that stores data needed for the creation of a | 33 // An object that stores data needed for the creation of a |
34 // WebSocketBasicHandshakeStream object. A new CreateHelper is used for each | 34 // WebSocketBasicHandshakeStream object. A new CreateHelper is used for each |
35 // WebSocket connection. | 35 // WebSocket connection. |
36 class NET_EXPORT_PRIVATE CreateHelper : public base::SupportsUserData::Data { | 36 class NET_EXPORT_PRIVATE CreateHelper : public base::SupportsUserData::Data { |
37 public: | 37 public: |
38 // Returns a key to use to lookup this object in a URLRequest object. It is | 38 // Returns a key to use to lookup this object in a URLRequest object. It is |
39 // different from any other key that is supplied to | 39 // different from any other key that is supplied to |
40 // URLRequest::SetUserData(). | 40 // URLRequest::SetUserData(). |
41 static const void* DataKey() { return kWebSocketHandshakeUserDataKey; } | 41 static const void* DataKey() { return kWebSocketHandshakeUserDataKey; } |
(...skipping 28 matching lines...) Expand all Loading... |
70 // As with the destructor, this must be inline. | 70 // As with the destructor, this must be inline. |
71 WebSocketHandshakeStreamBase() {} | 71 WebSocketHandshakeStreamBase() {} |
72 | 72 |
73 private: | 73 private: |
74 DISALLOW_COPY_AND_ASSIGN(WebSocketHandshakeStreamBase); | 74 DISALLOW_COPY_AND_ASSIGN(WebSocketHandshakeStreamBase); |
75 }; | 75 }; |
76 | 76 |
77 } // namespace net | 77 } // namespace net |
78 | 78 |
79 #endif // NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_STREAM_BASE_H_ | 79 #endif // NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_STREAM_BASE_H_ |
OLD | NEW |