| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // case-insensitively. | 90 // case-insensitively. |
| 91 void RemoveHeaderLine(const std::string& name, const std::string& value); | 91 void RemoveHeaderLine(const std::string& name, const std::string& value); |
| 92 | 92 |
| 93 // Adds a particular header. |header| has to be a single header without any | 93 // Adds a particular header. |header| has to be a single header without any |
| 94 // EOL termination, just [<header-name>: <header-values>] | 94 // EOL termination, just [<header-name>: <header-values>] |
| 95 // If a header with the same name is already stored, the two headers are not | 95 // If a header with the same name is already stored, the two headers are not |
| 96 // merged together by this method; the one provided is simply put at the | 96 // merged together by this method; the one provided is simply put at the |
| 97 // end of the list. | 97 // end of the list. |
| 98 void AddHeader(const std::string& header); | 98 void AddHeader(const std::string& header); |
| 99 | 99 |
| 100 // Adds a cookie header. |cookie_string| should be the header value without |
| 101 // the header name (Set-Cookie). |
| 102 void AddCookie(const std::string& cookie_string); |
| 103 |
| 100 // Replaces the current status line with the provided one (|new_status| should | 104 // Replaces the current status line with the provided one (|new_status| should |
| 101 // not have any EOL). | 105 // not have any EOL). |
| 102 void ReplaceStatusLine(const std::string& new_status); | 106 void ReplaceStatusLine(const std::string& new_status); |
| 103 | 107 |
| 104 // Updates headers (Content-Length and Content-Range) in the |headers| to | 108 // Updates headers (Content-Length and Content-Range) in the |headers| to |
| 105 // include the right content length and range for |byte_range|. This also | 109 // include the right content length and range for |byte_range|. This also |
| 106 // updates HTTP status line if |replace_status_line| is true. | 110 // updates HTTP status line if |replace_status_line| is true. |
| 107 // |byte_range| must have a valid, bounded range (i.e. coming from a valid | 111 // |byte_range| must have a valid, bounded range (i.e. coming from a valid |
| 108 // response or should be usable for a response). | 112 // response or should be usable for a response). |
| 109 void UpdateWithNewRange(const HttpByteRange& byte_range, | 113 void UpdateWithNewRange(const HttpByteRange& byte_range, |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 | 426 |
| 423 // The normalized http version (consistent with what GetStatusLine() returns). | 427 // The normalized http version (consistent with what GetStatusLine() returns). |
| 424 HttpVersion http_version_; | 428 HttpVersion http_version_; |
| 425 | 429 |
| 426 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); | 430 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); |
| 427 }; | 431 }; |
| 428 | 432 |
| 429 } // namespace net | 433 } // namespace net |
| 430 | 434 |
| 431 #endif // NET_HTTP_HTTP_RESPONSE_HEADERS_H_ | 435 #endif // NET_HTTP_HTTP_RESPONSE_HEADERS_H_ |
| OLD | NEW |