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

Unified Diff: net/http/http_util.h

Issue 706203003: Update from https://crrev.com/303153 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_stream_factory_impl_unittest.cc ('k') | net/http/http_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_util.h
diff --git a/net/http/http_util.h b/net/http/http_util.h
index bde65dc797b14791a1911494bb4b8a18852c2667..211e6340159bf856b3bf9cbb96ee2649c1b68d84 100644
--- a/net/http/http_util.h
+++ b/net/http/http_util.h
@@ -10,6 +10,7 @@
#include "base/memory/ref_counted.h"
#include "base/strings/string_tokenizer.h"
+#include "base/time/time.h"
#include "net/base/net_export.h"
#include "net/http/http_byte_range.h"
#include "net/http/http_version.h"
@@ -66,6 +67,15 @@ class NET_EXPORT HttpUtil {
static bool ParseRangeHeader(const std::string& range_specifier,
std::vector<HttpByteRange>* ranges);
+ // Parses a Retry-After header that is either an absolute date/time or a
+ // number of seconds in the future. Interprets absolute times as relative to
+ // |now|. If |retry_after_string| is successfully parsed and indicates a time
+ // that is not in the past, fills in |*retry_after| and returns true;
+ // otherwise, returns false.
+ static bool ParseRetryAfterHeader(const std::string& retry_after_string,
+ base::Time now,
+ base::TimeDelta* retry_after);
+
// Scans the '\r\n'-delimited headers for the given header name. Returns
// true if a match is found. Input is assumed to be well-formed.
// TODO(darin): kill this
« no previous file with comments | « net/http/http_stream_factory_impl_unittest.cc ('k') | net/http/http_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698