Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(760)

Side by Side Diff: trunk/src/net/spdy/spdy_http_stream.h

Issue 13996009: Revert 194560 "[SPDY] Replace SpdyIOBuffer with new SpdyBuffer c..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « trunk/src/net/spdy/spdy_frame_producer.cc ('k') | trunk/src/net/spdy/spdy_http_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Deleted: svn:mergeinfo
OLDNEW
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"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "net/base/completion_callback.h" 13 #include "net/base/completion_callback.h"
14 #include "net/base/net_log.h" 14 #include "net/base/net_log.h"
15 #include "net/http/http_stream.h" 15 #include "net/http/http_stream.h"
16 #include "net/spdy/spdy_read_queue.h"
17 #include "net/spdy/spdy_stream.h" 16 #include "net/spdy/spdy_stream.h"
18 17
19 namespace net { 18 namespace net {
20 19
21 class DrainableIOBuffer; 20 class DrainableIOBuffer;
22 struct HttpRequestInfo; 21 struct HttpRequestInfo;
23 class HttpResponseInfo; 22 class HttpResponseInfo;
24 class IOBuffer; 23 class IOBuffer;
25 class SpdySession; 24 class SpdySession;
26 class UploadDataStream; 25 class UploadDataStream;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 virtual void Drain(HttpNetworkSession* session) OVERRIDE; 82 virtual void Drain(HttpNetworkSession* session) OVERRIDE;
84 83
85 // SpdyStream::Delegate implementation. 84 // SpdyStream::Delegate implementation.
86 virtual SpdySendStatus OnSendHeadersComplete() OVERRIDE; 85 virtual SpdySendStatus OnSendHeadersComplete() OVERRIDE;
87 virtual int OnSendBody() OVERRIDE; 86 virtual int OnSendBody() OVERRIDE;
88 virtual SpdySendStatus OnSendBodyComplete(size_t bytes_sent) OVERRIDE; 87 virtual SpdySendStatus OnSendBodyComplete(size_t bytes_sent) OVERRIDE;
89 virtual int OnResponseReceived(const SpdyHeaderBlock& response, 88 virtual int OnResponseReceived(const SpdyHeaderBlock& response,
90 base::Time response_time, 89 base::Time response_time,
91 int status) OVERRIDE; 90 int status) OVERRIDE;
92 virtual void OnHeadersSent() OVERRIDE; 91 virtual void OnHeadersSent() OVERRIDE;
93 virtual int OnDataReceived(scoped_ptr<SpdyBuffer> buffer) OVERRIDE; 92 virtual int OnDataReceived(const char* buffer, int bytes) OVERRIDE;
94 virtual void OnDataSent(size_t bytes_sent) OVERRIDE; 93 virtual void OnDataSent(size_t bytes_sent) OVERRIDE;
95 virtual void OnClose(int status) OVERRIDE; 94 virtual void OnClose(int status) OVERRIDE;
96 95
97 private: 96 private:
98 void OnStreamCreated(const CompletionCallback& callback, int rv); 97 void OnStreamCreated(const CompletionCallback& callback, int rv);
99 98
100 // Reads the data (whether chunked or not) from the request body stream and 99 // Reads the data (whether chunked or not) from the request body stream and
101 // sends the data by calling WriteStreamData on the underlying SpdyStream. 100 // sends the data by calling WriteStreamData on the underlying SpdyStream.
102 int SendData(); 101 int SendData();
103 102
(...skipping 29 matching lines...) Expand all
133 // |response_info_| is the HTTP response data object which is filled in 132 // |response_info_| is the HTTP response data object which is filled in
134 // when a SYN_REPLY comes in for the stream. 133 // when a SYN_REPLY comes in for the stream.
135 // It is not owned by this stream object, or point to |push_response_info_|. 134 // It is not owned by this stream object, or point to |push_response_info_|.
136 HttpResponseInfo* response_info_; 135 HttpResponseInfo* response_info_;
137 136
138 scoped_ptr<HttpResponseInfo> push_response_info_; 137 scoped_ptr<HttpResponseInfo> push_response_info_;
139 138
140 bool response_headers_received_; // Indicates waiting for more HEADERS. 139 bool response_headers_received_; // Indicates waiting for more HEADERS.
141 140
142 // We buffer the response body as it arrives asynchronously from the stream. 141 // We buffer the response body as it arrives asynchronously from the stream.
143 SpdyReadQueue response_body_queue_; 142 // TODO(mbelshe): is this infinite buffering?
143 std::list<scoped_refptr<IOBufferWithSize> > response_body_;
144 144
145 CompletionCallback callback_; 145 CompletionCallback callback_;
146 146
147 // User provided buffer for the ReadResponseBody() response. 147 // User provided buffer for the ReadResponseBody() response.
148 scoped_refptr<IOBuffer> user_buffer_; 148 scoped_refptr<IOBuffer> user_buffer_;
149 int user_buffer_len_; 149 int user_buffer_len_;
150 150
151 // Temporary buffer used to read the request body from UploadDataStream. 151 // Temporary buffer used to read the request body from UploadDataStream.
152 scoped_refptr<IOBufferWithSize> raw_request_body_buf_; 152 scoped_refptr<IOBufferWithSize> raw_request_body_buf_;
153 // Wraps raw_request_body_buf_ to read the remaining data progressively. 153 // Wraps raw_request_body_buf_ to read the remaining data progressively.
154 scoped_refptr<DrainableIOBuffer> request_body_buf_; 154 scoped_refptr<DrainableIOBuffer> request_body_buf_;
155 155
156 // Is there a scheduled read callback pending. 156 // Is there a scheduled read callback pending.
157 bool buffered_read_callback_pending_; 157 bool buffered_read_callback_pending_;
158 // Has more data been received from the network during the wait for the 158 // Has more data been received from the network during the wait for the
159 // scheduled read callback. 159 // scheduled read callback.
160 bool more_read_data_pending_; 160 bool more_read_data_pending_;
161 161
162 // Is this spdy stream direct to the origin server (or to a proxy). 162 // Is this spdy stream direct to the origin server (or to a proxy).
163 bool direct_; 163 bool direct_;
164 164
165 DISALLOW_COPY_AND_ASSIGN(SpdyHttpStream); 165 DISALLOW_COPY_AND_ASSIGN(SpdyHttpStream);
166 }; 166 };
167 167
168 } // namespace net 168 } // namespace net
169 169
170 #endif // NET_SPDY_SPDY_HTTP_STREAM_H_ 170 #endif // NET_SPDY_SPDY_HTTP_STREAM_H_
OLDNEW
« no previous file with comments | « trunk/src/net/spdy/spdy_frame_producer.cc ('k') | trunk/src/net/spdy/spdy_http_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698