diff options
author | ellyjones <ellyjones@chromium.org> | 2015-10-06 09:40:52 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-06 16:41:55 +0000 |
commit | 5cc92c94795e7011db50af522a128b975b138b3c (patch) | |
tree | fccd2050c41c724ef267ca5fbd806f41e745d043 /content/browser/appcache | |
parent | 97037794802e00b5e285c1929a69eb76758cb8f5 (diff) | |
download | chromium_src-5cc92c94795e7011db50af522a128b975b138b3c.zip chromium_src-5cc92c94795e7011db50af522a128b975b138b3c.tar.gz chromium_src-5cc92c94795e7011db50af522a128b975b138b3c.tar.bz2 |
Revert of ServiceWorkerWriteToCacheJob: refactor (patchset #4 id:60001 of https://codereview.chromium.org/1375293004/ )
Reason for revert:
Broke this blink bot: http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux/builds/55132
Original issue's description:
> ServiceWorkerWriteToCacheJob: refactor
>
> This CL is a re-land of a previously reviewed and approved CL that was reverted: https://codereview.chromium.org/1356153002/
>
> ServiceWorkerWriteToCacheJob 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.
>
> In 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.
>
> This 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.
>
> BUG=474859
> TBR=jochen,falken
>
> Committed: https://crrev.com/7320022d75696c0f0b4ea02ed801fbbec4783658
> Cr-Commit-Position: refs/heads/master@{#352593}
TBR=mmenke@chromium.org,michaeln@chromium.org,falken@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=474859
Review URL: https://codereview.chromium.org/1388123002
Cr-Commit-Position: refs/heads/master@{#352619}
Diffstat (limited to 'content/browser/appcache')
-rw-r--r-- | content/browser/appcache/appcache_response.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/content/browser/appcache/appcache_response.h b/content/browser/appcache/appcache_response.h index a4c87db..8d6c790 100644 --- a/content/browser/appcache/appcache_response.h +++ b/content/browser/appcache/appcache_response.h @@ -209,9 +209,8 @@ class CONTENT_EXPORT AppCacheResponseWriter // negative error code or the number of bytes written. The 'callback' is a // required parameter. The contents of 'info_buf' are not modified. // Should only be called where there is no Write operation in progress. - // (virtual for testing) - virtual void WriteInfo(HttpResponseInfoIOBuffer* info_buf, - const net::CompletionCallback& callback); + void WriteInfo(HttpResponseInfoIOBuffer* info_buf, + const net::CompletionCallback& callback); // Writes data to storage. Always returns the result of the write // asynchronously through the 'callback'. Returns the number of bytes written @@ -221,10 +220,8 @@ class CONTENT_EXPORT AppCacheResponseWriter // the number of bytes written. The 'callback' is a required parameter. // The contents of 'buf' are not modified. // Should only be called where there is no Write operation in progress. - // (virtual for testing) - virtual void WriteData(net::IOBuffer* buf, - int buf_len, - const net::CompletionCallback& callback); + void WriteData(net::IOBuffer* buf, int buf_len, + const net::CompletionCallback& callback); // Returns true if there is a write pending. bool IsWritePending() { return IsIOPending(); } |