| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/histogram.h" | 8 #include "base/histogram.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/stringprintf.h" |
| 10 #include "base/thread_checker.h" | 11 #include "base/thread_checker.h" |
| 11 #include "base/time.h" | 12 #include "base/time.h" |
| 12 #include "net/disk_cache/cache_util.h" | 13 #include "net/disk_cache/cache_util.h" |
| 13 #include "net/disk_cache/file_lock.h" | 14 #include "net/disk_cache/file_lock.h" |
| 14 #include "net/disk_cache/trace.h" | 15 #include "net/disk_cache/trace.h" |
| 15 | 16 |
| 16 using base::TimeTicks; | 17 using base::TimeTicks; |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 break; | 596 break; |
| 596 index = header->next_file; | 597 index = header->next_file; |
| 597 } | 598 } |
| 598 if (max_blocks) | 599 if (max_blocks) |
| 599 *load = *used_count * 100 / max_blocks; | 600 *load = *used_count * 100 / max_blocks; |
| 600 } | 601 } |
| 601 | 602 |
| 602 FilePath BlockFiles::Name(int index) { | 603 FilePath BlockFiles::Name(int index) { |
| 603 // The file format allows for 256 files. | 604 // The file format allows for 256 files. |
| 604 DCHECK(index < 256 || index >= 0); | 605 DCHECK(index < 256 || index >= 0); |
| 605 std::string tmp = StringPrintf("%s%d", kBlockName, index); | 606 std::string tmp = base::StringPrintf("%s%d", kBlockName, index); |
| 606 return path_.AppendASCII(tmp); | 607 return path_.AppendASCII(tmp); |
| 607 } | 608 } |
| 608 | 609 |
| 609 } // namespace disk_cache | 610 } // namespace disk_cache |
| OLD | NEW |