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

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

Issue 22927018: Avoid fragmenting the heap too much while reconstructing the index. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "net/disk_cache/simple/simple_index_file.h"
6
7 #include <string>
8
9 #include "base/callback.h"
10 #include "base/files/file_enumerator.h"
11 #include "base/files/file_path.h"
12
13 namespace disk_cache {
14
15 // static
16 bool SimpleIndexFile::TraverseCacheDirectory(
17 const std::string& cache_path,
18 const EntryFileCallback& entry_file_callback) {
19 const int kFileSuffixLength = sizeof("_0") - 1;
20 const base::FilePath::StringType file_pattern = FILE_PATH_LITERAL("*_[0-2]");
21 base::FileEnumerator enumerator(
22 base::FilePath(cache_path), false /* recursive */,
23 base::FileEnumerator::FILES, file_pattern);
24 for (base::FilePath file_path = enumerator.Next(); !file_path.empty();
25 file_path = enumerator.Next()) {
26 entry_file_callback.Run(file_path.value());
27 }
28 return true;
29 }
30
31 } // namespace disk_cache
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698