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

Unified Diff: net/http/http_response_headers.h

Issue 154243006: Add GetExpirationTimes() to HttpResponseHeader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, including TimeDelta::Max() Created 6 years, 10 months 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 | « no previous file | net/http/http_response_headers.cc » ('j') | net/http/http_response_headers.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_response_headers.h
diff --git a/net/http/http_response_headers.h b/net/http/http_response_headers.h
index 6a5dc83c35482bc22c07d1ba4fd367f31a76fa7f..d24721126303814ae0230a8ffe51a0f45af66e56 100644
--- a/net/http/http_response_headers.h
+++ b/net/http/http_response_headers.h
@@ -190,25 +190,32 @@ class NET_EXPORT HttpResponseHeaders
// redirect.
static bool IsRedirectResponseCode(int response_code);
- // Returns true if the response cannot be reused without validation. The
- // result is relative to the current_time parameter, which is a parameter to
- // support unit testing. The request_time parameter indicates the time at
+ // Returns the time from which this resource can no longer be reused without
+ // validation. |request_time| is the local time at which the request that
+ // resulted in this response was made. |response_time| is the local time at
+ // which we received this response.
+ base::Time GetFreshnessExpiry(base::Time request_time,
+ base::Time response_time) const;
+
+ // Returns true if the response cannot be reused without validation. The
+ // result is relative to the |current_time| parameter, which is a parameter to
+ // support unit testing. The |request_time| parameter indicates the time at
// which the request was made that resulted in this response, which was
- // received at response_time.
- bool RequiresValidation(const base::Time& request_time,
- const base::Time& response_time,
- const base::Time& current_time) const;
+ // received at |response_time|.
+ bool RequiresValidation(base::Time request_time,
+ base::Time response_time,
+ base::Time current_time) const;
// Returns the amount of time the server claims the response is fresh from
// the time the response was generated. See section 13.2.4 of RFC 2616. See
// RequiresValidation for a description of the response_time parameter.
- base::TimeDelta GetFreshnessLifetime(const base::Time& response_time) const;
+ base::TimeDelta GetFreshnessLifetime(base::Time response_time) const;
- // Returns the age of the response. See section 13.2.3 of RFC 2616.
- // See RequiresValidation for a description of this method's parameters.
- base::TimeDelta GetCurrentAge(const base::Time& request_time,
- const base::Time& response_time,
- const base::Time& current_time) const;
+ // Returns the time at which this resource had age zero. |request_time| is the
+ // local time at which the request that resulted in this response was made.
+ // |response_time| is the local time at which we received this response.
+ base::Time GetFreshnessOrigin(base::Time request_time,
+ base::Time response_time) const;
// The following methods extract values from the response headers. If a
// value is not present, then false is returned. Otherwise, true is returned
« no previous file with comments | « no previous file | net/http/http_response_headers.cc » ('j') | net/http/http_response_headers.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698