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

Issue 1020413002: Use "database identifier" rather than raw origin as directory hash input (Closed)

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

Description

Use "database identifier" rather than raw origin as directory hash input When we allow non-Service Workers to have access to the Cache Storage API we will want to match other storage systems and use a database identifier generated from a Blink SecurityOrigin object, rather than just the origin URL, as the key for per-origin storage. This change changes the computation of the directory name on disk (a hash) from using the origin to a database identifier, in anticipation of an identifier being passed in after some future CLs. Existing data is preserved by preceding the uses of the directory name (open, delete, or enumeration) with a directory rename from the "legacy" name computed from the origin to the "new" name computed from the directory identifier. The rename is done by posting a task to the cache task runner just before the actual task. After a few releases we remove the migration code. R=michaeln,jkarlin BUG=439389 Committed: https://crrev.com/e82f0728287f968b27d9fc9e54153df145a9fe1c Cr-Commit-Position: refs/heads/master@{#322055}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add tests #

Patch Set 3 : Don't override existing new directory if migration fails #

Total comments: 2

Patch Set 4 : Fix typo #

Total comments: 2

Patch Set 5 : Make sure we're not keeping an object reference around #

Unified diffs Side-by-side diffs Delta from patch set Stats (+175 lines, -9 lines) Patch
M content/browser/service_worker/service_worker_cache_storage_manager.h View 1 4 chunks +17 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_cache_storage_manager.cc View 1 2 6 chunks +47 lines, -8 lines 0 comments Download
M content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc View 1 2 3 4 2 chunks +111 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (2 generated)
jsbell
jkarlin, michaeln - what do you think about this? I'm thinking: land this, then tweak ...
5 years, 9 months ago (2015-03-20 22:03:22 UTC) #1
jsbell
Actually, maybe I'll leave the other CL alone for now so I don't touch CacheStorageManager ...
5 years, 9 months ago (2015-03-20 22:32:46 UTC) #2
jkarlin
Please add tests.
5 years, 9 months ago (2015-03-23 15:06:24 UTC) #3
michaeln
> as the key for per-origin storage Although we probably should, I don't think we ...
5 years, 9 months ago (2015-03-23 19:38:53 UTC) #4
jsbell
https://codereview.chromium.org/1020413002/diff/1/content/browser/service_worker/service_worker_cache_storage_manager.cc File content/browser/service_worker/service_worker_cache_storage_manager.cc (right): https://codereview.chromium.org/1020413002/diff/1/content/browser/service_worker/service_worker_cache_storage_manager.cc#newcode376 content/browser/service_worker/service_worker_cache_storage_manager.cc:376: base::Move(old_path, new_path); On 2015/03/23 19:38:53, michaeln wrote: > An ...
5 years, 9 months ago (2015-03-23 22:39:59 UTC) #5
jsbell
Added tests for migration cases. PTAL?
5 years, 9 months ago (2015-03-23 22:40:16 UTC) #6
michaeln
lgtm! https://codereview.chromium.org/1020413002/diff/40001/content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc File content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc (right): https://codereview.chromium.org/1020413002/diff/40001/content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc#newcode580 content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc:580: // Populate a cache, the move it to ...
5 years, 9 months ago (2015-03-23 23:53:33 UTC) #7
jsbell
Thanks! jkarlin@ - I'll wait for your go-ahead. https://codereview.chromium.org/1020413002/diff/40001/content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc File content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc (right): https://codereview.chromium.org/1020413002/diff/40001/content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc#newcode580 content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc:580: // ...
5 years, 9 months ago (2015-03-24 00:18:37 UTC) #8
jkarlin
lgtm but note the comment below https://codereview.chromium.org/1020413002/diff/60001/content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc File content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc (right): https://codereview.chromium.org/1020413002/diff/60001/content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc#newcode590 content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc:590: ASSERT_TRUE(Open(origin1_, cache2_)); FYI ...
5 years, 9 months ago (2015-03-24 18:58:54 UTC) #9
jsbell
https://codereview.chromium.org/1020413002/diff/60001/content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc File content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc (right): https://codereview.chromium.org/1020413002/diff/60001/content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc#newcode590 content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc:590: ASSERT_TRUE(Open(origin1_, cache2_)); On 2015/03/24 18:58:54, jkarlin wrote: > FYI ...
5 years, 9 months ago (2015-03-24 19:03:07 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1020413002/80001
5 years, 9 months ago (2015-03-24 19:04:48 UTC) #13
commit-bot: I haz the power
Committed patchset #5 (id:80001)
5 years, 9 months ago (2015-03-24 20:01:49 UTC) #14
commit-bot: I haz the power
5 years, 9 months ago (2015-03-24 20:03:31 UTC) #15
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/e82f0728287f968b27d9fc9e54153df145a9fe1c
Cr-Commit-Position: refs/heads/master@{#322055}

Powered by Google App Engine
This is Rietveld 408576698