Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1020)

Side by Side Diff: net/http/http_util.h

Issue 1481143002: Added HttpUtils::HasValidators and HttpResponse::HasValidators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed first batch of bengr@'s comments Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_UTIL_H_ 5 #ifndef NET_HTTP_HTTP_UTIL_H_
6 #define NET_HTTP_HTTP_UTIL_H_ 6 #define NET_HTTP_HTTP_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 const std::string& header_value, 196 const std::string& header_value,
197 std::string* headers); 197 std::string* headers);
198 198
199 // Returns true if the parameters describe a response with a strong etag or 199 // Returns true if the parameters describe a response with a strong etag or
200 // last-modified header. See section 13.3.3 of RFC 2616. 200 // last-modified header. See section 13.3.3 of RFC 2616.
201 static bool HasStrongValidators(HttpVersion version, 201 static bool HasStrongValidators(HttpVersion version,
202 const std::string& etag_header, 202 const std::string& etag_header,
203 const std::string& last_modified_header, 203 const std::string& last_modified_header,
204 const std::string& date_header); 204 const std::string& date_header);
205 205
206 // Returns true if this response has any validator (either a Last-Modified or
207 // an ETag) regardless if they are strong or weak. See section 13.3.3 of RFC
bengr 2016/02/21 21:08:05 Fix this comment to as per my last comment.
jamartin 2016/02/22 16:49:43 Done.
208 // 2616.
209 static bool HasValidators(HttpVersion version,
210 const std::string& etag_header,
211 const std::string& last_modified_header);
212
206 // Gets a vector of common HTTP status codes for histograms of status 213 // Gets a vector of common HTTP status codes for histograms of status
207 // codes. Currently returns everything in the range [100, 600), plus 0 214 // codes. Currently returns everything in the range [100, 600), plus 0
208 // (for invalid responses/status codes). 215 // (for invalid responses/status codes).
209 static std::vector<int> GetStatusCodesForHistogram(); 216 static std::vector<int> GetStatusCodesForHistogram();
210 217
211 // Maps an HTTP status code to one of the status codes in the vector 218 // Maps an HTTP status code to one of the status codes in the vector
212 // returned by GetStatusCodesForHistogram. 219 // returned by GetStatusCodesForHistogram.
213 static int MapStatusCodeForHistogram(int code); 220 static int MapStatusCodeForHistogram(int code);
214 221
215 // Used to iterate over the name/value pairs of HTTP headers. To iterate 222 // Used to iterate over the name/value pairs of HTTP headers. To iterate
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 390
384 // True if values are required for each name/value pair; false if a 391 // True if values are required for each name/value pair; false if a
385 // name is permitted to appear without a corresponding value. 392 // name is permitted to appear without a corresponding value.
386 bool values_optional_; 393 bool values_optional_;
387 }; 394 };
388 }; 395 };
389 396
390 } // namespace net 397 } // namespace net
391 398
392 #endif // NET_HTTP_HTTP_UTIL_H_ 399 #endif // NET_HTTP_HTTP_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698