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

Unified Diff: net/http/http_response_headers.cc

Issue 2644063003: HTTP Cache Age calculation mechanism changed with RFC 7234 (Closed)
Patch Set: Created 3 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_response_headers.cc
diff --git a/net/http/http_response_headers.cc b/net/http/http_response_headers.cc
index dd0977c3dca046bda530e2e8c254fc796491fe8e..0e94bc5bb249386ba6f500e1572fc40f778f60dc 100644
--- a/net/http/http_response_headers.cc
+++ b/net/http/http_response_headers.cc
@@ -1144,9 +1144,9 @@ TimeDelta HttpResponseHeaders::GetCurrentAge(const Time& request_time,
GetAgeValue(&age_value);
TimeDelta apparent_age = std::max(TimeDelta(), response_time - date_value);
- TimeDelta corrected_received_age = std::max(apparent_age, age_value);
TimeDelta response_delay = response_time - request_time;
- TimeDelta corrected_initial_age = corrected_received_age + response_delay;
+ TimeDelta corrected_age_value = age_value + response_delay;
+ TimeDelta corrected_initial_age = std::max(apparent_age, corrected_age_value);
mmenke 2017/01/19 16:11:18 We should have a test for the changed behavior.
billyjay 2017/01/20 19:23:26 Done.
TimeDelta resident_time = current_time - response_time;
TimeDelta current_age = corrected_initial_age + resident_time;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698