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

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

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | « net/disk_cache/backend_unittest.cc ('k') | net/disk_cache/cache_util_unittest.cc » ('j') | 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/cache_util.h" 5 #include "net/disk_cache/cache_util.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 } 35 }
36 36
37 // Returns a full path to rename the current cache, in order to delete it. path 37 // Returns a full path to rename the current cache, in order to delete it. path
38 // is the current folder location, and name is the current folder name. 38 // is the current folder location, and name is the current folder name.
39 base::FilePath GetTempCacheName(const base::FilePath& path, 39 base::FilePath GetTempCacheName(const base::FilePath& path,
40 const std::string& name) { 40 const std::string& name) {
41 // We'll attempt to have up to kMaxOldFolders folders for deletion. 41 // We'll attempt to have up to kMaxOldFolders folders for deletion.
42 for (int i = 0; i < kMaxOldFolders; i++) { 42 for (int i = 0; i < kMaxOldFolders; i++) {
43 base::FilePath to_delete = GetPrefixedName(path, name, i); 43 base::FilePath to_delete = GetPrefixedName(path, name, i);
44 if (!file_util::PathExists(to_delete)) 44 if (!base::PathExists(to_delete))
45 return to_delete; 45 return to_delete;
46 } 46 }
47 return base::FilePath(); 47 return base::FilePath();
48 } 48 }
49 49
50 } // namespace 50 } // namespace
51 51
52 namespace disk_cache { 52 namespace disk_cache {
53 53
54 // In order to process a potentially large number of files, we'll rename the 54 // In order to process a potentially large number of files, we'll rename the
(...skipping 29 matching lines...) Expand all
84 << to_delete.value(); 84 << to_delete.value();
85 return false; 85 return false;
86 } 86 }
87 87
88 base::WorkerPool::PostTask( 88 base::WorkerPool::PostTask(
89 FROM_HERE, base::Bind(&CleanupCallback, path, name_str), true); 89 FROM_HERE, base::Bind(&CleanupCallback, path, name_str), true);
90 return true; 90 return true;
91 } 91 }
92 92
93 } // namespace disk_cache 93 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/backend_unittest.cc ('k') | net/disk_cache/cache_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698