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

Issue 2860573004: [Offline Pages] Add cached offline page utils and show usage in settings. (Closed)

Created:
3 years, 7 months ago by romax
Modified:
3 years, 7 months ago
CC:
chromium-reviews, msramek+watch_chromium.org, dewittj+watch_chromium.org, fgorski+watch_chromium.org, romax+watch_chromium.org, petewil+watch_chromium.org, chili+watch_chromium.org, markusheintz_, dimich+watch_chromium.org, dullweber
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Offline Pages] Add cached offline page utils and show usage in settings. Added some utility functions for cached offline pages: Get sizes of all cached offline pages; Delete all cached offline pages. Also added the usage of cached offline pages to the number shown at: Chrome Settings -> Privacy -> Clear Browsing Data -> Cache BUG=716142 Review-Url: https://codereview.chromium.org/2860573004 Cr-Commit-Position: refs/heads/master@{#472255} Committed: https://chromium.googlesource.com/chromium/src/+/444db4b416dbc2ed7fed540cfbc0d6ec7774ed65

Patch Set 1 #

Total comments: 24

Patch Set 2 : comments from carlosk@. #

Total comments: 23

Patch Set 3 : comments. #

Patch Set 4 : more tests. #

Patch Set 5 : fixed unit tests but CBD tests flaky. #

Total comments: 9

Patch Set 6 : more comments. #

Patch Set 7 : Tests fixed. #

Total comments: 12

Patch Set 8 : Comments from dewittj@ and dullweber@. #

Patch Set 9 : fix build #

Total comments: 4

Patch Set 10 : more build fix. #

Patch Set 11 : address missed comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+270 lines, -19 lines) Patch
M chrome/browser/android/offline_pages/offline_page_utils.h View 1 2 3 4 2 chunks +15 lines, -0 lines 0 comments Download
M chrome/browser/android/offline_pages/offline_page_utils.cc View 1 2 3 4 5 2 chunks +32 lines, -0 lines 0 comments Download
M chrome/browser/android/offline_pages/offline_page_utils_unittest.cc View 1 2 3 4 5 9 chunks +179 lines, -0 lines 0 comments Download
M chrome/browser/browsing_data/cache_counter.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -3 lines 0 comments Download
M chrome/browser/browsing_data/cache_counter.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +30 lines, -7 lines 0 comments Download
M chrome/browser/browsing_data/conditional_cache_counting_helper_browsertest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/options/chromeos/storage_manager_handler.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/options/chromeos/storage_manager_handler.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/settings/chromeos/device_storage_handler.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/settings/chromeos/device_storage_handler.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M components/browsing_data/content/conditional_cache_counting_helper.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -3 lines 0 comments Download
M components/browsing_data/content/conditional_cache_counting_helper.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M components/offline_pages/core/offline_page_types.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 72 (48 generated)
romax
dewittj@ PTAL carlosk@ FYI Thanks!
3 years, 7 months ago (2017-05-02 23:27:26 UTC) #2
carlosk
Thanks. https://codereview.chromium.org/2860573004/diff/1/components/offline_pages/core/cached_offline_page_utils.cc File components/offline_pages/core/cached_offline_page_utils.cc (right): https://codereview.chromium.org/2860573004/diff/1/components/offline_pages/core/cached_offline_page_utils.cc#newcode24 components/offline_pages/core/cached_offline_page_utils.cc:24: if (begin_time <= page.creation_time && page.creation_time <= end_time) ...
3 years, 7 months ago (2017-05-03 18:13:53 UTC) #3
romax
addressed comments from carlosk@. Removed the unused methods. PTAL, thanks! https://codereview.chromium.org/2860573004/diff/1/components/offline_pages/core/cached_offline_page_utils.cc File components/offline_pages/core/cached_offline_page_utils.cc (right): https://codereview.chromium.org/2860573004/diff/1/components/offline_pages/core/cached_offline_page_utils.cc#newcode24 ...
3 years, 7 months ago (2017-05-03 19:46:22 UTC) #4
dewittj
https://codereview.chromium.org/2860573004/diff/20001/components/offline_pages/core/cached_offline_page_utils.h File components/offline_pages/core/cached_offline_page_utils.h (right): https://codereview.chromium.org/2860573004/diff/20001/components/offline_pages/core/cached_offline_page_utils.h#newcode23 components/offline_pages/core/cached_offline_page_utils.h:23: void GetCachedOfflinePageSizeBetween(OfflinePageModel* model, It might be better to move ...
3 years, 7 months ago (2017-05-03 21:40:54 UTC) #5
carlosk
Just wanted to reply with these quickly. Will make another pass on the next patch ...
3 years, 7 months ago (2017-05-03 21:54:35 UTC) #6
romax
I've moved them into offline_page_utils, which seems a better place than a separate file. Also ...
3 years, 7 months ago (2017-05-04 04:20:37 UTC) #7
carlosk
Thanks. https://codereview.chromium.org/2860573004/diff/80001/chrome/browser/android/offline_pages/offline_page_utils.cc File chrome/browser/android/offline_pages/offline_page_utils.cc (right): https://codereview.chromium.org/2860573004/diff/80001/chrome/browser/android/offline_pages/offline_page_utils.cc#newcode140 chrome/browser/android/offline_pages/offline_page_utils.cc:140: total_size += page.file_size; The interval here should be ...
3 years, 7 months ago (2017-05-05 18:20:28 UTC) #17
romax
addressed more comments from carlosk@. Figured out why the tests are flaky but blocked on ...
3 years, 7 months ago (2017-05-05 21:01:31 UTC) #18
carlosk
LGTM. https://codereview.chromium.org/2860573004/diff/80001/chrome/browser/android/offline_pages/offline_page_utils_unittest.cc File chrome/browser/android/offline_pages/offline_page_utils_unittest.cc (right): https://codereview.chromium.org/2860573004/diff/80001/chrome/browser/android/offline_pages/offline_page_utils_unittest.cc#newcode367 chrome/browser/android/offline_pages/offline_page_utils_unittest.cc:367: static_cast<OfflinePageModelImpl*>(model)->set_testing_clock(&clock); On 2017/05/05 21:01:30, romax wrote: > On ...
3 years, 7 months ago (2017-05-05 21:30:04 UTC) #19
romax
+msramek for cache_counter owner review also friendly ping for dewittj@, since the cache counter fix ...
3 years, 7 months ago (2017-05-09 01:16:03 UTC) #23
dewittj
Thanks for lots of tests! I'm not sure the size calculation really needs to be ...
3 years, 7 months ago (2017-05-09 01:29:54 UTC) #26
dullweber
https://codereview.chromium.org/2860573004/diff/120001/chrome/browser/browsing_data/cache_counter.cc File chrome/browser/browsing_data/cache_counter.cc (right): https://codereview.chromium.org/2860573004/diff/120001/chrome/browser/browsing_data/cache_counter.cc#newcode57 chrome/browser/browsing_data/cache_counter.cc:57: if (offline_pages::OfflinePageUtils::GetCachedOfflinePageSizeBetween( Could you start both cache calculations in ...
3 years, 7 months ago (2017-05-09 07:56:01 UTC) #27
romax
I'll keep the files in chrome/browser/android for now and maybe later I'll move them into ...
3 years, 7 months ago (2017-05-09 21:08:45 UTC) #32
romax
I'll keep the files in chrome/browser/android for now and maybe later I'll move them into ...
3 years, 7 months ago (2017-05-09 21:08:46 UTC) #33
dullweber
thanks, browsing_data/ lgtm but I can't approve it ;) https://codereview.chromium.org/2860573004/diff/160001/chrome/browser/browsing_data/cache_counter.cc File chrome/browser/browsing_data/cache_counter.cc (right): https://codereview.chromium.org/2860573004/diff/160001/chrome/browser/browsing_data/cache_counter.cc#newcode71 chrome/browser/browsing_data/cache_counter.cc:71: ...
3 years, 7 months ago (2017-05-10 08:13:40 UTC) #42
dewittj
lgtm, with a nit. https://codereview.chromium.org/2860573004/diff/160001/chrome/browser/browsing_data/cache_counter.cc File chrome/browser/browsing_data/cache_counter.cc (right): https://codereview.chromium.org/2860573004/diff/160001/chrome/browser/browsing_data/cache_counter.cc#newcode65 chrome/browser/browsing_data/cache_counter.cc:65: // A value less than ...
3 years, 7 months ago (2017-05-11 16:58:43 UTC) #57
romax
+dbeam@: Please review changes in c/b/ui/ Thanks! https://codereview.chromium.org/2860573004/diff/160001/chrome/browser/browsing_data/cache_counter.cc File chrome/browser/browsing_data/cache_counter.cc (right): https://codereview.chromium.org/2860573004/diff/160001/chrome/browser/browsing_data/cache_counter.cc#newcode71 chrome/browser/browsing_data/cache_counter.cc:71: is_upper_limit_ = ...
3 years, 7 months ago (2017-05-12 00:44:37 UTC) #59
msramek
LGTM. It's a bit strange for a method to return the secondary value (is_upper_limit) first, ...
3 years, 7 months ago (2017-05-12 09:31:27 UTC) #60
Dan Beam
c/b/ui/webui/options/ lgtm
3 years, 7 months ago (2017-05-16 03:10:23 UTC) #61
Dan Beam
On 2017/05/16 03:10:23, Dan Beam wrote: > c/b/ui/webui/options/ lgtm * and /settings/ ;)
3 years, 7 months ago (2017-05-16 03:11:12 UTC) #62
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/2860573004/200001
3 years, 7 months ago (2017-05-16 18:07:53 UTC) #65
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/456190)
3 years, 7 months ago (2017-05-16 19:15:56 UTC) #67
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/2860573004/200001
3 years, 7 months ago (2017-05-16 23:42:56 UTC) #69
commit-bot: I haz the power
3 years, 7 months ago (2017-05-16 23:52:55 UTC) #72
Message was sent while issue was closed.
Committed patchset #11 (id:200001) as
https://chromium.googlesource.com/chromium/src/+/444db4b416dbc2ed7fed540cfbc0...

Powered by Google App Engine
This is Rietveld 408576698