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

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

Issue 17382012: [SPDY] Refactor SpdyStream's handling of response headers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More updates from rebase Created 7 years, 6 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 | « no previous file | 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"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 virtual bool GetLoadTimingInfo( 69 virtual bool GetLoadTimingInfo(
70 LoadTimingInfo* load_timing_info) const OVERRIDE; 70 LoadTimingInfo* load_timing_info) const OVERRIDE;
71 virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; 71 virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
72 virtual void GetSSLCertRequestInfo( 72 virtual void GetSSLCertRequestInfo(
73 SSLCertRequestInfo* cert_request_info) OVERRIDE; 73 SSLCertRequestInfo* cert_request_info) OVERRIDE;
74 virtual bool IsSpdyHttpStream() const OVERRIDE; 74 virtual bool IsSpdyHttpStream() const OVERRIDE;
75 virtual void Drain(HttpNetworkSession* session) OVERRIDE; 75 virtual void Drain(HttpNetworkSession* session) OVERRIDE;
76 76
77 // SpdyStream::Delegate implementation. 77 // SpdyStream::Delegate implementation.
78 virtual void OnRequestHeadersSent() OVERRIDE; 78 virtual void OnRequestHeadersSent() OVERRIDE;
79 virtual int OnResponseHeadersReceived(const SpdyHeaderBlock& response, 79 virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated(
80 base::Time response_time, 80 const SpdyHeaderBlock& response_headers) OVERRIDE;
81 int status) OVERRIDE; 81 virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) OVERRIDE;
82 virtual int OnDataReceived(scoped_ptr<SpdyBuffer> buffer) OVERRIDE;
83 virtual void OnDataSent() OVERRIDE; 82 virtual void OnDataSent() OVERRIDE;
84 virtual void OnClose(int status) OVERRIDE; 83 virtual void OnClose(int status) OVERRIDE;
85 84
86 private: 85 private:
87 // Must be called only when |request_info_| is non-NULL. 86 // Must be called only when |request_info_| is non-NULL.
88 bool HasUploadData() const; 87 bool HasUploadData() const;
89 88
90 void OnStreamCreated(const CompletionCallback& callback, int rv); 89 void OnStreamCreated(const CompletionCallback& callback, int rv);
91 90
92 // Reads the remaining data (whether chunked or not) from the 91 // Reads the remaining data (whether chunked or not) from the
(...skipping 30 matching lines...) Expand all
123 // The request to send. 122 // The request to send.
124 const HttpRequestInfo* request_info_; 123 const HttpRequestInfo* request_info_;
125 124
126 // |response_info_| is the HTTP response data object which is filled in 125 // |response_info_| is the HTTP response data object which is filled in
127 // when a SYN_REPLY comes in for the stream. 126 // when a SYN_REPLY comes in for the stream.
128 // It is not owned by this stream object, or point to |push_response_info_|. 127 // It is not owned by this stream object, or point to |push_response_info_|.
129 HttpResponseInfo* response_info_; 128 HttpResponseInfo* response_info_;
130 129
131 scoped_ptr<HttpResponseInfo> push_response_info_; 130 scoped_ptr<HttpResponseInfo> push_response_info_;
132 131
133 bool response_headers_received_; // Indicates waiting for more HEADERS. 132 // We don't use SpdyStream's |response_header_status_| as we
133 // sometimes call back into our delegate before it is updated.
134 SpdyResponseHeadersStatus response_headers_status_;
134 135
135 // We buffer the response body as it arrives asynchronously from the stream. 136 // We buffer the response body as it arrives asynchronously from the stream.
136 SpdyReadQueue response_body_queue_; 137 SpdyReadQueue response_body_queue_;
137 138
138 CompletionCallback callback_; 139 CompletionCallback callback_;
139 140
140 // User provided buffer for the ReadResponseBody() response. 141 // User provided buffer for the ReadResponseBody() response.
141 scoped_refptr<IOBuffer> user_buffer_; 142 scoped_refptr<IOBuffer> user_buffer_;
142 int user_buffer_len_; 143 int user_buffer_len_;
143 144
144 // Temporary buffer used to read the request body from UploadDataStream. 145 // Temporary buffer used to read the request body from UploadDataStream.
145 scoped_refptr<IOBufferWithSize> request_body_buf_; 146 scoped_refptr<IOBufferWithSize> request_body_buf_;
146 int request_body_buf_size_; 147 int request_body_buf_size_;
147 148
148 // Is there a scheduled read callback pending. 149 // Is there a scheduled read callback pending.
149 bool buffered_read_callback_pending_; 150 bool buffered_read_callback_pending_;
150 // Has more data been received from the network during the wait for the 151 // Has more data been received from the network during the wait for the
151 // scheduled read callback. 152 // scheduled read callback.
152 bool more_read_data_pending_; 153 bool more_read_data_pending_;
153 154
154 // Is this spdy stream direct to the origin server (or to a proxy). 155 // Is this spdy stream direct to the origin server (or to a proxy).
155 bool direct_; 156 bool direct_;
156 157
157 DISALLOW_COPY_AND_ASSIGN(SpdyHttpStream); 158 DISALLOW_COPY_AND_ASSIGN(SpdyHttpStream);
158 }; 159 };
159 160
160 } // namespace net 161 } // namespace net
161 162
162 #endif // NET_SPDY_SPDY_HTTP_STREAM_H_ 163 #endif // NET_SPDY_SPDY_HTTP_STREAM_H_
OLDNEW
« no previous file with comments | « no previous file | net/spdy/spdy_http_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698