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

Side by Side Diff: net/http/http_response_headers.h

Issue 21158: Fix a logic error in the handling the response to an HTTP... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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/http/http_network_transaction_unittest.cc ('k') | net/tools/testserver/testserver.py » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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_HTTP_RESPONSE_HEADERS_H_ 5 #ifndef NET_HTTP_RESPONSE_HEADERS_H_
6 #define NET_HTTP_RESPONSE_HEADERS_H_ 6 #define NET_HTTP_RESPONSE_HEADERS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 // Extracts the value of the Content-Length header or returns -1 if there is 195 // Extracts the value of the Content-Length header or returns -1 if there is
196 // no such header in the response. 196 // no such header in the response.
197 int64 GetContentLength() const; 197 int64 GetContentLength() const;
198 198
199 // Returns the HTTP response code. This is 0 if the response code text seems 199 // Returns the HTTP response code. This is 0 if the response code text seems
200 // to exist but could not be parsed. Otherwise, it defaults to 200 if the 200 // to exist but could not be parsed. Otherwise, it defaults to 200 if the
201 // response code is not found in the raw headers. 201 // response code is not found in the raw headers.
202 int response_code() const { return response_code_; } 202 int response_code() const { return response_code_; }
203 203
204 // Sets the HTTP response code to the new code. The original HTTP response
205 // code is still available in the raw and parsed headers.
206 void set_response_code(int new_code) { response_code_ = new_code; }
207
204 // Returns the raw header string. 208 // Returns the raw header string.
205 const std::string& raw_headers() const { return raw_headers_; } 209 const std::string& raw_headers() const { return raw_headers_; }
206 210
207 private: 211 private:
208 friend class base::RefCountedThreadSafe<HttpResponseHeaders>; 212 friend class base::RefCountedThreadSafe<HttpResponseHeaders>;
209 213
210 HttpResponseHeaders() {} 214 HttpResponseHeaders() {}
211 ~HttpResponseHeaders() {} 215 ~HttpResponseHeaders() {}
212 216
213 // Initializes from the given raw headers. 217 // Initializes from the given raw headers.
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 302
299 // The parsed http version number (not normalized). 303 // The parsed http version number (not normalized).
300 HttpVersion parsed_http_version_; 304 HttpVersion parsed_http_version_;
301 305
302 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); 306 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders);
303 }; 307 };
304 308
305 } // namespace net 309 } // namespace net
306 310
307 #endif // NET_HTTP_RESPONSE_HEADERS_H_ 311 #endif // NET_HTTP_RESPONSE_HEADERS_H_
OLDNEW
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698