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_SPDY_SPDY_HTTP_STREAM_H_ | 5 #ifndef NET_SPDY_SPDY_HTTP_STREAM_H_ |
6 #define NET_SPDY_SPDY_HTTP_STREAM_H_ | 6 #define NET_SPDY_SPDY_HTTP_STREAM_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 LoadTimingInfo* load_timing_info) const OVERRIDE; | 79 LoadTimingInfo* load_timing_info) const OVERRIDE; |
80 virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; | 80 virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; |
81 virtual void GetSSLCertRequestInfo( | 81 virtual void GetSSLCertRequestInfo( |
82 SSLCertRequestInfo* cert_request_info) OVERRIDE; | 82 SSLCertRequestInfo* cert_request_info) OVERRIDE; |
83 virtual bool IsSpdyHttpStream() const OVERRIDE; | 83 virtual bool IsSpdyHttpStream() const OVERRIDE; |
84 virtual void Drain(HttpNetworkSession* session) OVERRIDE; | 84 virtual void Drain(HttpNetworkSession* session) OVERRIDE; |
85 | 85 |
86 // SpdyStream::Delegate implementation. | 86 // SpdyStream::Delegate implementation. |
87 virtual SpdySendStatus OnSendHeadersComplete() OVERRIDE; | 87 virtual SpdySendStatus OnSendHeadersComplete() OVERRIDE; |
88 virtual void OnSendBody() OVERRIDE; | 88 virtual void OnSendBody() OVERRIDE; |
89 virtual SpdySendStatus OnSendBodyComplete(size_t bytes_sent) OVERRIDE; | 89 virtual SpdySendStatus OnSendBodyComplete() OVERRIDE; |
90 virtual int OnResponseReceived(const SpdyHeaderBlock& response, | 90 virtual int OnResponseReceived(const SpdyHeaderBlock& response, |
91 base::Time response_time, | 91 base::Time response_time, |
92 int status) OVERRIDE; | 92 int status) OVERRIDE; |
93 virtual void OnHeadersSent() OVERRIDE; | 93 virtual void OnHeadersSent() OVERRIDE; |
94 virtual int OnDataReceived(scoped_ptr<SpdyBuffer> buffer) OVERRIDE; | 94 virtual int OnDataReceived(scoped_ptr<SpdyBuffer> buffer) OVERRIDE; |
95 virtual void OnDataSent(size_t bytes_sent) OVERRIDE; | 95 virtual void OnDataSent() OVERRIDE; |
96 virtual void OnClose(int status) OVERRIDE; | 96 virtual void OnClose(int status) OVERRIDE; |
97 | 97 |
98 private: | 98 private: |
99 void OnStreamCreated(const CompletionCallback& callback, int rv); | 99 void OnStreamCreated(const CompletionCallback& callback, int rv); |
100 | 100 |
101 // Reads the data (whether chunked or not) from the request body | 101 // Reads the data (whether chunked or not) from the request body |
102 // stream and sends it. The read and subsequent sending may happen | 102 // stream and sends it. The read and subsequent sending may happen |
103 // asynchronously. | 103 // asynchronously. |
104 void ReadAndSendRequestBodyData(); | 104 void ReadAndSendRequestBodyData(); |
105 | 105 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 SpdyReadQueue response_body_queue_; | 150 SpdyReadQueue response_body_queue_; |
151 | 151 |
152 CompletionCallback callback_; | 152 CompletionCallback callback_; |
153 | 153 |
154 // User provided buffer for the ReadResponseBody() response. | 154 // User provided buffer for the ReadResponseBody() response. |
155 scoped_refptr<IOBuffer> user_buffer_; | 155 scoped_refptr<IOBuffer> user_buffer_; |
156 int user_buffer_len_; | 156 int user_buffer_len_; |
157 | 157 |
158 // Temporary buffer used to read the request body from UploadDataStream. | 158 // Temporary buffer used to read the request body from UploadDataStream. |
159 scoped_refptr<IOBufferWithSize> raw_request_body_buf_; | 159 scoped_refptr<IOBufferWithSize> raw_request_body_buf_; |
160 // Wraps raw_request_body_buf_ to read the remaining data progressively. | 160 int raw_request_body_buf_size_; |
161 scoped_refptr<DrainableIOBuffer> request_body_buf_; | |
162 | 161 |
163 // Is there a scheduled read callback pending. | 162 // Is there a scheduled read callback pending. |
164 bool buffered_read_callback_pending_; | 163 bool buffered_read_callback_pending_; |
165 // Has more data been received from the network during the wait for the | 164 // Has more data been received from the network during the wait for the |
166 // scheduled read callback. | 165 // scheduled read callback. |
167 bool more_read_data_pending_; | 166 bool more_read_data_pending_; |
168 | 167 |
169 // Is this spdy stream direct to the origin server (or to a proxy). | 168 // Is this spdy stream direct to the origin server (or to a proxy). |
170 bool direct_; | 169 bool direct_; |
171 | 170 |
172 DISALLOW_COPY_AND_ASSIGN(SpdyHttpStream); | 171 DISALLOW_COPY_AND_ASSIGN(SpdyHttpStream); |
173 }; | 172 }; |
174 | 173 |
175 } // namespace net | 174 } // namespace net |
176 | 175 |
177 #endif // NET_SPDY_SPDY_HTTP_STREAM_H_ | 176 #endif // NET_SPDY_SPDY_HTTP_STREAM_H_ |
OLD | NEW |