OLD | NEW |
1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/backend_impl.h" | 5 #include "net/disk_cache/backend_impl.h" |
6 | 6 |
7 #include "base/field_trial.h" | 7 #include "base/field_trial.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/histogram.h" | 10 #include "base/histogram.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 class CleanupTask : public Task { | 77 class CleanupTask : public Task { |
78 public: | 78 public: |
79 CleanupTask(const FilePath& path, const std::string& name) | 79 CleanupTask(const FilePath& path, const std::string& name) |
80 : path_(path), name_(name) {} | 80 : path_(path), name_(name) {} |
81 | 81 |
82 virtual void Run(); | 82 virtual void Run(); |
83 | 83 |
84 private: | 84 private: |
85 FilePath path_; | 85 FilePath path_; |
86 std::string name_; | 86 std::string name_; |
87 DISALLOW_EVIL_CONSTRUCTORS(CleanupTask); | 87 DISALLOW_COPY_AND_ASSIGN(CleanupTask); |
88 }; | 88 }; |
89 | 89 |
90 void CleanupTask::Run() { | 90 void CleanupTask::Run() { |
91 for (int i = 0; i < kMaxOldFolders; i++) { | 91 for (int i = 0; i < kMaxOldFolders; i++) { |
92 FilePath to_delete = GetPrefixedName(path_, name_, i); | 92 FilePath to_delete = GetPrefixedName(path_, name_, i); |
93 disk_cache::DeleteCache(to_delete, true); | 93 disk_cache::DeleteCache(to_delete, true); |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 // Returns a full path to rename the current cache, in order to delete it. path | 97 // Returns a full path to rename the current cache, in order to delete it. path |
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1699 | 1699 |
1700 return num_dirty; | 1700 return num_dirty; |
1701 } | 1701 } |
1702 | 1702 |
1703 bool BackendImpl::CheckEntry(EntryImpl* cache_entry) { | 1703 bool BackendImpl::CheckEntry(EntryImpl* cache_entry) { |
1704 RankingsNode* rankings = cache_entry->rankings()->Data(); | 1704 RankingsNode* rankings = cache_entry->rankings()->Data(); |
1705 return !rankings->dummy; | 1705 return !rankings->dummy; |
1706 } | 1706 } |
1707 | 1707 |
1708 } // namespace disk_cache | 1708 } // namespace disk_cache |
OLD | NEW |