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

Issue 1166433003: Service Worker: Don't write to disk during update until proven necessary (Closed)

Created:
5 years, 6 months ago by falken
Modified:
5 years, 6 months ago
Reviewers:
michaeln, kinuko, nhiroki
CC:
chromium-reviews, 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

Service Worker: Don't write to disk during update until proven necessary For updates, don't write the main script to disk until a change with the incumbent script is detected. The incumbent script is progressively compared with as the new script is read from network. Once a change is detected, copy everything matched up until now to disk, and from then on write to disk as the script continues to be read from network. BUG=457013 Committed: https://crrev.com/672f9b44c0176a503d0f996e457e3cd8db036c96 Cr-Commit-Position: refs/heads/master@{#333031}

Patch Set 1 #

Patch Set 2 : compile fix #

Patch Set 3 : review comments #

Patch Set 4 : more refactor #

Patch Set 5 : #

Patch Set 6 : patch for review #

Total comments: 8

Patch Set 7 : sync #

Patch Set 8 : review comments #

Total comments: 20

Patch Set 9 : sync #

Patch Set 10 : review comments #

Patch Set 11 : review comments and bugs #

Patch Set 12 : again #

Total comments: 17

Patch Set 13 : review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+780 lines, -117 lines) Patch
M content/browser/service_worker/service_worker_context_request_handler.cc View 1 2 3 4 5 6 7 1 chunk +11 lines, -7 lines 0 comments Download
M content/browser/service_worker/service_worker_provider_host.h View 1 chunk +9 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_write_to_cache_job.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +45 lines, -17 lines 0 comments Download
M content/browser/service_worker/service_worker_write_to_cache_job.cc View 1 2 3 4 5 6 7 8 9 10 11 12 14 chunks +410 lines, -60 lines 0 comments Download
M content/browser/service_worker/service_worker_write_to_cache_job_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 11 chunks +305 lines, -33 lines 0 comments Download

Messages

Total messages: 19 (4 generated)
falken
michaeln: This is still quite WIP but could you see if this is the right ...
5 years, 6 months ago (2015-05-29 11:42:36 UTC) #2
michaeln
The behavior described in the CL description sounds great. I like your approach doesn't involve ...
5 years, 6 months ago (2015-05-30 01:57:07 UTC) #3
falken
Thanks for the comments! It's ready for another look. I've refactored along those lines. Buffering ...
5 years, 6 months ago (2015-06-02 08:16:52 UTC) #4
nhiroki
LGTM with nits https://codereview.chromium.org/1166433003/diff/100001/content/browser/service_worker/service_worker_context_request_handler.cc File content/browser/service_worker/service_worker_context_request_handler.cc (right): https://codereview.chromium.org/1166433003/diff/100001/content/browser/service_worker/service_worker_context_request_handler.cc#newcode82 content/browser/service_worker/service_worker_context_request_handler.cc:82: stored_version->script_cache_map()->LookupResourceId(request->url()); nit: Can you wrap this ...
5 years, 6 months ago (2015-06-03 05:36:14 UTC) #5
falken
Updated, thanks! Michael, can you take another look? https://codereview.chromium.org/1166433003/diff/100001/content/browser/service_worker/service_worker_context_request_handler.cc File content/browser/service_worker/service_worker_context_request_handler.cc (right): https://codereview.chromium.org/1166433003/diff/100001/content/browser/service_worker/service_worker_context_request_handler.cc#newcode82 content/browser/service_worker/service_worker_context_request_handler.cc:82: stored_version->script_cache_map()->LookupResourceId(request->url()); ...
5 years, 6 months ago (2015-06-03 09:07:41 UTC) #6
michaeln
looking pretty good https://codereview.chromium.org/1166433003/diff/140001/content/browser/service_worker/service_worker_write_to_cache_job.cc File content/browser/service_worker/service_worker_write_to_cache_job.cc (left): https://codereview.chromium.org/1166433003/diff/140001/content/browser/service_worker/service_worker_write_to_cache_job.cc#oldcode248 content/browser/service_worker/service_worker_write_to_cache_job.cc:248: http_info_.reset(info_buffer_->http_info.release()); I'm not sure how intentional ...
5 years, 6 months ago (2015-06-04 02:57:25 UTC) #7
falken
Ready for another look. The diff against patchset 9 shows the changes from the reviewed ...
5 years, 6 months ago (2015-06-04 14:11:12 UTC) #8
michaeln
lgtm! https://codereview.chromium.org/1166433003/diff/140001/content/browser/service_worker/service_worker_write_to_cache_job.cc File content/browser/service_worker/service_worker_write_to_cache_job.cc (right): https://codereview.chromium.org/1166433003/diff/140001/content/browser/service_worker/service_worker_write_to_cache_job.cc#newcode224 content/browser/service_worker/service_worker_write_to_cache_job.cc:224: bool OnResponseEnded() override { On 2015/06/04 14:11:11, falken ...
5 years, 6 months ago (2015-06-05 02:07:04 UTC) #9
kinuko
(lightweight review comments only, looking pretty good to me too & thanks to michaeln for ...
5 years, 6 months ago (2015-06-05 02:39:10 UTC) #10
falken
Thanks for the review! https://codereview.chromium.org/1166433003/diff/220001/content/browser/service_worker/service_worker_write_to_cache_job.cc File content/browser/service_worker/service_worker_write_to_cache_job.cc (right): https://codereview.chromium.org/1166433003/diff/220001/content/browser/service_worker/service_worker_write_to_cache_job.cc#newcode59 content/browser/service_worker/service_worker_write_to_cache_job.cc:59: DCHECK_LT(0, bytes_to_copy_); On 2015/06/05 02:39:09, ...
5 years, 6 months ago (2015-06-05 08:39:07 UTC) #11
kinuko
(lgtm, fyi) https://codereview.chromium.org/1166433003/diff/220001/content/browser/service_worker/service_worker_write_to_cache_job.cc File content/browser/service_worker/service_worker_write_to_cache_job.cc (right): https://codereview.chromium.org/1166433003/diff/220001/content/browser/service_worker/service_worker_write_to_cache_job.cc#newcode59 content/browser/service_worker/service_worker_write_to_cache_job.cc:59: DCHECK_LT(0, bytes_to_copy_); On 2015/06/05 08:39:07, falken wrote: ...
5 years, 6 months ago (2015-06-05 08:56:49 UTC) #13
falken
Thanks! Think I'm going to CQ this. We also still call ServiceWorkerStorage::CompareScriptResources after this job ...
5 years, 6 months ago (2015-06-05 10:01:33 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1166433003/240001
5 years, 6 months ago (2015-06-05 10:33:28 UTC) #17
commit-bot: I haz the power
Committed patchset #13 (id:240001)
5 years, 6 months ago (2015-06-05 10:54:48 UTC) #18
commit-bot: I haz the power
5 years, 6 months ago (2015-06-05 10:55:40 UTC) #19
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/672f9b44c0176a503d0f996e457e3cd8db036c96
Cr-Commit-Position: refs/heads/master@{#333031}

Powered by Google App Engine
This is Rietveld 408576698