| 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 // NOTE: This code is not shared between Google and Chrome. | 5 // NOTE: This code is not shared between Google and Chrome. |
| 6 | 6 |
| 7 #ifndef NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_STREAM_H_ | 7 #ifndef NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_STREAM_H_ |
| 8 #define NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_STREAM_H_ | 8 #define NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_STREAM_H_ |
| 9 | 9 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 // Called when data is available to be read. | 44 // Called when data is available to be read. |
| 45 virtual void OnDataAvailable() = 0; | 45 virtual void OnDataAvailable() = 0; |
| 46 | 46 |
| 47 // Called when the stream is closed by the peer. | 47 // Called when the stream is closed by the peer. |
| 48 virtual void OnClose() = 0; | 48 virtual void OnClose() = 0; |
| 49 | 49 |
| 50 // Called when the stream is closed because of an error. | 50 // Called when the stream is closed because of an error. |
| 51 virtual void OnError(int error) = 0; | 51 virtual void OnError(int error) = 0; |
| 52 | 52 |
| 53 // Returns true if sending of headers has completed. | |
| 54 virtual bool HasSendHeadersComplete() = 0; | |
| 55 | |
| 56 protected: | 53 protected: |
| 57 virtual ~Delegate() {} | 54 virtual ~Delegate() {} |
| 58 | 55 |
| 59 private: | 56 private: |
| 60 DISALLOW_COPY_AND_ASSIGN(Delegate); | 57 DISALLOW_COPY_AND_ASSIGN(Delegate); |
| 61 }; | 58 }; |
| 62 | 59 |
| 63 QuicChromiumClientStream(QuicStreamId id, | 60 QuicChromiumClientStream(QuicStreamId id, |
| 64 QuicClientSessionBase* session, | 61 QuicClientSessionBase* session, |
| 65 const NetLogWithSource& net_log); | 62 const NetLogWithSource& net_log); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 size_t frame_len); | 126 size_t frame_len); |
| 130 void NotifyDelegateOfDataAvailableLater(); | 127 void NotifyDelegateOfDataAvailableLater(); |
| 131 void NotifyDelegateOfDataAvailable(); | 128 void NotifyDelegateOfDataAvailable(); |
| 132 void RunOrBuffer(base::Closure closure); | 129 void RunOrBuffer(base::Closure closure); |
| 133 | 130 |
| 134 NetLogWithSource net_log_; | 131 NetLogWithSource net_log_; |
| 135 Delegate* delegate_; | 132 Delegate* delegate_; |
| 136 | 133 |
| 137 bool headers_delivered_; | 134 bool headers_delivered_; |
| 138 | 135 |
| 136 // True when initial headers have been sent. |
| 137 bool initial_headers_sent_; |
| 138 |
| 139 // Callback to be invoked when WriteStreamData or WritevStreamData completes | 139 // Callback to be invoked when WriteStreamData or WritevStreamData completes |
| 140 // asynchronously. | 140 // asynchronously. |
| 141 CompletionCallback write_callback_; | 141 CompletionCallback write_callback_; |
| 142 | 142 |
| 143 QuicClientSessionBase* session_; | 143 QuicClientSessionBase* session_; |
| 144 | 144 |
| 145 // Set to false if this stream to not be migrated during connection migration. | 145 // Set to false if this stream to not be migrated during connection migration. |
| 146 bool can_migrate_; | 146 bool can_migrate_; |
| 147 | 147 |
| 148 // Holds notifications generated before delegate_ is set. | 148 // Holds notifications generated before delegate_ is set. |
| 149 std::deque<base::Closure> delegate_tasks_; | 149 std::deque<base::Closure> delegate_tasks_; |
| 150 | 150 |
| 151 base::WeakPtrFactory<QuicChromiumClientStream> weak_factory_; | 151 base::WeakPtrFactory<QuicChromiumClientStream> weak_factory_; |
| 152 | 152 |
| 153 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientStream); | 153 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientStream); |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 } // namespace net | 156 } // namespace net |
| 157 | 157 |
| 158 #endif // NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_STREAM_H_ | 158 #endif // NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_STREAM_H_ |
| OLD | NEW |