Service Worker: Don't write to disk during update until proven necessary
commit672f9b44c0176a503d0f996e457e3cd8db036c96
authorfalken <falken@chromium.org>
Fri, 5 Jun 2015 10:54:42 +0000 (5 03:54 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 5 Jun 2015 10:55:10 +0000 (5 10:55 +0000)
tree2e856f0f8995dd5c598386c8a82dcd2ae4472349
parent11a8a0ebf0c3c9091646d8910f9f2a973346293d
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

Review URL: https://codereview.chromium.org/1166433003

Cr-Commit-Position: refs/heads/master@{#333031}
content/browser/service_worker/service_worker_context_request_handler.cc
content/browser/service_worker/service_worker_provider_host.h
content/browser/service_worker/service_worker_write_to_cache_job.cc
content/browser/service_worker/service_worker_write_to_cache_job.h
content/browser/service_worker/service_worker_write_to_cache_job_unittest.cc