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

Issue 863263003: [ServiceWorkerCache] Make the cache operations run serially. (Closed)

Created:
5 years, 11 months ago by jkarlin
Modified:
5 years, 11 months ago
Reviewers:
michaeln
CC:
chromium-reviews, 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] Make the cache operations run serially. There are correctness issues in the ServiceWorkerCache when multiple operations occur on the same key in parallel. The various steps of the operations can interleave. This CL serializes all cache 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 entry. A smarter scheduler can be created in the future to implement that (see https://crbug.com/451174). BUG=421226 Committed: https://crrev.com/52dafffb509c6ca4ef59b62f08a7ecdc2e179017 Cr-Commit-Position: refs/heads/master@{#313117}

Patch Set 1 #

Patch Set 2 : Nits #

Patch Set 3 : Nit #

Patch Set 4 : TODO #

Total comments: 4

Patch Set 5 : Address comments from PS4 #

Patch Set 6 : Change Close to run serially too #

Unified diffs Side-by-side diffs Delta from patch set Stats (+218 lines, -247 lines) Patch
M content/browser/service_worker/service_worker_cache.h View 1 2 3 4 5 8 chunks +19 lines, -17 lines 0 comments Download
M content/browser/service_worker/service_worker_cache.cc View 1 2 3 4 5 12 chunks +172 lines, -120 lines 0 comments Download
M content/browser/service_worker/service_worker_cache_unittest.cc View 1 2 3 4 5 1 chunk +27 lines, -110 lines 0 comments Download

Messages

Total messages: 12 (3 generated)
jkarlin
Thanks!
5 years, 11 months ago (2015-01-22 21:53:15 UTC) #2
michaeln
lgtm https://codereview.chromium.org/863263003/diff/60001/content/browser/service_worker/service_worker_cache.cc File content/browser/service_worker/service_worker_cache.cc (right): https://codereview.chromium.org/863263003/diff/60001/content/browser/service_worker/service_worker_cache.cc#newcode1201 content/browser/service_worker/service_worker_cache.cc:1201: void ServiceWorkerCache::InitBackend(const base::Closure& callback) { The contract is ...
5 years, 11 months ago (2015-01-23 00:55:25 UTC) #3
jkarlin
Thanks michaeln. I've also updated Close a smidge, it now waits to change the backend ...
5 years, 11 months ago (2015-01-23 18:13:42 UTC) #5
jkarlin
PTAL if you get a chance michaeln, thanks!
5 years, 11 months ago (2015-01-26 13:50:07 UTC) #6
jkarlin
PTAL if you get a chance michaeln, thanks!
5 years, 11 months ago (2015-01-26 13:50:09 UTC) #7
michaeln
lgtm!
5 years, 11 months ago (2015-01-26 19:13:23 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/863263003/120001
5 years, 11 months ago (2015-01-26 19:14:56 UTC) #10
commit-bot: I haz the power
Committed patchset #6 (id:120001)
5 years, 11 months ago (2015-01-26 20:26:04 UTC) #11
commit-bot: I haz the power
5 years, 11 months ago (2015-01-26 20:27:56 UTC) #12
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/52dafffb509c6ca4ef59b62f08a7ecdc2e179017
Cr-Commit-Position: refs/heads/master@{#313117}

Powered by Google App Engine
This is Rietveld 408576698