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

Issue 793823002: Let prefetched resources skip cache revalidation once for a short duration. (Closed)

Created:
6 years ago by jkarlin
Modified:
5 years, 11 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, gavinp+disk_chromium.org, Zhen Wang
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Let prefetched resources skip cache revalidation once for a short duration by adding an "unused_since_prefetch" boolean to HttpResponseInfo and setting it when LOAD_PREFETCH is used on a new or existing entry. The first read of a prefetched resource will skip validation if it is within 5 minutes and unset the "unused_since_prefetch" bit. Unsetting the bit requires writing metadata on a cache hit, which is a slight change to the state machine. I also added a test clock to http_cache_unittests which makes testing easier. BUG=383394 Committed: https://crrev.com/fb1d517f7bf920bf130abba2c6434381478790ff Cr-Commit-Position: refs/heads/master@{#311046}

Patch Set 1 #

Patch Set 2 : Cleaning up #

Total comments: 23

Patch Set 3 : Rebase #

Patch Set 4 : Address comments from PS2 #

Total comments: 25

Patch Set 5 : Rebase #

Patch Set 6 : Address comments from PS4 #

Total comments: 12

Patch Set 7 : Address comments from PS6 #

Patch Set 8 : Test nits #

Total comments: 4

Patch Set 9 : Address comments from PS8 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+341 lines, -27 lines) Patch
M net/http/http_cache.h View 1 2 3 4 5 4 chunks +14 lines, -0 lines 0 comments Download
M net/http/http_cache.cc View 1 2 3 6 chunks +6 lines, -2 lines 0 comments Download
M net/http/http_cache_transaction.h View 1 2 3 4 5 6 2 chunks +6 lines, -0 lines 0 comments Download
M net/http/http_cache_transaction.cc View 1 2 3 4 5 6 7 8 15 chunks +106 lines, -22 lines 0 comments Download
M net/http/http_cache_unittest.cc View 1 2 3 4 5 6 7 3 chunks +111 lines, -0 lines 0 comments Download
M net/http/http_network_transaction.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download
M net/http/http_response_info.h View 1 chunk +4 lines, -0 lines 0 comments Download
M net/http/http_response_info.cc View 1 2 3 4 6 chunks +9 lines, -0 lines 0 comments Download
A net/http/http_response_info_unittest.cc View 1 2 3 4 5 1 chunk +49 lines, -0 lines 0 comments Download
M net/http/http_transaction_test_util.h View 1 2 3 4 5 6 1 chunk +12 lines, -0 lines 0 comments Download
M net/http/http_transaction_test_util.cc View 1 2 3 4 5 6 5 chunks +20 lines, -3 lines 0 comments Download
M net/net.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 17 (4 generated)
jkarlin
Hi Ricardo. PTAL at everything, with special attention to http_cache_transaction.cc. Thanks!
6 years ago (2014-12-11 18:04:17 UTC) #2
rvargas (doing something else)
https://codereview.chromium.org/793823002/diff/20001/net/http/http_cache.cc File net/http/http_cache.cc (right): https://codereview.chromium.org/793823002/diff/20001/net/http/http_cache.cc#newcode365 net/http/http_cache.cc:365: start_time_ = cache_->clock_->Now(); Please declare an accessor instead of ...
6 years ago (2014-12-12 02:20:50 UTC) #3
jkarlin
Thanks Ricardo! https://codereview.chromium.org/793823002/diff/20001/net/http/http_cache.cc File net/http/http_cache.cc (right): https://codereview.chromium.org/793823002/diff/20001/net/http/http_cache.cc#newcode365 net/http/http_cache.cc:365: start_time_ = cache_->clock_->Now(); On 2014/12/12 02:20:49, rvargas ...
6 years ago (2014-12-15 17:19:25 UTC) #4
rvargas (doing something else)
https://codereview.chromium.org/793823002/diff/20001/net/http/http_cache_unittest.cc File net/http/http_cache_unittest.cc (right): https://codereview.chromium.org/793823002/diff/20001/net/http/http_cache_unittest.cc#newcode6790 net/http/http_cache_unittest.cc:6790: cache_.http_cache()->clock_.reset(clock_); On 2014/12/15 17:19:25, jkarlin wrote: > On 2014/12/12 ...
5 years, 12 months ago (2014-12-24 02:15:25 UTC) #6
jkarlin
Thanks! PTAL. https://codereview.chromium.org/793823002/diff/80001/net/http/http_cache.h File net/http/http_cache.h (right): https://codereview.chromium.org/793823002/diff/80001/net/http/http_cache.h#newcode190 net/http/http_cache.h:190: void set_clock_for_test(scoped_ptr<base::Clock> clock) { On 2014/12/24 02:15:24, ...
5 years, 11 months ago (2015-01-08 16:13:04 UTC) #8
rvargas (doing something else)
Just nits https://codereview.chromium.org/793823002/diff/80001/net/http/http_cache_transaction.cc File net/http/http_cache_transaction.cc (right): https://codereview.chromium.org/793823002/diff/80001/net/http/http_cache_transaction.cc#newcode846 net/http/http_cache_transaction.cc:846: // nit: keep this // https://codereview.chromium.org/793823002/diff/140001/net/http/http_cache_transaction.cc File ...
5 years, 11 months ago (2015-01-09 02:25:34 UTC) #9
jkarlin
Thanks! PTAL. https://codereview.chromium.org/793823002/diff/140001/net/http/http_cache_transaction.cc File net/http/http_cache_transaction.cc (right): https://codereview.chromium.org/793823002/diff/140001/net/http/http_cache_transaction.cc#newcode746 net/http/http_cache_transaction.cc:746: // [Foo] means state Foo may be ...
5 years, 11 months ago (2015-01-09 14:03:51 UTC) #10
rvargas (doing something else)
LGTM after final nits. https://codereview.chromium.org/793823002/diff/180001/net/http/http_cache_transaction.cc File net/http/http_cache_transaction.cc (right): https://codereview.chromium.org/793823002/diff/180001/net/http/http_cache_transaction.cc#newcode858 net/http/http_cache_transaction.cc:858: // Like examples 2-4, only ...
5 years, 11 months ago (2015-01-09 20:16:13 UTC) #11
jkarlin
https://codereview.chromium.org/793823002/diff/180001/net/http/http_cache_transaction.cc File net/http/http_cache_transaction.cc (right): https://codereview.chromium.org/793823002/diff/180001/net/http/http_cache_transaction.cc#newcode858 net/http/http_cache_transaction.cc:858: // Like examples 2-4, only CacheToggleUnusedSincePrefetch* is inserted between ...
5 years, 11 months ago (2015-01-12 13:01:14 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/793823002/200001
5 years, 11 months ago (2015-01-12 13:01:26 UTC) #14
commit-bot: I haz the power
Committed patchset #9 (id:200001)
5 years, 11 months ago (2015-01-12 14:10:59 UTC) #15
commit-bot: I haz the power
Patchset 9 (id:??) landed as https://crrev.com/fb1d517f7bf920bf130abba2c6434381478790ff Cr-Commit-Position: refs/heads/master@{#311046}
5 years, 11 months ago (2015-01-12 14:12:26 UTC) #16
hayato
5 years, 11 months ago (2015-01-13 05:44:37 UTC) #17
Message was sent while issue was closed.
FYI. This might be a cause of
https://code.google.com/p/chromium/issues/detail?id=448274.

Powered by Google App Engine
This is Rietveld 408576698