OLD | NEW |
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/block_files.h" | 5 #include "net/disk_cache/block_files.h" |
6 | 6 |
7 #include "base/atomicops.h" | 7 #include "base/atomicops.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
12 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
13 #include "base/time.h" | 13 #include "base/time/time.h" |
14 #include "net/disk_cache/cache_util.h" | 14 #include "net/disk_cache/cache_util.h" |
15 #include "net/disk_cache/file_lock.h" | 15 #include "net/disk_cache/file_lock.h" |
16 #include "net/disk_cache/trace.h" | 16 #include "net/disk_cache/trace.h" |
17 | 17 |
18 using base::TimeTicks; | 18 using base::TimeTicks; |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 const char* kBlockName = "data_"; | 22 const char* kBlockName = "data_"; |
23 | 23 |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 } | 686 } |
687 | 687 |
688 base::FilePath BlockFiles::Name(int index) { | 688 base::FilePath BlockFiles::Name(int index) { |
689 // The file format allows for 256 files. | 689 // The file format allows for 256 files. |
690 DCHECK(index < 256 || index >= 0); | 690 DCHECK(index < 256 || index >= 0); |
691 std::string tmp = base::StringPrintf("%s%d", kBlockName, index); | 691 std::string tmp = base::StringPrintf("%s%d", kBlockName, index); |
692 return path_.AppendASCII(tmp); | 692 return path_.AppendASCII(tmp); |
693 } | 693 } |
694 | 694 |
695 } // namespace disk_cache | 695 } // namespace disk_cache |
OLD | NEW |