Deflake SimpleCache reads when multiple operations in flight.
commit70740b7a042b011ee45764c777799f762c4d5076
authorgavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 10 May 2013 22:39:39 +0000 (10 22:39 +0000)
committergavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 10 May 2013 22:39:39 +0000 (10 22:39 +0000)
treeb80bde5d25c3da9fdcbcca9bc6b7a92b53510bd7
parentb7a059d8e08d6c02f718552793de33cbabb6e77a
Deflake SimpleCache reads when multiple operations in flight.

When multiple Reads/Writes are in flight, they can race each other for
updates to the size of the entry. By moving the updates to coincide
with the beginning of the blocking operation, we remove flakes.

Unit tests still require that reads can fast fail; but not while
operations are pending (they use the single operation interface), so
we still pass unit tests with the tighter (and actually correct)
behaviour that we only fast fail when no other operations are pending.

R=pasko@chromium.org,felipeg,rdsmith,pliard
BUG=239223

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

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