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

Issue 2586813004: Report downloaded resources at most once (Closed)

Created:
4 years ago by jamartin
Modified:
4 years ago
Reviewers:
twifkak
CC:
chromium-reviews, wifiprefetch-reviews_google.com
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Report downloaded resources at most once Before, we were reporting used_resources and unused_resources. used_resources was reported only once when the resource is used but unused_resources was reported on every single prefetch session for as long as the resource was still unused. This change removes unused_resources and adds downloaded resources (with URL parameter d), which reports the "cost" of a resource once. This allows to have a meaningful ratio of used_resources / downloaded_resources. BUG=675732 Committed: https://crrev.com/02bf6c04e45ee64670eb9e6cd3a05c54d9a2eaa0 Cr-Commit-Position: refs/heads/master@{#440176}

Patch Set 1 #

Patch Set 2 : Fix race condition in PrecacheFetcherTest due to MaybePost #

Total comments: 18

Patch Set 3 : Move logic to precache_database #

Patch Set 4 : Removed easily outdated comment #

Patch Set 5 : Removed superfluous test #

Total comments: 8

Patch Set 6 : Improved tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+253 lines, -95 lines) Patch
M components/precache/core/precache_database.h View 1 2 3 chunks +6 lines, -4 lines 0 comments Download
M components/precache/core/precache_database.cc View 1 2 3 4 5 6 chunks +17 lines, -9 lines 0 comments Download
M components/precache/core/precache_database_unittest.cc View 1 2 3 4 5 8 chunks +66 lines, -19 lines 0 comments Download
M components/precache/core/precache_fetcher.h View 2 chunks +2 lines, -2 lines 0 comments Download
M components/precache/core/precache_fetcher.cc View 3 chunks +7 lines, -7 lines 0 comments Download
M components/precache/core/precache_fetcher_unittest.cc View 1 5 chunks +52 lines, -8 lines 0 comments Download
M components/precache/core/precache_url_table.h View 1 2 3 chunks +14 lines, -5 lines 0 comments Download
M components/precache/core/precache_url_table.cc View 1 2 3 4 chunks +48 lines, -23 lines 0 comments Download
M components/precache/core/precache_url_table_unittest.cc View 1 2 3 4 7 chunks +41 lines, -18 lines 0 comments Download

Messages

Total messages: 27 (16 generated)
jamartin
Please take a look at the TODO(jamartin) in precache_fetcher_unittest.cc
4 years ago (2016-12-19 22:07:32 UTC) #3
jamartin
On 2016/12/19 22:07:32, jamartin wrote: > Please take a look at the TODO(jamartin) in precache_fetcher_unittest.cc ...
4 years ago (2016-12-20 00:05:23 UTC) #4
twifkak
https://codereview.chromium.org/2586813004/diff/20001/components/precache/core/precache_database_unittest.cc File components/precache/core/precache_database_unittest.cc (right): https://codereview.chromium.org/2586813004/diff/20001/components/precache/core/precache_database_unittest.cc#newcode559 components/precache/core/precache_database_unittest.cc:559: CHECK_NE(PrecacheReferrerHostEntry::kInvalidId, id); Per the last bullet of https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++.md#CHECK_DCHECK_and-NOTREACHED, use ...
4 years ago (2016-12-20 01:42:00 UTC) #9
twifkak
Oh, also, please add detail to the commit description.
4 years ago (2016-12-20 01:44:34 UTC) #10
jamartin
PTAL. https://codereview.chromium.org/2586813004/diff/20001/components/precache/core/precache_database_unittest.cc File components/precache/core/precache_database_unittest.cc (right): https://codereview.chromium.org/2586813004/diff/20001/components/precache/core/precache_database_unittest.cc#newcode559 components/precache/core/precache_database_unittest.cc:559: CHECK_NE(PrecacheReferrerHostEntry::kInvalidId, id); On 2016/12/20 01:41:59, twifkak wrote: > ...
4 years ago (2016-12-20 21:09:35 UTC) #12
twifkak
lgtm https://codereview.chromium.org/2586813004/diff/80001/components/precache/core/precache_database.cc File components/precache/core/precache_database.cc (right): https://codereview.chromium.org/2586813004/diff/80001/components/precache/core/precache_database.cc#newcode205 components/precache/core/precache_database.cc:205: (!info.is_precached || was_cached) && info.is_download_reported)); Perhaps extract this ...
4 years ago (2016-12-20 22:48:10 UTC) #13
jamartin
Done. I'll submit as soon as this has been tested on the dev phone. https://codereview.chromium.org/2586813004/diff/80001/components/precache/core/precache_database.cc ...
4 years ago (2016-12-20 23:14:07 UTC) #16
twifkak
On 2016/12/20 23:14:07, jamartin wrote: > Done. I'll submit as soon as this has been ...
4 years ago (2016-12-21 02:26:19 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2586813004/100001
4 years ago (2016-12-21 19:16:38 UTC) #22
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years ago (2016-12-21 19:28:21 UTC) #25
commit-bot: I haz the power
4 years ago (2016-12-21 19:30:41 UTC) #27
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/02bf6c04e45ee64670eb9e6cd3a05c54d9a2eaa0
Cr-Commit-Position: refs/heads/master@{#440176}

Powered by Google App Engine
This is Rietveld 408576698