OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SPDY_SPDY_WEBSOCKET_STREAM_H_ | 5 #ifndef NET_SPDY_SPDY_WEBSOCKET_STREAM_H_ |
6 #define NET_SPDY_SPDY_WEBSOCKET_STREAM_H_ | 6 #define NET_SPDY_SPDY_WEBSOCKET_STREAM_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/time.h" | 13 #include "base/time.h" |
14 #include "net/base/completion_callback.h" | 14 #include "net/base/completion_callback.h" |
15 #include "net/base/request_priority.h" | 15 #include "net/base/request_priority.h" |
16 #include "net/spdy/spdy_framer.h" | 16 #include "net/spdy/spdy_framer.h" |
17 #include "net/spdy/spdy_stream.h" | 17 #include "net/spdy/spdy_stream.h" |
18 | 18 |
19 namespace net { | 19 namespace net { |
20 | 20 |
21 // The SpdyWebSocketStream is a WebSocket-specific type of stream known to a | 21 // The SpdyWebSocketStream is a WebSocket-specific type of stream known to a |
22 // SpdySession. WebSocket's opening handshake is converted to SPDY's | 22 // SpdySession. WebSocket's opening handshake is converted to SPDY's |
23 // SYN_STREAM/SYN_REPLY. WebSocket frames are encapsulated as SPDY data frames. | 23 // SYN_STREAM/SYN_REPLY. WebSocket frames are encapsulated as SPDY data frames. |
24 class NET_TEST SpdyWebSocketStream | 24 class NET_EXPORT_PRIVATE SpdyWebSocketStream |
25 : public SpdyStream::Delegate { | 25 : public SpdyStream::Delegate { |
26 public: | 26 public: |
27 // Delegate handles asynchronous events. | 27 // Delegate handles asynchronous events. |
28 class NET_TEST Delegate { | 28 class NET_EXPORT_PRIVATE Delegate { |
29 public: | 29 public: |
30 // Called when InitializeStream() finishes asynchronously. This delegate is | 30 // Called when InitializeStream() finishes asynchronously. This delegate is |
31 // called if InitializeStream() returns ERR_IO_PENDING. |status| indicates | 31 // called if InitializeStream() returns ERR_IO_PENDING. |status| indicates |
32 // network error. | 32 // network error. |
33 virtual void OnCreatedSpdyStream(int status) = 0; | 33 virtual void OnCreatedSpdyStream(int status) = 0; |
34 | 34 |
35 // Called on corresponding to OnSendHeadersComplete() or SPDY's SYN frame | 35 // Called on corresponding to OnSendHeadersComplete() or SPDY's SYN frame |
36 // has been sent. | 36 // has been sent. |
37 virtual void OnSentSpdyHeaders(int status) = 0; | 37 virtual void OnSentSpdyHeaders(int status) = 0; |
38 | 38 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 Delegate* delegate_; | 90 Delegate* delegate_; |
91 | 91 |
92 CompletionCallbackImpl<SpdyWebSocketStream> spdy_stream_created_callback_; | 92 CompletionCallbackImpl<SpdyWebSocketStream> spdy_stream_created_callback_; |
93 | 93 |
94 DISALLOW_COPY_AND_ASSIGN(SpdyWebSocketStream); | 94 DISALLOW_COPY_AND_ASSIGN(SpdyWebSocketStream); |
95 }; | 95 }; |
96 | 96 |
97 } // namespace net | 97 } // namespace net |
98 | 98 |
99 #endif // NET_SPDY_SPDY_WEBSOCKET_STREAM_H_ | 99 #endif // NET_SPDY_SPDY_WEBSOCKET_STREAM_H_ |
OLD | NEW |