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

Issue 154243006: Add GetExpirationTimes() to HttpResponseHeader. (Closed)

Created:
6 years, 10 months ago by gavinp
Modified:
4 years, 7 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, gavinp+disk_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add GetExpirationTimes() to HttpResponseHeaders. This is the first step in propagating the explicit freshness lifetime to blink. The eventual goal is to remove much of the code parsing http caching headers in blink. R=japhet@chromium.org,rdsmith@chromium.org,darin@chromium.org,kinuko@chromium.org,mmenke@chromium.org BUG=340087

Patch Set 1 #

Patch Set 2 : clean up #

Patch Set 3 : clean up more call sites #

Patch Set 4 : ... and clean up the test. #

Patch Set 5 : improve comment #

Patch Set 6 : missing #include #

Patch Set 7 : moar comment twiddles #

Patch Set 8 : appcache #

Total comments: 2

Patch Set 9 : fix appcache call site #

Patch Set 10 : another comparison #

Patch Set 11 : remediate to review #

Total comments: 1

Patch Set 12 : rebase, including TimeDelta::Max() #

Total comments: 1

Patch Set 13 : rebase #

Patch Set 14 : remove RequiresValidation #

Patch Set 15 : simpler return in transaction #

Patch Set 16 : elide freshness origin #

Total comments: 4

Patch Set 17 : rebase #

Patch Set 18 : remediate to darin review #

Patch Set 19 : rebase #

Total comments: 6

Patch Set 20 : revive this CL #

Patch Set 21 : add tests, clean up more for landing #

Patch Set 22 : remove GetCurrentAge #

Patch Set 23 : moar comment #

Patch Set 24 : catch some users #

Total comments: 1

Patch Set 25 : fix a use #

Patch Set 26 : fix build #

Patch Set 27 : fix bad name #

Patch Set 28 : enum class #

Patch Set 29 : move a function body #

Total comments: 23
Unified diffs Side-by-side diffs Delta from patch set Stats (+448 lines, -456 lines) Patch
M chrome/browser/predictors/resource_prefetch_predictor.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +3 lines, -1 line 0 comments Download
M components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +3 lines, -2 lines 0 comments Download
M components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +5 lines, -2 lines 0 comments Download
M content/browser/appcache/appcache_update_job.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +4 lines, -3 lines 0 comments Download
M net/http/http_cache_transaction.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +7 lines, -0 lines 0 comments Download
M net/http/http_cache_transaction.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 5 chunks +33 lines, -32 lines 0 comments Download
M net/http/http_response_headers.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 4 chunks +34 lines, -35 lines 12 comments Download
M net/http/http_response_headers.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 3 chunks +168 lines, -177 lines 11 comments Download
M net/http/http_response_headers_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 chunks +184 lines, -198 lines 0 comments Download
M net/url_request/sdch_dictionary_fetcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +7 lines, -6 lines 0 comments Download

Messages

Total messages: 30 (4 generated)
gavinp
rvargas: PTAL. japhet: FYI. I was tempted to put the freshness expiry time in the ...
6 years, 10 months ago (2014-02-05 16:13:46 UTC) #1
gavinp
Hold off on reviewing, I had not realised how much of net was exported here. ...
6 years, 10 months ago (2014-02-05 16:43:04 UTC) #2
gavinp
+rdsmith,michaeln PTAL: rvargas PTAL(appcache_update_job.cc): michaeln FYI: japhet, rdsmith Can't wait to see the freshness expiry ...
6 years, 10 months ago (2014-02-05 20:26:31 UTC) #3
rvargas (doing something else)
https://codereview.chromium.org/154243006/diff/460001/net/http/http_response_headers.h File net/http/http_response_headers.h (right): https://codereview.chromium.org/154243006/diff/460001/net/http/http_response_headers.h#newcode216 net/http/http_response_headers.h:216: How about adding a new method instead: Time HttpResponseHeaders::GetFreshnessLimit(const ...
6 years, 10 months ago (2014-02-06 22:39:58 UTC) #4
gavinp
https://codereview.chromium.org/154243006/diff/460001/net/http/http_response_headers.h File net/http/http_response_headers.h (right): https://codereview.chromium.org/154243006/diff/460001/net/http/http_response_headers.h#newcode216 net/http/http_response_headers.h:216: On 2014/02/06 22:39:58, rvargas wrote: > > If you ...
6 years, 10 months ago (2014-02-07 15:59:18 UTC) #5
rvargas (doing something else)
On 2014/02/07 15:59:18, gavinp wrote: > https://codereview.chromium.org/154243006/diff/460001/net/http/http_response_headers.h > File net/http/http_response_headers.h (right): > > https://codereview.chromium.org/154243006/diff/460001/net/http/http_response_headers.h#newcode216 > ...
6 years, 10 months ago (2014-02-08 03:54:09 UTC) #6
gavinp
-michaeln, as we now have a compatibility function. rvargas, PTAL. I've added back RequiresValidation() as ...
6 years, 10 months ago (2014-02-12 17:49:46 UTC) #7
rvargas (doing something else)
I'm sorry, but as I mentioned before I don't find some of the functions that ...
6 years, 10 months ago (2014-02-12 20:00:16 UTC) #8
gavinp
I've now rebased this patch, and it is strictly downstream of the CL https://codereview.chromium.org/163413004/ . ...
6 years, 10 months ago (2014-02-13 17:37:59 UTC) #9
gavinp
On 2014/02/12 20:00:16, rvargas wrote: > I'm sorry, but as I mentioned before I don't ...
6 years, 10 months ago (2014-02-13 17:46:22 UTC) #10
gavinp
https://codereview.chromium.org/154243006/diff/1580003/net/http/http_response_headers.cc File net/http/http_response_headers.cc (right): https://codereview.chromium.org/154243006/diff/1580003/net/http/http_response_headers.cc#newcode930 net/http/http_response_headers.cc:930: bool HttpResponseHeaders::RequiresValidation(base::Time request_time, s/base::Time/Time/
6 years, 10 months ago (2014-02-13 18:50:25 UTC) #11
rvargas (doing something else)
On 2014/02/13 17:46:22, gavinp wrote: > On 2014/02/12 20:00:16, rvargas wrote: > > I'm sorry, ...
6 years, 10 months ago (2014-02-13 22:16:25 UTC) #12
gavinp
On 2014/02/13 22:16:25, rvargas wrote: > On 2014/02/13 17:46:22, gavinp wrote: > > On 2014/02/12 ...
6 years, 10 months ago (2014-02-26 01:54:11 UTC) #13
gavinp
+darin as reviewer. Darin, Ricardo and I can't see eye to eye on this change, ...
6 years, 10 months ago (2014-02-26 02:05:44 UTC) #14
gavinp
Nota Bene: this CL is downstream of https://codereview.chromium.org/163413004/ , which is as of this writing ...
6 years, 10 months ago (2014-02-26 02:06:37 UTC) #15
darin (slow to review)
When I wrote this code, I intentionally tried to model some of the methods after ...
6 years, 10 months ago (2014-02-26 05:51:06 UTC) #16
gavinp
On 2014/02/26 05:51:06, darin wrote: > When I wrote this code, I intentionally tried to ...
6 years, 10 months ago (2014-02-26 17:12:04 UTC) #17
gavinp
https://codereview.chromium.org/154243006/diff/2280001/net/http/http_response_headers.cc File net/http/http_response_headers.cc (right): https://codereview.chromium.org/154243006/diff/2280001/net/http/http_response_headers.cc#newcode927 net/http/http_response_headers.cc:927: // From RFC 2616 section 13.2.3: On 2014/02/26 05:51:07, ...
6 years, 10 months ago (2014-02-26 17:12:27 UTC) #18
gavinp
The upstream CL has landed, and this is now based on trunk.
6 years, 10 months ago (2014-02-26 21:03:13 UTC) #19
rvargas (doing something else)
On 2014/02/26 01:54:11, gavinp wrote: > On 2014/02/13 22:16:25, rvargas wrote: > > On 2014/02/13 ...
6 years, 10 months ago (2014-02-26 21:03:22 UTC) #20
gavinp
+rdsmith, PTAL. darin: I've remediated to your requests; are you going to take a second ...
6 years, 9 months ago (2014-03-26 12:59:43 UTC) #21
darin (slow to review)
Sorry for the delayed response. I didn't realize you were waiting on me :-( https://codereview.chromium.org/154243006/diff/2320001/net/http/http_response_headers.cc ...
6 years, 9 months ago (2014-03-26 16:16:27 UTC) #22
gavinp
Here's another long in the tooth CL that is coming back to life. I believe ...
4 years, 7 months ago (2016-04-29 15:04:51 UTC) #27
mmenke
Seems like a significant API improvement to me. Quick comments. https://codereview.chromium.org/154243006/diff/2530001/net/http/http_response_headers.cc File net/http/http_response_headers.cc (right): https://codereview.chromium.org/154243006/diff/2530001/net/http/http_response_headers.cc#newcode803 ...
4 years, 7 months ago (2016-04-29 16:15:54 UTC) #28
mmenke
And, just for the record (And after a quick conversation with Gavin), I'm aware most ...
4 years, 7 months ago (2016-04-29 17:30:05 UTC) #29
Randy Smith (Not in Mondays)
4 years, 7 months ago (2016-05-04 19:22:16 UTC) #30
This all looks pretty good to me--I don't expect any major comments after this
round.  I agree with Matt about cleaning up the comments as part of the code
movement (and feel pretty strongly about not referring to functions and
structures that no longer exist in those comments).

https://codereview.chromium.org/154243006/diff/2530001/net/http/http_response...
File net/http/http_response_headers.cc (right):

https://codereview.chromium.org/154243006/diff/2530001/net/http/http_response...
net/http/http_response_headers.cc:830: // Expires header after checking for
max-age in GetFreshnessLifetimes.  This
This comment seems out of date, since I don't think there's a function of this
name in this file anymore.

https://codereview.chromium.org/154243006/diff/2530001/net/http/http_response...
net/http/http_response_headers.cc:844: // The expires value can be a date in the
past!
nit, suggestion: I'd value a comment here indicating what the spec behavior is
when the expires value is a date in the past.  It looks like it's ignored in
that case, but that's surprising to me, so I'd ideally have it confirmed by
comment.

https://codereview.chromium.org/154243006/diff/2530001/net/http/http_response...
net/http/http_response_headers.cc:885: *out_freshness_lifetime = (date_value -
last_modified_value) / 10;
On 2016/04/29 16:15:53, mmenke wrote:
> This "/ 10" is just a magic heuristic?  Maybe comment on that?

There's a comment about it at the top of the function; maybe a reference to that
comment?

https://codereview.chromium.org/154243006/diff/2530001/net/http/http_response...
File net/http/http_response_headers.h (right):

https://codereview.chromium.org/154243006/diff/2530001/net/http/http_response...
net/http/http_response_headers.h:50: base::Time GetExpirationTime() const {
I find it confusing (found it confusing in one of the call sites) to have a
GetExpirationTime() function on an ExpirationTime class; the function is a
specialization of some sort, but the name doesn't indicate what sort.  How would
you feel about GetSyncExpirationTime() instead?

https://codereview.chromium.org/154243006/diff/2530001/net/http/http_response...
net/http/http_response_headers.h:58: 
Why can't the rest of this structure be private?  It seems to me as if the
appropriate information to export to consumers it above this point in the
structure; under what circumstances do the consumers need to know what the
lifetime TimeDelta values are?

https://codereview.chromium.org/154243006/diff/2530001/net/http/http_response...
net/http/http_response_headers.h:64: // How long the resource will be fresh for.
nit: Given that this is a time delta, wouldn't it make sense to have the anchor
(e.g. "... will be fresh for after the response is received (??)")

https://codereview.chromium.org/154243006/diff/2530001/net/http/http_response...
net/http/http_response_headers.h:68: // usable (if async revalidation is
enabled).
On 2016/04/29 16:15:54, mmenke wrote:
> This comment is wrong.  This implies that GetAsyncExpirationTime should be
> corrected_response_time + staleness_lifetime + freshness_lifetime.

+1 (mostly as a reminder to myself to come back and understand the resolution of
this comment, since I think it affects my private/public/etc. musings above)

https://codereview.chromium.org/154243006/diff/2530001/net/http/http_response...
net/http/http_response_headers.h:360: // the definition of FreshnessLifetimes
above for the meaning of the return
I don't believe that RequiresValidation() or FreshnessLifetimes exist anymore,
at least under those names.  This comment needs to be rewritten?

Powered by Google App Engine
This is Rietveld 408576698