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

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

Issue 13990005: [SPDY] Replace SpdyIOBuffer with new SpdyBuffer class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix missing include 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 | « net/spdy/spdy_frame_producer.cc ('k') | 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')
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"
16 #include "net/spdy/spdy_stream.h" 17 #include "net/spdy/spdy_stream.h"
17 18
18 namespace net { 19 namespace net {
19 20
20 class DrainableIOBuffer; 21 class DrainableIOBuffer;
21 struct HttpRequestInfo; 22 struct HttpRequestInfo;
22 class HttpResponseInfo; 23 class HttpResponseInfo;
23 class IOBuffer; 24 class IOBuffer;
24 class SpdySession; 25 class SpdySession;
25 class UploadDataStream; 26 class UploadDataStream;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 virtual void Drain(HttpNetworkSession* session) OVERRIDE; 83 virtual void Drain(HttpNetworkSession* session) OVERRIDE;
83 84
84 // SpdyStream::Delegate implementation. 85 // SpdyStream::Delegate implementation.
85 virtual SpdySendStatus OnSendHeadersComplete() OVERRIDE; 86 virtual SpdySendStatus OnSendHeadersComplete() OVERRIDE;
86 virtual int OnSendBody() OVERRIDE; 87 virtual int OnSendBody() OVERRIDE;
87 virtual SpdySendStatus OnSendBodyComplete(size_t bytes_sent) OVERRIDE; 88 virtual SpdySendStatus OnSendBodyComplete(size_t bytes_sent) OVERRIDE;
88 virtual int OnResponseReceived(const SpdyHeaderBlock& response, 89 virtual int OnResponseReceived(const SpdyHeaderBlock& response,
89 base::Time response_time, 90 base::Time response_time,
90 int status) OVERRIDE; 91 int status) OVERRIDE;
91 virtual void OnHeadersSent() OVERRIDE; 92 virtual void OnHeadersSent() OVERRIDE;
92 virtual int OnDataReceived(const char* buffer, int bytes) OVERRIDE; 93 virtual int OnDataReceived(scoped_ptr<SpdyBuffer> buffer) OVERRIDE;
93 virtual void OnDataSent(size_t bytes_sent) OVERRIDE; 94 virtual void OnDataSent(size_t bytes_sent) OVERRIDE;
94 virtual void OnClose(int status) OVERRIDE; 95 virtual void OnClose(int status) OVERRIDE;
95 96
96 private: 97 private:
97 void OnStreamCreated(const CompletionCallback& callback, int rv); 98 void OnStreamCreated(const CompletionCallback& callback, int rv);
98 99
99 // Reads the data (whether chunked or not) from the request body stream and 100 // Reads the data (whether chunked or not) from the request body stream and
100 // sends the data by calling WriteStreamData on the underlying SpdyStream. 101 // sends the data by calling WriteStreamData on the underlying SpdyStream.
101 int SendData(); 102 int SendData();
102 103
(...skipping 29 matching lines...) Expand all
132 // |response_info_| is the HTTP response data object which is filled in 133 // |response_info_| is the HTTP response data object which is filled in
133 // when a SYN_REPLY comes in for the stream. 134 // when a SYN_REPLY comes in for the stream.
134 // It is not owned by this stream object, or point to |push_response_info_|. 135 // It is not owned by this stream object, or point to |push_response_info_|.
135 HttpResponseInfo* response_info_; 136 HttpResponseInfo* response_info_;
136 137
137 scoped_ptr<HttpResponseInfo> push_response_info_; 138 scoped_ptr<HttpResponseInfo> push_response_info_;
138 139
139 bool response_headers_received_; // Indicates waiting for more HEADERS. 140 bool response_headers_received_; // Indicates waiting for more HEADERS.
140 141
141 // We buffer the response body as it arrives asynchronously from the stream. 142 // We buffer the response body as it arrives asynchronously from the stream.
142 // TODO(mbelshe): is this infinite buffering? 143 SpdyReadQueue response_body_queue_;
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 | « net/spdy/spdy_frame_producer.cc ('k') | net/spdy/spdy_http_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698