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/entry_impl.h" | 5 #include "net/disk_cache/entry_impl.h" |
6 | 6 |
7 #include "base/hash.h" | 7 #include "base/hash.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1196 DCHECK(backend_); | 1196 DCHECK(backend_); |
1197 if (!address.is_initialized()) | 1197 if (!address.is_initialized()) |
1198 return; | 1198 return; |
1199 if (address.is_separate_file()) { | 1199 if (address.is_separate_file()) { |
1200 int failure = !DeleteCacheFile(backend_->GetFileName(address)); | 1200 int failure = !DeleteCacheFile(backend_->GetFileName(address)); |
1201 CACHE_UMA(COUNTS, "DeleteFailed", 0, failure); | 1201 CACHE_UMA(COUNTS, "DeleteFailed", 0, failure); |
1202 if (failure) { | 1202 if (failure) { |
1203 LOG(ERROR) << "Failed to delete " << | 1203 LOG(ERROR) << "Failed to delete " << |
1204 backend_->GetFileName(address).value() << " from the cache."; | 1204 backend_->GetFileName(address).value() << " from the cache."; |
1205 } | 1205 } |
1206 if (files_[index]) | 1206 if (files_[index].get()) |
1207 files_[index] = NULL; // Releases the object. | 1207 files_[index] = NULL; // Releases the object. |
1208 } else { | 1208 } else { |
1209 backend_->DeleteBlock(address, true); | 1209 backend_->DeleteBlock(address, true); |
1210 } | 1210 } |
1211 } | 1211 } |
1212 | 1212 |
1213 void EntryImpl::UpdateRank(bool modified) { | 1213 void EntryImpl::UpdateRank(bool modified) { |
1214 if (!backend_) | 1214 if (!backend_) |
1215 return; | 1215 return; |
1216 | 1216 |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1537 Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this), | 1537 Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this), |
1538 entry_.address().value(), node_.address().value()); | 1538 entry_.address().value(), node_.address().value()); |
1539 | 1539 |
1540 Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0], | 1540 Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0], |
1541 entry_.Data()->data_addr[1], entry_.Data()->long_key); | 1541 entry_.Data()->data_addr[1], entry_.Data()->long_key); |
1542 | 1542 |
1543 Trace(" doomed: %d 0x%x", doomed_, dirty); | 1543 Trace(" doomed: %d 0x%x", doomed_, dirty); |
1544 } | 1544 } |
1545 | 1545 |
1546 } // namespace disk_cache | 1546 } // namespace disk_cache |
OLD | NEW |