Skip to content

Commit

Permalink
Use DCHECK_EQ() when comparing TimeDeltas.
Browse files Browse the repository at this point in the history
This CL is a part of https://codereview.chromium.org/665023002/ ("Post-commit
fixes for "stale-while-revalidate..."") that has been separated into a separate
CL because it depends on https://codereview.chromium.org/669083002/ ("Add
logging support for base::Time* types.").

BUG=348877

Review URL: https://codereview.chromium.org/670303003

Cr-Commit-Position: refs/heads/master@{#302065}
  • Loading branch information
ricea authored and Commit bot committed Oct 30, 2014
1 parent 297afd0 commit eb15044
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/http/http_response_headers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ HttpResponseHeaders::GetFreshnessLifetimes(const Time& response_time) const {
bool must_revalidate = HasHeaderValue("cache-control", "must-revalidate");

if (must_revalidate || !GetStaleWhileRevalidateValue(&lifetimes.staleness)) {
DCHECK(lifetimes.staleness == TimeDelta());
DCHECK_EQ(TimeDelta(), lifetimes.staleness);
}

// NOTE: "Cache-Control: max-age" overrides Expires, so we only check the
Expand All @@ -1045,7 +1045,7 @@ HttpResponseHeaders::GetFreshnessLifetimes(const Time& response_time) const {
return lifetimes;
}

DCHECK(lifetimes.freshness == TimeDelta());
DCHECK_EQ(TimeDelta(), lifetimes.freshness);
return lifetimes;
}

Expand Down Expand Up @@ -1097,7 +1097,7 @@ HttpResponseHeaders::GetFreshnessLifetimes(const Time& response_time) const {
// Our heuristic freshness estimate for this resource is 0 seconds, in
// accordance with common browser behaviour. However, stale-while-revalidate
// may still apply.
DCHECK(lifetimes.freshness == TimeDelta());
DCHECK_EQ(TimeDelta(), lifetimes.freshness);
return lifetimes;
}

Expand Down

0 comments on commit eb15044

Please sign in to comment.