New issue
Advanced search Search tips

Issue 671196 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature



Sign in to add a comment

Improve the CBD cache counter

Project Member Reported by msramek@chromium.org, Dec 5 2016

Issue description

The cache counter in the CBD dialog (chrome://settings/clearBrowserData) currently only counts the total size of the cache. This means that we show the correct value if the user chooses to delete "everything", but only a partial value if they choose a finite time range, such as "past hour".

This is because adding a time-range-based counting mechanism to the cache backend was not supported as it could potentially take a long time.

However, the counter can still be improved. We could run another calculation task in parallel, this time using the public cache interface (i.e. the iterator) to calculate the size of items in the given range. In cases where the cache is small and the parallel calculation finishes quickly enough, we will be able to show the precise value. Where this is not the case, we would simply show the upper estimate, as we do today.
 
Issues - chromium - An open-source project to help move the web forward. - Monorail
48 bytes Download
Project Member

Comment 2 by bugdroid1@chromium.org, Jan 4 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/75321ac0828dd8f7dd38944234b867ea98598656

commit 75321ac0828dd8f7dd38944234b867ea98598656
Author: dullweber <dullweber@chromium.org>
Date: Wed Jan 04 17:05:18 2017

Refactor cache counting code as a preparation for a more exact implementation.

Move code from StoragePartitionHttpCacheRemover to CacheCountingHelper. Improve tests by adding a CacheTestUtil class for common functionality of cache counting and cache deletion tests.

BUG= 671196 
TBR=achuith@chromium.org

Review-Url: https://codereview.chromium.org/2556363003
Cr-Commit-Position: refs/heads/master@{#441399}

[modify] https://crrev.com/75321ac0828dd8f7dd38944234b867ea98598656/chrome/browser/browsing_data/browsing_data_counter_utils.cc
[modify] https://crrev.com/75321ac0828dd8f7dd38944234b867ea98598656/chrome/browser/browsing_data/cache_counter.cc
[modify] https://crrev.com/75321ac0828dd8f7dd38944234b867ea98598656/chrome/browser/browsing_data/cache_counter.h
[modify] https://crrev.com/75321ac0828dd8f7dd38944234b867ea98598656/chrome/browser/browsing_data/cache_counter_browsertest.cc
[add] https://crrev.com/75321ac0828dd8f7dd38944234b867ea98598656/chrome/browser/browsing_data/cache_test_util.cc
[add] https://crrev.com/75321ac0828dd8f7dd38944234b867ea98598656/chrome/browser/browsing_data/cache_test_util.h
[add] https://crrev.com/75321ac0828dd8f7dd38944234b867ea98598656/chrome/browser/browsing_data/conditional_cache_counting_helper_browsertest.cc
[modify] https://crrev.com/75321ac0828dd8f7dd38944234b867ea98598656/chrome/browser/browsing_data/conditional_cache_deletion_helper_browsertest.cc
[modify] https://crrev.com/75321ac0828dd8f7dd38944234b867ea98598656/chrome/browser/ui/webui/options/chromeos/storage_manager_handler.cc
[modify] https://crrev.com/75321ac0828dd8f7dd38944234b867ea98598656/chrome/browser/ui/webui/settings/chromeos/device_storage_handler.cc
[modify] https://crrev.com/75321ac0828dd8f7dd38944234b867ea98598656/chrome/test/BUILD.gn
[modify] https://crrev.com/75321ac0828dd8f7dd38944234b867ea98598656/components/browsing_data/content/BUILD.gn
[add] https://crrev.com/75321ac0828dd8f7dd38944234b867ea98598656/components/browsing_data/content/conditional_cache_counting_helper.cc
[add] https://crrev.com/75321ac0828dd8f7dd38944234b867ea98598656/components/browsing_data/content/conditional_cache_counting_helper.h
[modify] https://crrev.com/75321ac0828dd8f7dd38944234b867ea98598656/components/browsing_data/content/conditional_cache_deletion_helper.cc
[modify] https://crrev.com/75321ac0828dd8f7dd38944234b867ea98598656/components/browsing_data/content/storage_partition_http_cache_data_remover.cc
[modify] https://crrev.com/75321ac0828dd8f7dd38944234b867ea98598656/components/browsing_data/content/storage_partition_http_cache_data_remover.h

Project Member

Comment 3 by bugdroid1@chromium.org, Jan 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a0030054d0f06d89c91a0b6198a1956cd4915861

commit a0030054d0f06d89c91a0b6198a1956cd4915861
Author: dullweber <dullweber@chromium.org>
Date: Mon Jan 16 11:56:04 2017

Calculate the size of all cache entries between two points in time if it can be done efficiently.
Size calculation is implemented for SimpleBackend using the SimpleIndex and the MemBackend. The blockfile Backend returns ERR_NOT_IMPLEMENTED because it would have to read all entries from disk.

BUG= 671196 

Review-Url: https://codereview.chromium.org/2626173003
Cr-Commit-Position: refs/heads/master@{#443870}

[modify] https://crrev.com/a0030054d0f06d89c91a0b6198a1956cd4915861/net/disk_cache/backend_unittest.cc
[rename] https://crrev.com/a0030054d0f06d89c91a0b6198a1956cd4915861/net/disk_cache/disk_cache.cc
[modify] https://crrev.com/a0030054d0f06d89c91a0b6198a1956cd4915861/net/disk_cache/disk_cache.h
[modify] https://crrev.com/a0030054d0f06d89c91a0b6198a1956cd4915861/net/disk_cache/disk_cache_test_base.cc
[modify] https://crrev.com/a0030054d0f06d89c91a0b6198a1956cd4915861/net/disk_cache/disk_cache_test_base.h
[modify] https://crrev.com/a0030054d0f06d89c91a0b6198a1956cd4915861/net/disk_cache/memory/mem_backend_impl.cc
[modify] https://crrev.com/a0030054d0f06d89c91a0b6198a1956cd4915861/net/disk_cache/memory/mem_backend_impl.h
[modify] https://crrev.com/a0030054d0f06d89c91a0b6198a1956cd4915861/net/disk_cache/simple/simple_backend_impl.cc
[modify] https://crrev.com/a0030054d0f06d89c91a0b6198a1956cd4915861/net/disk_cache/simple/simple_backend_impl.h
[modify] https://crrev.com/a0030054d0f06d89c91a0b6198a1956cd4915861/net/disk_cache/simple/simple_index.cc
[modify] https://crrev.com/a0030054d0f06d89c91a0b6198a1956cd4915861/net/disk_cache/simple/simple_index.h
[modify] https://crrev.com/a0030054d0f06d89c91a0b6198a1956cd4915861/net/net.gypi

Project Member

Comment 4 by bugdroid1@chromium.org, Jan 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/de9e5f3b8c67ff572ca76b292b5a51bf474e8d4f

commit de9e5f3b8c67ff572ca76b292b5a51bf474e8d4f
Author: dullweber <dullweber@chromium.org>
Date: Wed Jan 18 11:35:46 2017

Show the exact cache size for time ranges if supported. This will show the right cache size when a time range is selected on linux and android, where SimpleBackend is used for caching. Windows will still show the upper estimate because there is no efficient way to determine the cache size in the blockfile cache.

BUG= 671196 
BASE=2626173003

Review-Url: https://codereview.chromium.org/2626223002
Cr-Commit-Position: refs/heads/master@{#444335}

[modify] https://crrev.com/de9e5f3b8c67ff572ca76b292b5a51bf474e8d4f/chrome/browser/browsing_data/cache_counter.cc
[modify] https://crrev.com/de9e5f3b8c67ff572ca76b292b5a51bf474e8d4f/chrome/browser/browsing_data/cache_counter.h
[modify] https://crrev.com/de9e5f3b8c67ff572ca76b292b5a51bf474e8d4f/chrome/browser/browsing_data/cache_counter_browsertest.cc
[modify] https://crrev.com/de9e5f3b8c67ff572ca76b292b5a51bf474e8d4f/chrome/browser/browsing_data/conditional_cache_counting_helper_browsertest.cc
[modify] https://crrev.com/de9e5f3b8c67ff572ca76b292b5a51bf474e8d4f/chrome/browser/ui/webui/options/chromeos/storage_manager_handler.cc
[modify] https://crrev.com/de9e5f3b8c67ff572ca76b292b5a51bf474e8d4f/chrome/browser/ui/webui/options/chromeos/storage_manager_handler.h
[modify] https://crrev.com/de9e5f3b8c67ff572ca76b292b5a51bf474e8d4f/chrome/browser/ui/webui/settings/chromeos/device_storage_handler.cc
[modify] https://crrev.com/de9e5f3b8c67ff572ca76b292b5a51bf474e8d4f/chrome/browser/ui/webui/settings/chromeos/device_storage_handler.h
[modify] https://crrev.com/de9e5f3b8c67ff572ca76b292b5a51bf474e8d4f/components/browsing_data/content/conditional_cache_counting_helper.cc
[modify] https://crrev.com/de9e5f3b8c67ff572ca76b292b5a51bf474e8d4f/components/browsing_data/content/conditional_cache_counting_helper.h

Status: Fixed (was: Assigned)
Exact cache counting now works on all platforms using the SimpleBackend for caching (android, linux, chromeos). The size is calculated using an index structure that is kept in memory.

Sign in to add a comment