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

Issue 2947753002: CacheStorage: Migrate to BindOnce/OnceCallback/OnceClosure (Closed)

Created:
3 years, 6 months ago by jsbell
Modified:
3 years, 6 months ago
Reviewers:
cmumford, tzik
CC:
chromium-reviews, jam, darin-cc_chromium.org, jkarlin+watch_chromium.org, nhiroki, jkarlin
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

CacheStorage: Migrate to BindOnce/OnceCallback/OnceClosure Switch to base::BindOnce/OnceCallback/OnceClosure to simplify code (movable types) and make the API more explicit. base::AdaptCallbackForRepeating is used in a handful of places to adapt quota manager and disk cache APIs that have not been converted, and a few lingering base::Bind() calls remain where there are API dependencies (e.g. quota client, base::CancelableClosure). base::AdaptCallbackForRepeating is also used to handle batch operations where "first caller wins" semantics are required, simplifying the existing code. BUG=734632 R=cmumford@chromium.org,tzik@chromium.org Review-Url: https://codereview.chromium.org/2947753002 Cr-Commit-Position: refs/heads/master@{#481305} Committed: https://chromium.googlesource.com/chromium/src/+/f43e59e39557ee55c2d74d600a10c0d61ae17e36

Patch Set 1 #

Total comments: 6

Patch Set 2 : Untangle Batch logic (relies on AdaptCallbackForRepeating) #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+748 lines, -676 lines) Patch
M content/browser/cache_storage/cache_storage.h View 7 chunks +33 lines, -34 lines 2 comments Download
M content/browser/cache_storage/cache_storage.cc View 35 chunks +169 lines, -157 lines 0 comments Download
M content/browser/cache_storage/cache_storage_blob_to_disk_cache.h View 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/cache_storage/cache_storage_blob_to_disk_cache.cc View 4 chunks +7 lines, -6 lines 0 comments Download
M content/browser/cache_storage/cache_storage_blob_to_disk_cache_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/cache_storage/cache_storage_cache.h View 1 13 chunks +54 lines, -61 lines 0 comments Download
M content/browser/cache_storage/cache_storage_cache.cc View 1 47 chunks +289 lines, -253 lines 2 comments Download
M content/browser/cache_storage/cache_storage_cache_unittest.cc View 17 chunks +38 lines, -35 lines 0 comments Download
M content/browser/cache_storage/cache_storage_context_impl.cc View 3 chunks +5 lines, -5 lines 0 comments Download
M content/browser/cache_storage/cache_storage_dispatcher_host.cc View 12 chunks +30 lines, -28 lines 0 comments Download
M content/browser/cache_storage/cache_storage_manager.h View 1 chunk +6 lines, -6 lines 0 comments Download
M content/browser/cache_storage/cache_storage_manager.cc View 12 chunks +41 lines, -39 lines 0 comments Download
M content/browser/cache_storage/cache_storage_manager_unittest.cc View 12 chunks +27 lines, -25 lines 0 comments Download
M content/browser/cache_storage/cache_storage_operation.h View 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/cache_storage/cache_storage_operation.cc View 2 chunks +6 lines, -5 lines 0 comments Download
M content/browser/cache_storage/cache_storage_operation_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/cache_storage/cache_storage_scheduler.h View 2 chunks +28 lines, -7 lines 0 comments Download
M content/browser/cache_storage/cache_storage_scheduler.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M content/browser/cache_storage/cache_storage_scheduler_unittest.cc View 2 chunks +4 lines, -4 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 28 (18 generated)
jsbell
This is NOT ready for final review, but initial feedback is welcome. A few notes ...
3 years, 6 months ago (2017-06-19 23:45:00 UTC) #4
jsbell
One more note-to-self https://codereview.chromium.org/2947753002/diff/1/content/browser/cache_storage/cache_storage_manager.cc File content/browser/cache_storage/cache_storage_manager.cc (right): https://codereview.chromium.org/2947753002/diff/1/content/browser/cache_storage/cache_storage_manager.cc#newcode338 content/browser/cache_storage/cache_storage_manager.cc:338: base::Bind(&ListOriginsOnTaskRunner, root_path_), If you convert this ...
3 years, 6 months ago (2017-06-19 23:51:16 UTC) #5
jsbell
tzik@ - I think this is ready for a real review. Can you take a ...
3 years, 6 months ago (2017-06-20 23:00:56 UTC) #12
tzik
LGTM! https://codereview.chromium.org/2947753002/diff/1/content/browser/cache_storage/cache_storage.cc File content/browser/cache_storage/cache_storage.cc (right): https://codereview.chromium.org/2947753002/diff/1/content/browser/cache_storage/cache_storage.cc#newcode1077 content/browser/cache_storage/cache_storage.cc:1077: base::Passed(std::move(cache_handle)), barrier_closure, base::Passed here is not needed. # ...
3 years, 6 months ago (2017-06-21 07:11:01 UTC) #16
jsbell
thanks tzik@ cmumford@ - can you also review as a cache storage expert?
3 years, 6 months ago (2017-06-21 15:54:15 UTC) #17
cmumford
https://codereview.chromium.org/2947753002/diff/20001/content/browser/cache_storage/cache_storage.h File content/browser/cache_storage/cache_storage.h (right): https://codereview.chromium.org/2947753002/diff/20001/content/browser/cache_storage/cache_storage.h#newcode212 content/browser/cache_storage/cache_storage.h:212: base::OnceClosure closure, Should this be a RepeatingClosure? https://codereview.chromium.org/2947753002/diff/20001/content/browser/cache_storage/cache_storage_cache.cc File ...
3 years, 6 months ago (2017-06-21 19:07:57 UTC) #20
jsbell
Thanks for the questions! This stuff is subtle and I'm still wrapping my head around ...
3 years, 6 months ago (2017-06-21 20:38:16 UTC) #21
cmumford
lgtm
3 years, 6 months ago (2017-06-21 20:40:51 UTC) #22
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/2947753002/20001
3 years, 6 months ago (2017-06-21 21:04:06 UTC) #24
commit-bot: I haz the power
3 years, 6 months ago (2017-06-21 21:12:59 UTC) #28
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/f43e59e39557ee55c2d74d600a10...

Powered by Google App Engine
This is Rietveld 408576698