Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: net/disk_cache/backend_impl.cc

Issue 10204005: Disk cache: Add more logging to track disk errors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/disk_cache/backend_impl.h" 5 #include "net/disk_cache/backend_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 } 853 }
854 FilePath name = GetFileName(file_address); 854 FilePath name = GetFileName(file_address);
855 int flags = base::PLATFORM_FILE_READ | 855 int flags = base::PLATFORM_FILE_READ |
856 base::PLATFORM_FILE_WRITE | 856 base::PLATFORM_FILE_WRITE |
857 base::PLATFORM_FILE_CREATE | 857 base::PLATFORM_FILE_CREATE |
858 base::PLATFORM_FILE_EXCLUSIVE_WRITE; 858 base::PLATFORM_FILE_EXCLUSIVE_WRITE;
859 base::PlatformFileError error; 859 base::PlatformFileError error;
860 scoped_refptr<disk_cache::File> file(new disk_cache::File( 860 scoped_refptr<disk_cache::File> file(new disk_cache::File(
861 base::CreatePlatformFile(name, flags, NULL, &error))); 861 base::CreatePlatformFile(name, flags, NULL, &error)));
862 if (!file->IsValid()) { 862 if (!file->IsValid()) {
863 if (error != base::PLATFORM_FILE_ERROR_EXISTS) 863 if (error != base::PLATFORM_FILE_ERROR_EXISTS) {
864 LOG(ERROR) << "Unable to create file: " << error;
864 return false; 865 return false;
866 }
865 continue; 867 continue;
866 } 868 }
867 869
868 success = true; 870 success = true;
869 break; 871 break;
870 } 872 }
871 873
872 DCHECK(success); 874 DCHECK(success);
873 if (!success) 875 if (!success)
874 return false; 876 return false;
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after
2170 if (total_memory > kMaxBuffersSize || total_memory <= 0) 2172 if (total_memory > kMaxBuffersSize || total_memory <= 0)
2171 total_memory = kMaxBuffersSize; 2173 total_memory = kMaxBuffersSize;
2172 2174
2173 done = true; 2175 done = true;
2174 } 2176 }
2175 2177
2176 return static_cast<int>(total_memory); 2178 return static_cast<int>(total_memory);
2177 } 2179 }
2178 2180
2179 } // namespace disk_cache 2181 } // namespace disk_cache
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698