| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 bool HasValidators() const; | 285 bool HasValidators() const; |
| 286 | 286 |
| 287 // Extracts the value of the Content-Length header or returns -1 if there is | 287 // Extracts the value of the Content-Length header or returns -1 if there is |
| 288 // no such header in the response. | 288 // no such header in the response. |
| 289 int64_t GetContentLength() const; | 289 int64_t GetContentLength() const; |
| 290 | 290 |
| 291 // Extracts the value of the specified header or returns -1 if there is no | 291 // Extracts the value of the specified header or returns -1 if there is no |
| 292 // such header in the response. | 292 // such header in the response. |
| 293 int64_t GetInt64HeaderValue(const std::string& header) const; | 293 int64_t GetInt64HeaderValue(const std::string& header) const; |
| 294 | 294 |
| 295 // Extracts the values in a Content-Range header and returns true if they are | 295 // Extracts the values in a Content-Range header and returns true if all three |
| 296 // valid for a 206 response; otherwise returns false. | 296 // values are present and valid for a 206 response; otherwise returns false. |
| 297 // The following values will be outputted: | 297 // The following values will be outputted: |
| 298 // |*first_byte_position| = inclusive position of the first byte of the range | 298 // |*first_byte_position| = inclusive position of the first byte of the range |
| 299 // |*last_byte_position| = inclusive position of the last byte of the range | 299 // |*last_byte_position| = inclusive position of the last byte of the range |
| 300 // |*instance_length| = size in bytes of the object requested | 300 // |*instance_length| = size in bytes of the object requested |
| 301 // If any of the above values is unknown, its value will be -1. | 301 // If this method returns false, then all of the outputs will be -1. |
| 302 bool GetContentRange(int64_t* first_byte_position, | 302 bool GetContentRangeFor206(int64_t* first_byte_position, |
| 303 int64_t* last_byte_position, | 303 int64_t* last_byte_position, |
| 304 int64_t* instance_length) const; | 304 int64_t* instance_length) const; |
| 305 | 305 |
| 306 // Returns true if the response is chunk-encoded. | 306 // Returns true if the response is chunk-encoded. |
| 307 bool IsChunkEncoded() const; | 307 bool IsChunkEncoded() const; |
| 308 | 308 |
| 309 // Creates a Value for use with the NetLog containing the response headers. | 309 // Creates a Value for use with the NetLog containing the response headers. |
| 310 std::unique_ptr<base::Value> NetLogCallback( | 310 std::unique_ptr<base::Value> NetLogCallback( |
| 311 NetLogCaptureMode capture_mode) const; | 311 NetLogCaptureMode capture_mode) const; |
| 312 | 312 |
| 313 // Takes in a Value created by the above function, and attempts to create a | 313 // Takes in a Value created by the above function, and attempts to create a |
| 314 // copy of the original headers. Returns true on success. On failure, | 314 // copy of the original headers. Returns true on success. On failure, |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 | 428 |
| 429 // The normalized http version (consistent with what GetStatusLine() returns). | 429 // The normalized http version (consistent with what GetStatusLine() returns). |
| 430 HttpVersion http_version_; | 430 HttpVersion http_version_; |
| 431 | 431 |
| 432 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); | 432 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); |
| 433 }; | 433 }; |
| 434 | 434 |
| 435 } // namespace net | 435 } // namespace net |
| 436 | 436 |
| 437 #endif // NET_HTTP_HTTP_RESPONSE_HEADERS_H_ | 437 #endif // NET_HTTP_HTTP_RESPONSE_HEADERS_H_ |
| OLD | NEW |