summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-01 20:23:36 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-01 20:23:36 +0000
commit460d41d11d978aa2fcee2b335025e8828e632a99 (patch)
tree35b927ea2e3037b04d2605f73056894e6c334765
parent2a5bfd88610f860842acb87be9780eb628a3ed15 (diff)
downloadchromium_src-460d41d11d978aa2fcee2b335025e8828e632a99.zip
chromium_src-460d41d11d978aa2fcee2b335025e8828e632a99.tar.gz
chromium_src-460d41d11d978aa2fcee2b335025e8828e632a99.tar.bz2
Disk cache: Don't attempt to create another external file
after an unexpected failure. BUG=64807 TEST=none Review URL: http://codereview.chromium.org/6581016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76413 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--net/disk_cache/backend_impl.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index 58d75ad..5491268 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -854,10 +854,14 @@ bool BackendImpl::CreateExternalFile(Addr* address) {
base::PLATFORM_FILE_WRITE |
base::PLATFORM_FILE_CREATE |
base::PLATFORM_FILE_EXCLUSIVE_WRITE;
+ base::PlatformFileError error;
scoped_refptr<disk_cache::File> file(new disk_cache::File(
- base::CreatePlatformFile(name, flags, NULL, NULL)));
- if (!file->IsValid())
+ base::CreatePlatformFile(name, flags, NULL, &error)));
+ if (!file->IsValid()) {
+ if (error != base::PLATFORM_FILE_ERROR_EXISTS)
+ return false;
continue;
+ }
success = true;
break;