| 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_HTTP_HTTP_RESPONSE_HEADERS_H_ | 5 #ifndef NET_HTTP_HTTP_RESPONSE_HEADERS_H_ |
| 6 #define NET_HTTP_HTTP_RESPONSE_HEADERS_H_ | 6 #define NET_HTTP_HTTP_RESPONSE_HEADERS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 // first matching header value and parses its value as a HTTP-date. | 251 // first matching header value and parses its value as a HTTP-date. |
| 252 bool GetTimeValuedHeader(const std::string& name, base::Time* result) const; | 252 bool GetTimeValuedHeader(const std::string& name, base::Time* result) const; |
| 253 | 253 |
| 254 // Determines if this response indicates a keep-alive connection. | 254 // Determines if this response indicates a keep-alive connection. |
| 255 bool IsKeepAlive() const; | 255 bool IsKeepAlive() const; |
| 256 | 256 |
| 257 // Returns true if this response has a strong etag or last-modified header. | 257 // Returns true if this response has a strong etag or last-modified header. |
| 258 // See section 13.3.3 of RFC 2616. | 258 // See section 13.3.3 of RFC 2616. |
| 259 bool HasStrongValidators() const; | 259 bool HasStrongValidators() const; |
| 260 | 260 |
| 261 // Returns true if this response has any validator (either a Last-Modified or |
| 262 // an ETag) regardless of whether it is strong or weak. See section 13.3.3 of |
| 263 // RFC 2616. |
| 264 bool HasValidators() const; |
| 265 |
| 261 // Extracts the value of the Content-Length header or returns -1 if there is | 266 // Extracts the value of the Content-Length header or returns -1 if there is |
| 262 // no such header in the response. | 267 // no such header in the response. |
| 263 int64_t GetContentLength() const; | 268 int64_t GetContentLength() const; |
| 264 | 269 |
| 265 // Extracts the value of the specified header or returns -1 if there is no | 270 // Extracts the value of the specified header or returns -1 if there is no |
| 266 // such header in the response. | 271 // such header in the response. |
| 267 int64_t GetInt64HeaderValue(const std::string& header) const; | 272 int64_t GetInt64HeaderValue(const std::string& header) const; |
| 268 | 273 |
| 269 // Extracts the values in a Content-Range header and returns true if they are | 274 // Extracts the values in a Content-Range header and returns true if they are |
| 270 // valid for a 206 response; otherwise returns false. | 275 // valid for a 206 response; otherwise returns false. |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 | 406 |
| 402 // The normalized http version (consistent with what GetStatusLine() returns). | 407 // The normalized http version (consistent with what GetStatusLine() returns). |
| 403 HttpVersion http_version_; | 408 HttpVersion http_version_; |
| 404 | 409 |
| 405 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); | 410 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); |
| 406 }; | 411 }; |
| 407 | 412 |
| 408 } // namespace net | 413 } // namespace net |
| 409 | 414 |
| 410 #endif // NET_HTTP_HTTP_RESPONSE_HEADERS_H_ | 415 #endif // NET_HTTP_HTTP_RESPONSE_HEADERS_H_ |
| OLD | NEW |