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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/strings/string_piece.h" | 14 #include "base/strings/string_piece.h" |
15 #include "net/base/net_export.h" | 15 #include "net/base/net_export.h" |
16 #include "net/http/http_version.h" | 16 #include "net/http/http_version.h" |
17 #include "net/log/net_log.h" | 17 #include "net/log/net_log.h" |
18 | 18 |
| 19 namespace base { |
19 class Pickle; | 20 class Pickle; |
20 class PickleIterator; | 21 class PickleIterator; |
21 | |
22 namespace base { | |
23 class Time; | 22 class Time; |
24 class TimeDelta; | 23 class TimeDelta; |
25 } | 24 } |
26 | 25 |
27 namespace net { | 26 namespace net { |
28 | 27 |
29 class HttpByteRange; | 28 class HttpByteRange; |
30 | 29 |
31 enum ValidationType { | 30 enum ValidationType { |
32 VALIDATION_NONE, // The resource is fresh. | 31 VALIDATION_NONE, // The resource is fresh. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // (Note that line continuations should have already been joined; | 64 // (Note that line continuations should have already been joined; |
66 // see HttpUtil::AssembleRawHeaders) | 65 // see HttpUtil::AssembleRawHeaders) |
67 // | 66 // |
68 // HttpResponseHeaders does not perform any encoding changes on the input. | 67 // HttpResponseHeaders does not perform any encoding changes on the input. |
69 // | 68 // |
70 explicit HttpResponseHeaders(const std::string& raw_headers); | 69 explicit HttpResponseHeaders(const std::string& raw_headers); |
71 | 70 |
72 // Initializes from the representation stored in the given pickle. The data | 71 // Initializes from the representation stored in the given pickle. The data |
73 // for this object is found relative to the given pickle_iter, which should | 72 // for this object is found relative to the given pickle_iter, which should |
74 // be passed to the pickle's various Read* methods. | 73 // be passed to the pickle's various Read* methods. |
75 explicit HttpResponseHeaders(PickleIterator* pickle_iter); | 74 explicit HttpResponseHeaders(base::PickleIterator* pickle_iter); |
76 | 75 |
77 // Appends a representation of this object to the given pickle. | 76 // Appends a representation of this object to the given pickle. |
78 // The options argument can be a combination of PersistOptions. | 77 // The options argument can be a combination of PersistOptions. |
79 void Persist(Pickle* pickle, PersistOptions options); | 78 void Persist(base::Pickle* pickle, PersistOptions options); |
80 | 79 |
81 // Performs header merging as described in 13.5.3 of RFC 2616. | 80 // Performs header merging as described in 13.5.3 of RFC 2616. |
82 void Update(const HttpResponseHeaders& new_headers); | 81 void Update(const HttpResponseHeaders& new_headers); |
83 | 82 |
84 // Removes all instances of a particular header. | 83 // Removes all instances of a particular header. |
85 void RemoveHeader(const std::string& name); | 84 void RemoveHeader(const std::string& name); |
86 | 85 |
87 // Removes a particular header line. The header name is compared | 86 // Removes a particular header line. The header name is compared |
88 // case-insensitively. | 87 // case-insensitively. |
89 void RemoveHeaderLine(const std::string& name, const std::string& value); | 88 void RemoveHeaderLine(const std::string& name, const std::string& value); |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 | 408 |
410 // The parsed http version number (not normalized). | 409 // The parsed http version number (not normalized). |
411 HttpVersion parsed_http_version_; | 410 HttpVersion parsed_http_version_; |
412 | 411 |
413 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); | 412 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); |
414 }; | 413 }; |
415 | 414 |
416 } // namespace net | 415 } // namespace net |
417 | 416 |
418 #endif // NET_HTTP_HTTP_RESPONSE_HEADERS_H_ | 417 #endif // NET_HTTP_HTTP_RESPONSE_HEADERS_H_ |
OLD | NEW |