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

Side by Side Diff: net/disk_cache/simple/simple_index_file_win.cc

Issue 2774923002: Try to speed up SimpleCache index re-sync on Windows. (Closed)
Patch Set: git cl try Created 3 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
« no previous file with comments | « net/disk_cache/simple/simple_index_file_posix.cc ('k') | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/simple/simple_index_file.h" 5 #include "net/disk_cache/simple/simple_index_file.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/files/file_enumerator.h" 9 #include "base/files/file_enumerator.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 11
12 namespace disk_cache { 12 namespace disk_cache {
13 13
14 // static 14 // static
15 bool SimpleIndexFile::TraverseCacheDirectory( 15 bool SimpleIndexFile::TraverseCacheDirectory(
16 const base::FilePath& cache_path, 16 const base::FilePath& cache_path,
17 const EntryFileCallback& entry_file_callback) { 17 const EntryFileCallback& entry_file_callback) {
18 const base::FilePath current_directory(FILE_PATH_LITERAL(".")); 18 const base::FilePath current_directory(FILE_PATH_LITERAL("."));
19 const base::FilePath parent_directory(FILE_PATH_LITERAL("..")); 19 const base::FilePath parent_directory(FILE_PATH_LITERAL(".."));
20 const base::FilePath::StringType file_pattern = FILE_PATH_LITERAL("*"); 20 const base::FilePath::StringType file_pattern = FILE_PATH_LITERAL("*");
21 base::FileEnumerator enumerator( 21 base::FileEnumerator enumerator(
22 cache_path, false /* recursive */, base::FileEnumerator::FILES, 22 cache_path, false /* recursive */, base::FileEnumerator::FILES,
23 file_pattern); 23 file_pattern);
24 for (base::FilePath file_path = enumerator.Next(); !file_path.empty(); 24 for (base::FilePath file_path = enumerator.Next(); !file_path.empty();
25 file_path = enumerator.Next()) { 25 file_path = enumerator.Next()) {
26 if (file_path == current_directory || file_path == parent_directory) 26 if (file_path == current_directory || file_path == parent_directory)
27 continue; 27 continue;
28 entry_file_callback.Run(file_path); 28 base::FileEnumerator::FileInfo info = enumerator.GetInfo();
29 entry_file_callback.Run(file_path, base::Time(), info.GetLastModifiedTime(),
30 info.GetSize());
29 } 31 }
30 return true; 32 return true;
31 } 33 }
32 34
33 } // namespace disk_cache 35 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/simple/simple_index_file_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698