| 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/blockfile/entry_impl.h" | 5 #include "net/disk_cache/blockfile/entry_impl.h" |
| 6 | 6 |
| 7 #include "base/hash.h" | 7 #include "base/hash.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.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" |
| (...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 if (doomed_) { | 935 if (doomed_) { |
| 936 DeleteEntryData(true); | 936 DeleteEntryData(true); |
| 937 } else { | 937 } else { |
| 938 #if defined(NET_BUILD_STRESS_CACHE) | 938 #if defined(NET_BUILD_STRESS_CACHE) |
| 939 SanityCheck(); | 939 SanityCheck(); |
| 940 #endif | 940 #endif |
| 941 net_log_.AddEvent(net::NetLog::TYPE_ENTRY_CLOSE); | 941 net_log_.AddEvent(net::NetLog::TYPE_ENTRY_CLOSE); |
| 942 bool ret = true; | 942 bool ret = true; |
| 943 for (int index = 0; index < kNumStreams; index++) { | 943 for (int index = 0; index < kNumStreams; index++) { |
| 944 if (user_buffers_[index].get()) { | 944 if (user_buffers_[index].get()) { |
| 945 if (!(ret = Flush(index, 0))) | 945 ret = Flush(index, 0); |
| 946 if (!ret) |
| 946 LOG(ERROR) << "Failed to save user data"; | 947 LOG(ERROR) << "Failed to save user data"; |
| 947 } | 948 } |
| 948 if (unreported_size_[index]) { | 949 if (unreported_size_[index]) { |
| 949 backend_->ModifyStorageSize( | 950 backend_->ModifyStorageSize( |
| 950 entry_.Data()->data_size[index] - unreported_size_[index], | 951 entry_.Data()->data_size[index] - unreported_size_[index], |
| 951 entry_.Data()->data_size[index]); | 952 entry_.Data()->data_size[index]); |
| 952 } | 953 } |
| 953 } | 954 } |
| 954 | 955 |
| 955 if (!ret) { | 956 if (!ret) { |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1544 Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this), | 1545 Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this), |
| 1545 entry_.address().value(), node_.address().value()); | 1546 entry_.address().value(), node_.address().value()); |
| 1546 | 1547 |
| 1547 Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0], | 1548 Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0], |
| 1548 entry_.Data()->data_addr[1], entry_.Data()->long_key); | 1549 entry_.Data()->data_addr[1], entry_.Data()->long_key); |
| 1549 | 1550 |
| 1550 Trace(" doomed: %d 0x%x", doomed_, dirty); | 1551 Trace(" doomed: %d 0x%x", doomed_, dirty); |
| 1551 } | 1552 } |
| 1552 | 1553 |
| 1553 } // namespace disk_cache | 1554 } // namespace disk_cache |
| OLD | NEW |