|
|
DescriptionAdd a cache counter for iOS.
The CacheCounter class in chrome/browser/browsing_data could not be
componentized (unlike other counters in components/browsing_data) because
of its usage of StoragePartitionHttpCacheDataRemover that has a dependency
on content/.
This CL implements a separate CacheCounter class for iOS with the same
functionality. The core of the implementation, a series of IO thread
callbacks, is delegated to the private IOThreadCacheCounter class that
mimics StoragePartitionHttpCacheDataRemover.
BUG=620317
Committed: https://crrev.com/2d290dc4a1bcac7ad6cd67553e5831fa3680d6bb
Cr-Commit-Position: refs/heads/master@{#420599}
Patch Set 1 #Patch Set 2 : Compilation fixes #Patch Set 3 : Compilation fixes #2 #Patch Set 4 : Compilation fixes #3 #Patch Set 5 : Compilation fixes #5, added test. #Patch Set 6 : More compilation fixes, this time really added a test. #Patch Set 7 : Build fixes. #Patch Set 8 : More build fixes #Patch Set 9 : More fixes. #Patch Set 10 : Rebase #Patch Set 11 : Fixed test compilation. #Patch Set 12 : Test fixes. #Patch Set 13 : Test improvement and fixes. #Patch Set 14 : Another test fix. #Patch Set 15 : Fix hangup. #Patch Set 16 : Fix another hangup. #Patch Set 17 : Try without ClearCache() #Patch Set 18 : Join the entry creation and deletion code. #Patch Set 19 : More compilation fixes. #Patch Set 20 : Fix another hangup. #
Total comments: 12
Patch Set 21 : Addressed comments. #Patch Set 22 : Fixed test, reverted utils. #Patch Set 23 : Compilation fix. #Patch Set 24 : Forgot |next_step_| #
Messages
Total messages: 108 (100 generated)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
msramek@chromium.org changed reviewers: + droger@chromium.org
Hey David, Please have a look! This is a part of Ioana's recent work on iOS browsing_data/, some of which you have been reviewing. CacheCounter hasn't been componentized (it stayed in c/b/browsing_data/) because of a content/ dependency through StoragePartitionHttpCacheDataRemover. We could break that class to make it componentizable, but it seems simpler to just introduce an iOS version of CacheCounter, as the functionality is not that large. Thanks, Martin
msramek@chromium.org changed reviewers: + ioanap@google.com
+Ioana PTAL as well :)
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm Could you also update browsing_data::GetCounterTextFromResult in components/browsing_data/core/browsing_data_utils.cc and GetChromeCounterTextFromResult in c/b/browsing_data/browsing_data_counter_utils.cc ? I think the logic that processes the text for the cache counter can now be completely moved. Thanks, Ioana https://codereview.chromium.org/2354643002/diff/380001/ios/chrome/browser/bro... File ios/chrome/browser/browsing_data/cache_counter.h (right): https://codereview.chromium.org/2354643002/diff/380001/ios/chrome/browser/bro... ios/chrome/browser/browsing_data/cache_counter.h:28: // BrowsingDataCounter implementation: nit: s/:/.
lgtm https://codereview.chromium.org/2354643002/diff/380001/ios/chrome/browser/bro... File ios/chrome/browser/browsing_data/cache_counter.cc (right): https://codereview.chromium.org/2354643002/diff/380001/ios/chrome/browser/bro... ios/chrome/browser/browsing_data/cache_counter.cc:45: void CountInternal(int rv) { Add DCHECK_CURRENTLY_ON(IO); https://codereview.chromium.org/2354643002/diff/380001/ios/chrome/browser/bro... ios/chrome/browser/browsing_data/cache_counter.cc:64: break; Sometimes it's return, sometimes break. Maybe use return everywhere? https://codereview.chromium.org/2354643002/diff/380001/ios/chrome/browser/bro... ios/chrome/browser/browsing_data/cache_counter.cc:90: void OnCountingFinished() { DCHECK_CURRENTLY_ON(UI); Or a base::ThreadChecker if you prefer. https://codereview.chromium.org/2354643002/diff/380001/ios/chrome/browser/bro... ios/chrome/browser/browsing_data/cache_counter.cc:92: base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); Just curious: why not delete this; https://codereview.chromium.org/2354643002/diff/380001/ios/chrome/browser/bro... File ios/chrome/browser/browsing_data/cache_counter_unittest.cc (right): https://codereview.chromium.org/2354643002/diff/380001/ios/chrome/browser/bro... ios/chrome/browser/browsing_data/cache_counter_unittest.cc:35: void SetUp() override { call the parent function testing::Test::SetUp(); Or better: move this code to the constructor instead (which is the recommended way).
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #22 (id:420001) has been deleted
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Thanks both! Ioana, as discussed offline, it's not possible to move the CacheCounter text processing into components/ due to a dependency on ui/base/text files that are not available on iOS. That logic will have to be duplicated using iOS native UI libraries. https://codereview.chromium.org/2354643002/diff/380001/ios/chrome/browser/bro... File ios/chrome/browser/browsing_data/cache_counter.cc (right): https://codereview.chromium.org/2354643002/diff/380001/ios/chrome/browser/bro... ios/chrome/browser/browsing_data/cache_counter.cc:45: void CountInternal(int rv) { On 2016/09/22 14:13:01, droger wrote: > Add DCHECK_CURRENTLY_ON(IO); Done. https://codereview.chromium.org/2354643002/diff/380001/ios/chrome/browser/bro... ios/chrome/browser/browsing_data/cache_counter.cc:64: break; On 2016/09/22 14:13:01, droger wrote: > Sometimes it's return, sometimes break. > > Maybe use return everywhere? That is intentional. All disk_cache::Backend methods have the same interface - they either return a value immediately, or they return net::ERR_IO_PENDING and then later call a callback. Here, "break;" is used to jump out of the switch(), but not out of while(), so if |rv| != ERR_IO_PENDING, the next step is executed immediately. Using "return;" would exit the method and wait for a callback that never comes. In STEP_CALLBACK, we use "return;", because it's the last step. Using "break;" would execute that step ad infinitum. I added a sentinel STEP_DONE to represent the finished state, so that we can use "break;" here as well. https://codereview.chromium.org/2354643002/diff/380001/ios/chrome/browser/bro... ios/chrome/browser/browsing_data/cache_counter.cc:90: void OnCountingFinished() { On 2016/09/22 14:13:01, droger wrote: > DCHECK_CURRENTLY_ON(UI); > Or a base::ThreadChecker if you prefer. Done. https://codereview.chromium.org/2354643002/diff/380001/ios/chrome/browser/bro... ios/chrome/browser/browsing_data/cache_counter.cc:92: base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); On 2016/09/22 14:13:01, droger wrote: > Just curious: why not > delete this; Changed to "delete this;". No particular reason - it just feels weird to me that I cannot assume the object exists after I just called a method on it :) https://codereview.chromium.org/2354643002/diff/380001/ios/chrome/browser/bro... File ios/chrome/browser/browsing_data/cache_counter.h (right): https://codereview.chromium.org/2354643002/diff/380001/ios/chrome/browser/bro... ios/chrome/browser/browsing_data/cache_counter.h:28: // BrowsingDataCounter implementation: On 2016/09/22 13:39:52, ioanap wrote: > nit: s/:/. Done, here and above. This was actually intentional, but I guess a period works better. https://codereview.chromium.org/2354643002/diff/380001/ios/chrome/browser/bro... File ios/chrome/browser/browsing_data/cache_counter_unittest.cc (right): https://codereview.chromium.org/2354643002/diff/380001/ios/chrome/browser/bro... ios/chrome/browser/browsing_data/cache_counter_unittest.cc:35: void SetUp() override { On 2016/09/22 14:13:01, droger wrote: > call the parent function > testing::Test::SetUp(); > > Or better: move this code to the constructor instead (which is the recommended > way). Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by msramek@chromium.org to run a CQ dry run
Patchset #25 (id:500001) has been deleted
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by msramek@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from droger@chromium.org, ioanap@google.com Link to the patchset: https://codereview.chromium.org/2354643002/#ps480001 (title: "Forgot |next_step_|")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #24 (id:480001)
Message was sent while issue was closed.
Description was changed from ========== Add a cache counter for iOS. The CacheCounter class in chrome/browser/browsing_data could not be componentized (unlike other counters in components/browsing_data) because of its usage of StoragePartitionHttpCacheDataRemover that has a dependency on content/. This CL implements a separate CacheCounter class for iOS with the same functionality. The core of the implementation, a series of IO thread callbacks, is delegated to the private IOThreadCacheCounter class that mimics StoragePartitionHttpCacheDataRemover. BUG=620317 ========== to ========== Add a cache counter for iOS. The CacheCounter class in chrome/browser/browsing_data could not be componentized (unlike other counters in components/browsing_data) because of its usage of StoragePartitionHttpCacheDataRemover that has a dependency on content/. This CL implements a separate CacheCounter class for iOS with the same functionality. The core of the implementation, a series of IO thread callbacks, is delegated to the private IOThreadCacheCounter class that mimics StoragePartitionHttpCacheDataRemover. BUG=620317 Committed: https://crrev.com/2d290dc4a1bcac7ad6cd67553e5831fa3680d6bb Cr-Commit-Position: refs/heads/master@{#420599} ==========
Message was sent while issue was closed.
Patchset 24 (id:??) landed as https://crrev.com/2d290dc4a1bcac7ad6cd67553e5831fa3680d6bb Cr-Commit-Position: refs/heads/master@{#420599} |