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_SPDY_SPDY_HEADER_BLOCK_H_ | 5 #ifndef NET_SPDY_SPDY_HEADER_BLOCK_H_ |
6 #define NET_SPDY_SPDY_HEADER_BLOCK_H_ | 6 #define NET_SPDY_SPDY_HEADER_BLOCK_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // If a header with the key is already present, then append the value to the | 99 // If a header with the key is already present, then append the value to the |
100 // existing header value, NUL ("\0") separated unless the key is cookie, in | 100 // existing header value, NUL ("\0") separated unless the key is cookie, in |
101 // which case the separator is "; ". | 101 // which case the separator is "; ". |
102 // If there is no such key, a new header with the key and value is added. | 102 // If there is no such key, a new header with the key and value is added. |
103 void AppendValueOrAddHeader(const base::StringPiece key, | 103 void AppendValueOrAddHeader(const base::StringPiece key, |
104 const base::StringPiece value); | 104 const base::StringPiece value); |
105 | 105 |
106 // Allows either lookup or mutation of the value associated with a key. | 106 // Allows either lookup or mutation of the value associated with a key. |
107 ValueProxy operator[](const base::StringPiece key); | 107 ValueProxy operator[](const base::StringPiece key); |
108 | 108 |
109 // Non-mutating lookup of header value. Returns empty StringPiece if key not | |
110 // present. To distinguish between absence of header and empty header value, | |
111 // use find(). | |
112 base::StringPiece GetHeader(const base::StringPiece key) const; | |
113 | |
114 // This object provides automatic conversions that allow SpdyHeaderBlock to be | 109 // This object provides automatic conversions that allow SpdyHeaderBlock to be |
115 // nearly a drop-in replacement for linked_hash_map<string, string>. It reads | 110 // nearly a drop-in replacement for linked_hash_map<string, string>. It reads |
116 // data from or writes data to a SpdyHeaderBlock::Storage. | 111 // data from or writes data to a SpdyHeaderBlock::Storage. |
117 class NET_EXPORT ValueProxy { | 112 class NET_EXPORT ValueProxy { |
118 public: | 113 public: |
119 ~ValueProxy(); | 114 ~ValueProxy(); |
120 | 115 |
121 // Moves are allowed. | 116 // Moves are allowed. |
122 ValueProxy(ValueProxy&& other); | 117 ValueProxy(ValueProxy&& other); |
123 ValueProxy& operator=(ValueProxy&& other); | 118 ValueProxy& operator=(ValueProxy&& other); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // to |headers|. |event_param| must have been created by | 162 // to |headers|. |event_param| must have been created by |
168 // SpdyHeaderBlockNetLogCallback. On failure, returns false and clears | 163 // SpdyHeaderBlockNetLogCallback. On failure, returns false and clears |
169 // |headers|. | 164 // |headers|. |
170 NET_EXPORT bool SpdyHeaderBlockFromNetLogParam( | 165 NET_EXPORT bool SpdyHeaderBlockFromNetLogParam( |
171 const base::Value* event_param, | 166 const base::Value* event_param, |
172 SpdyHeaderBlock* headers); | 167 SpdyHeaderBlock* headers); |
173 | 168 |
174 } // namespace net | 169 } // namespace net |
175 | 170 |
176 #endif // NET_SPDY_SPDY_HEADER_BLOCK_H_ | 171 #endif // NET_SPDY_SPDY_HEADER_BLOCK_H_ |
OLD | NEW |