| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // Appends a representation of this object to the given pickle. | 81 // Appends a representation of this object to the given pickle. |
| 82 // The options argument can be a combination of PersistOptions. | 82 // The options argument can be a combination of PersistOptions. |
| 83 void Persist(base::Pickle* pickle, PersistOptions options); | 83 void Persist(base::Pickle* pickle, PersistOptions options); |
| 84 | 84 |
| 85 // Performs header merging as described in 13.5.3 of RFC 2616. | 85 // Performs header merging as described in 13.5.3 of RFC 2616. |
| 86 void Update(const HttpResponseHeaders& new_headers); | 86 void Update(const HttpResponseHeaders& new_headers); |
| 87 | 87 |
| 88 // Removes all instances of a particular header. | 88 // Removes all instances of a particular header. |
| 89 void RemoveHeader(const std::string& name); | 89 void RemoveHeader(const std::string& name); |
| 90 | 90 |
| 91 // Removes all instances of particular headers. |
| 92 void RemoveHeaders(const std::unordered_set<std::string>& header_names); |
| 93 |
| 91 // Removes a particular header line. The header name is compared | 94 // Removes a particular header line. The header name is compared |
| 92 // case-insensitively. | 95 // case-insensitively. |
| 93 void RemoveHeaderLine(const std::string& name, const std::string& value); | 96 void RemoveHeaderLine(const std::string& name, const std::string& value); |
| 94 | 97 |
| 95 // Adds a particular header. |header| has to be a single header without any | 98 // Adds a particular header. |header| has to be a single header without any |
| 96 // EOL termination, just [<header-name>: <header-values>] | 99 // EOL termination, just [<header-name>: <header-values>] |
| 97 // If a header with the same name is already stored, the two headers are not | 100 // If a header with the same name is already stored, the two headers are not |
| 98 // merged together by this method; the one provided is simply put at the | 101 // merged together by this method; the one provided is simply put at the |
| 99 // end of the list. | 102 // end of the list. |
| 100 void AddHeader(const std::string& header); | 103 void AddHeader(const std::string& header); |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 | 431 |
| 429 // The normalized http version (consistent with what GetStatusLine() returns). | 432 // The normalized http version (consistent with what GetStatusLine() returns). |
| 430 HttpVersion http_version_; | 433 HttpVersion http_version_; |
| 431 | 434 |
| 432 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); | 435 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); |
| 433 }; | 436 }; |
| 434 | 437 |
| 435 } // namespace net | 438 } // namespace net |
| 436 | 439 |
| 437 #endif // NET_HTTP_HTTP_RESPONSE_HEADERS_H_ | 440 #endif // NET_HTTP_HTTP_RESPONSE_HEADERS_H_ |
| OLD | NEW |