From 460d41d11d978aa2fcee2b335025e8828e632a99 Mon Sep 17 00:00:00 2001 From: "rvargas@google.com" Date: Tue, 1 Mar 2011 20:23:36 +0000 Subject: 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 --- net/disk_cache/backend_impl.cc | 8 ++++++-- 1 file 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 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; -- cgit v1.1