| Index: net/http/http_response_headers.h
|
| diff --git a/net/http/http_response_headers.h b/net/http/http_response_headers.h
|
| index ddab798c0a2c0795556d1b2da0a583574c581553..2bba2e11aa49cfa4622a7ea317c4314882df0d31 100644
|
| --- a/net/http/http_response_headers.h
|
| +++ b/net/http/http_response_headers.h
|
| @@ -43,6 +43,14 @@ class NET_EXPORT HttpResponseHeaders
|
| static const PersistOptions PERSIST_SANS_RANGES = 1 << 4;
|
| static const PersistOptions PERSIST_SANS_SECURITY_STATE = 1 << 5;
|
|
|
| + enum ValidationType {
|
| + VALIDATION_NONE = 0, // the resource is fresh
|
| + VALIDATION_ASYNCHRONOUS, // the resource requires async revalidation
|
| + VALIDATION_SYNCHRONOUS // the resource requires sync revalidation
|
| + };
|
| +
|
| + enum FreshnessType { NEVER_FRESH, MAYBE_FRESH };
|
| +
|
| static const char kContentRange[];
|
|
|
| // Parses the given raw_headers. raw_headers should be formatted thus:
|
| @@ -201,19 +209,27 @@ 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 amount of time the server claims the response is fresh from
|
| + // Returns VALIDATION_NONE if the response can be reused without
|
| + // validation. VALIDATION_ASYNCHRONOUS means the response can be re-used, but
|
| + // asynchronous revalidation must be performed. VALIDATION_SYNCHRONOUS means
|
| + // that the result cannot be reused without revalidation.
|
| + // 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.
|
| + ValidationType RequiresValidation(const base::Time& request_time,
|
| + const base::Time& response_time,
|
| + const base::Time& current_time) const;
|
| +
|
| + // Calculates 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 NEVER_FRESH and sets |lifetime| to zero if there is a header that
|
| + // prohibits the use of the response, otherwise returns MAYBE_FRESH. This
|
| + // allows us to distinguish cases when a stale response cannot be used by
|
| + // stale-while-revalidate.
|
| + FreshnessType GetFreshnessLifetime(const base::Time& response_time,
|
| + base::TimeDelta* lifetime) 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.
|
|
|