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

Issue 1155063002: ServiceWorker: Introduce ServiceWorkerDiskCacheMigrator (Closed)

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

Description

ServiceWorker: Introduce ServiceWorkerDiskCacheMigrator This introduces ServiceWorkerDiskCacheMigrator for migrating the script cache from the BlockFile backend to the Simple backend. The migrator iterates over resources cached in the src DiskCache and moves them into the dest DiskCache one by one. This just adds the migrator code and does NOT run the migration code on the production environment yet. BUG=487482 TEST=content_unittests --gtest_filter=ServiceWorkerDiskCacheMigratorTest.* Committed: https://crrev.com/255913a791a398eed5c352fa3ac220be178cc772 Cr-Commit-Position: refs/heads/master@{#332603}

Patch Set 1 : #

Patch Set 2 : [DONT REVIEW THIS] Test the migration from Simple to Simple for Android #

Patch Set 3 : [DONT REVIEW THIS] ditto with some fixes #

Patch Set 4 : [DONT REVIEW THIS] #

Patch Set 5 : fix tests and support abort/delete oprations #

Total comments: 8

Patch Set 6 : incorporate kinuko@'s comments (adopt all-or-nothing model) #

Total comments: 4

Patch Set 7 : use fixed time for tests #

Total comments: 9

Patch Set 8 : incorporate michaeln@'s comments #

Total comments: 4

Patch Set 9 : fix race and clean up #

Total comments: 12

Patch Set 10 : incorporate falken@'s comments #

Patch Set 11 : add a test case #

Patch Set 12 : fix #

Patch Set 13 : add DCHECKs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+706 lines, -10 lines) Patch
M content/browser/appcache/appcache_disk_cache.h View 3 chunks +5 lines, -1 line 0 comments Download
M content/browser/appcache/appcache_disk_cache.cc View 3 chunks +14 lines, -8 lines 0 comments Download
M content/browser/service_worker/service_worker_disk_cache.h View 1 2 3 4 3 chunks +14 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_disk_cache.cc View 1 chunk +16 lines, -0 lines 0 comments Download
A content/browser/service_worker/service_worker_disk_cache_migrator.h View 1 2 3 4 5 6 7 8 1 chunk +69 lines, -0 lines 0 comments Download
A content/browser/service_worker/service_worker_disk_cache_migrator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +343 lines, -0 lines 0 comments Download
A content/browser/service_worker/service_worker_disk_cache_migrator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +241 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_storage.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 39 (14 generated)
nhiroki
Hi michaeln@ and kinuko@, can you review this? This migrator will be called during the ...
5 years, 7 months ago (2015-05-25 17:13:35 UTC) #3
nhiroki
Hmmm... migrator tests are failing on linux_android_rel_ng maybe due to timeout. I'll take a closer ...
5 years, 7 months ago (2015-05-26 00:56:24 UTC) #4
nhiroki
On 2015/05/26 00:56:24, nhiroki wrote: > Hmmm... migrator tests are failing on linux_android_rel_ng maybe due ...
5 years, 7 months ago (2015-05-26 01:10:07 UTC) #5
kinuko
On 2015/05/26 01:10:07, nhiroki wrote: > On 2015/05/26 00:56:24, nhiroki wrote: > > Hmmm... migrator ...
5 years, 7 months ago (2015-05-26 03:18:17 UTC) #6
nhiroki
On 2015/05/26 03:18:17, kinuko wrote: > On 2015/05/26 01:10:07, nhiroki wrote: > > On 2015/05/26 ...
5 years, 7 months ago (2015-05-26 03:35:38 UTC) #7
nhiroki
On 2015/05/26 03:35:38, nhiroki wrote: > On 2015/05/26 03:18:17, kinuko wrote: > > On 2015/05/26 ...
5 years, 7 months ago (2015-05-26 09:16:00 UTC) #9
kinuko
Sorry for slow review! https://codereview.chromium.org/1155063002/diff/110001/content/browser/service_worker/service_worker_disk_cache_migrator.cc File content/browser/service_worker/service_worker_disk_cache_migrator.cc (right): https://codereview.chromium.org/1155063002/diff/110001/content/browser/service_worker/service_worker_disk_cache_migrator.cc#newcode19 content/browser/service_worker/service_worker_disk_cache_migrator.cc:19: : public base::RefCounted<ServiceWorkerDiskCacheMigrator::Task> { nit: ...
5 years, 7 months ago (2015-05-27 05:45:15 UTC) #10
nhiroki
Thank you for reviewing! Updated. https://codereview.chromium.org/1155063002/diff/110001/content/browser/service_worker/service_worker_disk_cache_migrator.cc File content/browser/service_worker/service_worker_disk_cache_migrator.cc (right): https://codereview.chromium.org/1155063002/diff/110001/content/browser/service_worker/service_worker_disk_cache_migrator.cc#newcode19 content/browser/service_worker/service_worker_disk_cache_migrator.cc:19: : public base::RefCounted<ServiceWorkerDiskCacheMigrator::Task> { ...
5 years, 7 months ago (2015-05-27 10:05:28 UTC) #13
kinuko
lgtm https://codereview.chromium.org/1155063002/diff/170001/content/browser/service_worker/service_worker_disk_cache_migrator_unittest.cc File content/browser/service_worker/service_worker_disk_cache_migrator_unittest.cc (right): https://codereview.chromium.org/1155063002/diff/170001/content/browser/service_worker/service_worker_disk_cache_migrator_unittest.cc#newcode84 content/browser/service_worker/service_worker_disk_cache_migrator_unittest.cc:84: info->response_time = base::Time::Now(); nit: should we use fixed ...
5 years, 7 months ago (2015-05-27 14:12:15 UTC) #14
nhiroki
Thanks! https://codereview.chromium.org/1155063002/diff/170001/content/browser/service_worker/service_worker_disk_cache_migrator_unittest.cc File content/browser/service_worker/service_worker_disk_cache_migrator_unittest.cc (right): https://codereview.chromium.org/1155063002/diff/170001/content/browser/service_worker/service_worker_disk_cache_migrator_unittest.cc#newcode84 content/browser/service_worker/service_worker_disk_cache_migrator_unittest.cc:84: info->response_time = base::Time::Now(); On 2015/05/27 14:12:15, kinuko wrote: ...
5 years, 7 months ago (2015-05-27 14:52:39 UTC) #15
michaeln
https://codereview.chromium.org/1155063002/diff/190001/content/browser/service_worker/service_worker_disk_cache_migrator.cc File content/browser/service_worker/service_worker_disk_cache_migrator.cc (right): https://codereview.chromium.org/1155063002/diff/190001/content/browser/service_worker/service_worker_disk_cache_migrator.cc#newcode133 content/browser/service_worker/service_worker_disk_cache_migrator.cc:133: memmove(buffer->data(), http_info->metadata->data(), data_size); This copy is unfortunate, i think ...
5 years, 7 months ago (2015-05-27 23:09:23 UTC) #16
nhiroki
Thank you for reviewing! Comment reply only. I'll update the patch later. https://codereview.chromium.org/1155063002/diff/190001/content/browser/service_worker/service_worker_disk_cache_migrator.cc File content/browser/service_worker/service_worker_disk_cache_migrator.cc ...
5 years, 7 months ago (2015-05-28 00:21:09 UTC) #17
nhiroki
Updated! Can you take another look? https://codereview.chromium.org/1155063002/diff/190001/content/browser/service_worker/service_worker_disk_cache_migrator.cc File content/browser/service_worker/service_worker_disk_cache_migrator.cc (right): https://codereview.chromium.org/1155063002/diff/190001/content/browser/service_worker/service_worker_disk_cache_migrator.cc#newcode133 content/browser/service_worker/service_worker_disk_cache_migrator.cc:133: memmove(buffer->data(), http_info->metadata->data(), data_size); ...
5 years, 7 months ago (2015-05-28 07:47:11 UTC) #19
nhiroki
michaeln@: ping?
5 years, 6 months ago (2015-06-01 09:28:31 UTC) #20
kinuko
On 2015/06/01 09:28:31, nhiroki wrote: > michaeln@: ping? I'll try to take one more look ...
5 years, 6 months ago (2015-06-02 12:42:52 UTC) #22
michaeln
modulo the race, i think this lgtm https://codereview.chromium.org/1155063002/diff/230001/content/browser/service_worker/service_worker_disk_cache_migrator.cc File content/browser/service_worker/service_worker_disk_cache_migrator.cc (right): https://codereview.chromium.org/1155063002/diff/230001/content/browser/service_worker/service_worker_disk_cache_migrator.cc#newcode184 content/browser/service_worker/service_worker_disk_cache_migrator.cc:184: new net::IOBuffer(entry_->GetDataSize(0)); ...
5 years, 6 months ago (2015-06-03 02:13:07 UTC) #23
nhiroki
Thank you for reviewing! Updated. https://codereview.chromium.org/1155063002/diff/230001/content/browser/service_worker/service_worker_disk_cache_migrator.cc File content/browser/service_worker/service_worker_disk_cache_migrator.cc (right): https://codereview.chromium.org/1155063002/diff/230001/content/browser/service_worker/service_worker_disk_cache_migrator.cc#newcode184 content/browser/service_worker/service_worker_disk_cache_migrator.cc:184: new net::IOBuffer(entry_->GetDataSize(0)); On 2015/06/03 ...
5 years, 6 months ago (2015-06-03 03:58:12 UTC) #24
kinuko
lgtm (still)
5 years, 6 months ago (2015-06-03 05:57:18 UTC) #25
falken
Haven't read unittest yet. https://codereview.chromium.org/1155063002/diff/250001/content/browser/service_worker/service_worker_disk_cache_migrator.cc File content/browser/service_worker/service_worker_disk_cache_migrator.cc (right): https://codereview.chromium.org/1155063002/diff/250001/content/browser/service_worker/service_worker_disk_cache_migrator.cc#newcode258 content/browser/service_worker/service_worker_disk_cache_migrator.cc:258: // ERR_FAILED means the iterator ...
5 years, 6 months ago (2015-06-03 06:45:33 UTC) #26
falken
I think this lgtm too https://codereview.chromium.org/1155063002/diff/250001/content/browser/service_worker/service_worker_disk_cache_migrator_unittest.cc File content/browser/service_worker/service_worker_disk_cache_migrator_unittest.cc (right): https://codereview.chromium.org/1155063002/diff/250001/content/browser/service_worker/service_worker_disk_cache_migrator_unittest.cc#newcode162 content/browser/service_worker/service_worker_disk_cache_migrator_unittest.cc:162: void StartMigration() { This ...
5 years, 6 months ago (2015-06-03 08:35:56 UTC) #27
nhiroki
Thank you! Updated. https://codereview.chromium.org/1155063002/diff/250001/content/browser/service_worker/service_worker_disk_cache_migrator.cc File content/browser/service_worker/service_worker_disk_cache_migrator.cc (right): https://codereview.chromium.org/1155063002/diff/250001/content/browser/service_worker/service_worker_disk_cache_migrator.cc#newcode258 content/browser/service_worker/service_worker_disk_cache_migrator.cc:258: // ERR_FAILED means the iterator reaches ...
5 years, 6 months ago (2015-06-03 08:51:22 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1155063002/370001
5 years, 6 months ago (2015-06-03 10:06:30 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1155063002/370001
5 years, 6 months ago (2015-06-03 12:52:26 UTC) #37
commit-bot: I haz the power
Committed patchset #13 (id:370001)
5 years, 6 months ago (2015-06-03 12:56:11 UTC) #38
commit-bot: I haz the power
5 years, 6 months ago (2015-06-03 12:57:03 UTC) #39
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/255913a791a398eed5c352fa3ac220be178cc772
Cr-Commit-Position: refs/heads/master@{#332603}

Powered by Google App Engine
This is Rietveld 408576698