[CacheStorage] Give cache directories unique names

The CacheStorage class creates a directory for each cache based off of
a hash of the cache's name. This is problematic in situations where a
cache is deleted and then recreated (but not yet wiped from
disk as javascript might be referencing it).

This CL gives every new cache a unique directory and stores the directory
mapping in the cache storage index protobuf. Legacy caches are moved to
new directories on CacheStorage initialization.

BUG=542668
TBR=jochen, jsbell

There are two CLs in this merge as the second fixes a bug in the first.

Review URL: https://codereview.chromium.org/1414033002
Review URL: https://codereview.chromium.org/1428463002

Cr-Commit-Position: refs/heads/master@{#356055}
(cherry picked from commit 4519a22b4c1683f1e79543a4238bc5cdb1880b5e)
Cr-Commit-Position: refs/heads/master@{#356107}
(cherry picked from commit b65cfea2a48ce74ac98e2b10006e9d8b868d4553)

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

Cr-Commit-Position: refs/branch-heads/2526@{#295}
Cr-Branched-From: cb947c0153db0ec02a8abbcb3ca086d88bf6006f-refs/heads/master@{#352221}
7 files changed