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

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: elide freshness origin 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
Index: net/http/http_response_headers.h
diff --git a/net/http/http_response_headers.h b/net/http/http_response_headers.h
index deba3b6d974fd45c42f20d8b7f94b14182d1573f..6de8dce61e4eec0291934ac3ecce57c7381fb64f 100644
--- a/net/http/http_response_headers.h
+++ b/net/http/http_response_headers.h
@@ -190,25 +190,17 @@ 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
- // 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;
+ // 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,
darin (slow to review) 2014/02/26 05:51:07 nit: Wouldn't this more canonically be called GetE
gavinp 2014/02/26 17:12:28 Yes, that's a more canonical name. There's no reas
+ base::Time response_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;
-
- // 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;
+ base::TimeDelta GetFreshnessLifetime(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

Powered by Google App Engine
This is Rietveld 408576698