Give DiskLruCache an API to edit a snapshot.

When an HTTP conditional GET results in a cache hit (ie. 304 Not Modified)
we want to update the cache's HTTP headers with the server's latest.
Unfortunately prior to this change DiskLruCache had no mechanism to
atomically change a snapshot. This change gives us a mechanism to
upgrade from a snapshot (read only) to an editor (read/write).

Bug: http://b/4460598
Change-Id: I1714fe9ce4291d0c5095460173bc4cf6da6ce9ea
2 files changed