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

Issue 867903005: [ServiceWorkerCache] Serialize ServiceWorkerCacheStorage operations (Closed)

Created:
5 years, 10 months ago by jkarlin
Modified:
5 years, 10 months ago
Reviewers:
michaeln
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, tzik, serviceworker-reviews, jam, kinuko+serviceworker, nhiroki, darin-cc_chromium.org, horo+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[ServiceWorkerCache] Serialize ServiceWorkerCacheStorage operations There are correctness issues in the ServiceWorkerCacheStorage when multiple operations occur on the same key in parallel. The various steps of the operations can interleave. This CL serializes all storage operations by placing all operations in a queue and calling the next operation from the callback of the previous operation. While this provides correctness, it is sub-optimal. We really only need to serialize operations that affect the same key. A smarter scheduler can be created in the future to implement that (see https://crbug.com/451174). What this CL does: * Creates a new ServiceWorkerCacheScheduler class used by both ServiceWorkerCache and ServiceWorkerCacheStorage * Refactor ServiceWorkerCache to use the new scheduler * Make ServiceWorkerCacheStorage run sequentially, using the scheduler BUG=450697 Committed: https://crrev.com/d1292e44b91faf5098719af5e75dc04ec05e3a5a Cr-Commit-Position: refs/heads/master@{#315022}

Patch Set 1 #

Patch Set 2 : Add ServiceWorkerCacheScheduler #

Patch Set 3 : Nits #

Total comments: 6

Patch Set 4 : Address comments from PS3 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+585 lines, -251 lines) Patch
M content/browser/service_worker/service_worker_cache.h View 1 3 chunks +2 lines, -4 lines 0 comments Download
M content/browser/service_worker/service_worker_cache.cc View 1 7 chunks +55 lines, -77 lines 0 comments Download
A content/browser/service_worker/service_worker_cache_scheduler.h View 1 2 1 chunk +42 lines, -0 lines 0 comments Download
A content/browser/service_worker/service_worker_cache_scheduler.cc View 1 2 1 chunk +47 lines, -0 lines 0 comments Download
A content/browser/service_worker/service_worker_cache_scheduler_unittest.cc View 1 2 1 chunk +85 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_cache_storage.h View 1 2 3 7 chunks +54 lines, -12 lines 0 comments Download
M content/browser/service_worker/service_worker_cache_storage.cc View 1 2 3 14 chunks +273 lines, -153 lines 0 comments Download
M content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc View 1 2 3 chunks +23 lines, -4 lines 0 comments Download
M content/content_browser.gypi View 1 1 chunk +2 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 8 (2 generated)
jkarlin
PTAL at everything, thanks!
5 years, 10 months ago (2015-02-02 17:55:36 UTC) #2
michaeln
lgtm, makes sense to have Open() followed by Delete() result in no errors and no ...
5 years, 10 months ago (2015-02-03 19:14:22 UTC) #3
jkarlin
Thanks! https://codereview.chromium.org/867903005/diff/40001/content/browser/service_worker/service_worker_cache_storage.cc File content/browser/service_worker/service_worker_cache_storage.cc (right): https://codereview.chromium.org/867903005/diff/40001/content/browser/service_worker/service_worker_cache_storage.cc#newcode35 content/browser/service_worker/service_worker_cache_storage.cc:35: void NoopClosure() { On 2015/02/03 19:14:22, michaeln wrote: ...
5 years, 10 months ago (2015-02-06 12:52:48 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/867903005/60001
5 years, 10 months ago (2015-02-06 12:59:55 UTC) #6
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 10 months ago (2015-02-06 13:55:13 UTC) #7
commit-bot: I haz the power
5 years, 10 months ago (2015-02-06 13:56:15 UTC) #8
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/d1292e44b91faf5098719af5e75dc04ec05e3a5a
Cr-Commit-Position: refs/heads/master@{#315022}

Powered by Google App Engine
This is Rietveld 408576698