SimpleCache optimistic writes should not keep references to their IO buffer.
commit689589cc184b9860b7ebcebc1f781f600e7e1bff
authorgavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 31 May 2013 21:12:38 +0000 (31 21:12 +0000)
committergavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 31 May 2013 21:12:38 +0000 (31 21:12 +0000)
tree585b060aebe75cd01905e9a298830332d4347dd4
parent0d12147dac864d547470ba03d684c8b53c149456
SimpleCache optimistic writes should not keep references to their IO buffer.

After the write operation returns OK, the caller is free to reuse the IOBuffer.
It is invalid to do, as the SimpleCache did previously, return OK and keep a
reference and use the IOBuffer.

As it happens, the BufferResource handler does reuse IO buffers, and this was
causing cache read errors due to CRC mismatches from the IO buffer being reused.

R=pasko,felipeg
BUG=239223

Review URL: https://chromiumcodereview.appspot.com/15825012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203477 0039d316-1c4b-4281-b951-d872f2087c98
net/disk_cache/entry_unittest.cc
net/disk_cache/simple/simple_entry_impl.cc