{"push_id":817052606,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"7320022d75696c0f0b4ea02ed801fbbec4783658","before":"500dbe3cfc18c490cc466abef162896302284814","commits":[{"sha":"7320022d75696c0f0b4ea02ed801fbbec4783658","author":{"email":"1693f95ea06ee6d7b2276cb599c3f4f33a951d9c@chromium.org","name":"ellyjones"},"message":"ServiceWorkerWriteToCacheJob: refactor\n\nThis CL is a re-land of a previously reviewed and approved CL that was reverted: https://codereview.chromium.org/1356153002/\n\nServiceWorkerWriteToCacheJob is a subclass of URLRequestJob that is responsible for filling and updating a write-through cache for ServiceWorker data. Specifically, ServiceWorkerWriteToCacheJob creates an underlying URLRequestJob which it uses to do the actual network request for the script, then returns the script body to the creator of the ServiceWorkerWriteToCacheJob while also storing it in the ServiceWorker cache if it has been updated.\n\nIn order to avoid spurious cache rewrites, ServiceWorkerWriteToCacheJob defers writing an entry for as long as possible: if there is an existing entry, it compares incoming network data to the cache entry's data, and only starts writing once there is a mismatch. Since the mismatch may occur after much data has already been handled, once this happens ServiceWorkerWriteToCacheJob must transparently copy all the existing data up to that point from the cache, then resume streaming network data into the cache and back to its consumer. This is the \"compare-and-copy\" process. If there is no existing entry, network data is streamed directly to the cache; this is the \"passthrough\" process.\n\nThis CL removes the code implementing the compare-and-copy and passthrough processes from ServiceWorkerWriteToCacheJob and moves it into a separate class, ServiceWorkerCacheWriter. ServiceWorkerCacheWriter exposes an asynchronous API for overwriting a single cache entry that is now used by ServiceWorkerWriteToCacheJob.\n\nBUG=474859\nTBR=jochen,falken\n\nReview URL: https://codereview.chromium.org/1375293004\n\nCr-Commit-Position: refs/heads/master@{#352593}","distinct":true,"url":"https://api.github.com/repos/dstockwell/chromium/commits/7320022d75696c0f0b4ea02ed801fbbec4783658"}]}