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_CHANNEL_H_ | 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_CHANNEL_H_ |
6 #define NET_WEBSOCKETS_WEBSOCKET_CHANNEL_H_ | 6 #define NET_WEBSOCKETS_WEBSOCKET_CHANNEL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "net/websockets/websocket_frame.h" | 24 #include "net/websockets/websocket_frame.h" |
25 #include "net/websockets/websocket_stream.h" | 25 #include "net/websockets/websocket_stream.h" |
26 #include "url/gurl.h" | 26 #include "url/gurl.h" |
27 | 27 |
28 namespace url { | 28 namespace url { |
29 class Origin; | 29 class Origin; |
30 } // namespace url | 30 } // namespace url |
31 | 31 |
32 namespace net { | 32 namespace net { |
33 | 33 |
34 class BoundNetLog; | 34 class NetLogWithSource; |
35 class IOBuffer; | 35 class IOBuffer; |
36 class URLRequestContext; | 36 class URLRequestContext; |
37 struct WebSocketHandshakeRequestInfo; | 37 struct WebSocketHandshakeRequestInfo; |
38 struct WebSocketHandshakeResponseInfo; | 38 struct WebSocketHandshakeResponseInfo; |
39 class WebSocketHandshakeStreamCreateHelper; | 39 class WebSocketHandshakeStreamCreateHelper; |
40 | 40 |
41 // Transport-independent implementation of WebSockets. Implements protocol | 41 // Transport-independent implementation of WebSockets. Implements protocol |
42 // semantics that do not depend on the underlying transport. Provides the | 42 // semantics that do not depend on the underlying transport. Provides the |
43 // interface to the content layer. Some WebSocket concepts are used here without | 43 // interface to the content layer. Some WebSocket concepts are used here without |
44 // definition; please see the RFC at http://tools.ietf.org/html/rfc6455 for | 44 // definition; please see the RFC at http://tools.ietf.org/html/rfc6455 for |
45 // clarification. | 45 // clarification. |
46 class NET_EXPORT WebSocketChannel { | 46 class NET_EXPORT WebSocketChannel { |
47 public: | 47 public: |
48 // The type of a WebSocketStream creator callback. Must match the signature of | 48 // The type of a WebSocketStream creator callback. Must match the signature of |
49 // WebSocketStream::CreateAndConnectStream(). | 49 // WebSocketStream::CreateAndConnectStream(). |
50 typedef base::Callback<std::unique_ptr<WebSocketStreamRequest>( | 50 typedef base::Callback<std::unique_ptr<WebSocketStreamRequest>( |
51 const GURL&, | 51 const GURL&, |
52 std::unique_ptr<WebSocketHandshakeStreamCreateHelper>, | 52 std::unique_ptr<WebSocketHandshakeStreamCreateHelper>, |
53 const url::Origin&, | 53 const url::Origin&, |
54 const GURL&, | 54 const GURL&, |
55 const std::string&, | 55 const std::string&, |
56 URLRequestContext*, | 56 URLRequestContext*, |
57 const BoundNetLog&, | 57 const NetLogWithSource&, |
58 std::unique_ptr<WebSocketStream::ConnectDelegate>)> | 58 std::unique_ptr<WebSocketStream::ConnectDelegate>)> |
59 WebSocketStreamRequestCreationCallback; | 59 WebSocketStreamRequestCreationCallback; |
60 | 60 |
61 // Methods which return a value of type ChannelState may delete |this|. If the | 61 // Methods which return a value of type ChannelState may delete |this|. If the |
62 // return value is CHANNEL_DELETED, then the caller must return without making | 62 // return value is CHANNEL_DELETED, then the caller must return without making |
63 // any further access to member variables or methods. | 63 // any further access to member variables or methods. |
64 using ChannelState = WebSocketEventInterface::ChannelState; | 64 using ChannelState = WebSocketEventInterface::ChannelState; |
65 | 65 |
66 // Creates a new WebSocketChannel in an idle state. | 66 // Creates a new WebSocketChannel in an idle state. |
67 // SendAddChannelRequest() must be called immediately afterwards to start the | 67 // SendAddChannelRequest() must be called immediately afterwards to start the |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 // For UMA. The time when OnConnectSuccess() method was called and |stream_| | 447 // For UMA. The time when OnConnectSuccess() method was called and |stream_| |
448 // was set. | 448 // was set. |
449 base::TimeTicks established_on_; | 449 base::TimeTicks established_on_; |
450 | 450 |
451 DISALLOW_COPY_AND_ASSIGN(WebSocketChannel); | 451 DISALLOW_COPY_AND_ASSIGN(WebSocketChannel); |
452 }; | 452 }; |
453 | 453 |
454 } // namespace net | 454 } // namespace net |
455 | 455 |
456 #endif // NET_WEBSOCKETS_WEBSOCKET_CHANNEL_H_ | 456 #endif // NET_WEBSOCKETS_WEBSOCKET_CHANNEL_H_ |
OLD | NEW |