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 <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/hash.h" | 9 #include "base/hash.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 case kWriteAsync1: | 728 case kWriteAsync1: |
729 CACHE_UMA(AGE_MS, "AsyncWriteDispatchTime", 0, start); | 729 CACHE_UMA(AGE_MS, "AsyncWriteDispatchTime", 0, start); |
730 break; | 730 break; |
731 default: | 731 default: |
732 NOTREACHED(); | 732 NOTREACHED(); |
733 } | 733 } |
734 } | 734 } |
735 | 735 |
736 void EntryImpl::BeginLogging(net::NetLog* net_log, bool created) { | 736 void EntryImpl::BeginLogging(net::NetLog* net_log, bool created) { |
737 DCHECK(!net_log_.net_log()); | 737 DCHECK(!net_log_.net_log()); |
738 net_log_ = | 738 net_log_ = net::NetLogWithSource::Make( |
739 net::BoundNetLog::Make(net_log, net::NetLogSourceType::DISK_CACHE_ENTRY); | 739 net_log, net::NetLogSourceType::DISK_CACHE_ENTRY); |
740 net_log_.BeginEvent(net::NetLogEventType::DISK_CACHE_ENTRY_IMPL, | 740 net_log_.BeginEvent(net::NetLogEventType::DISK_CACHE_ENTRY_IMPL, |
741 CreateNetLogEntryCreationCallback(this, created)); | 741 CreateNetLogEntryCreationCallback(this, created)); |
742 } | 742 } |
743 | 743 |
744 const net::BoundNetLog& EntryImpl::net_log() const { | 744 const net::NetLogWithSource& EntryImpl::net_log() const { |
745 return net_log_; | 745 return net_log_; |
746 } | 746 } |
747 | 747 |
748 // static | 748 // static |
749 int EntryImpl::NumBlocksForEntry(int key_size) { | 749 int EntryImpl::NumBlocksForEntry(int key_size) { |
750 // The longest key that can be stored using one block. | 750 // The longest key that can be stored using one block. |
751 int key1_len = | 751 int key1_len = |
752 static_cast<int>(sizeof(EntryStore) - offsetof(EntryStore, key)); | 752 static_cast<int>(sizeof(EntryStore) - offsetof(EntryStore, key)); |
753 | 753 |
754 if (key_size < key1_len || key_size > kMaxInternalKeyLength) | 754 if (key_size < key1_len || key_size > kMaxInternalKeyLength) |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1561 Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this), | 1561 Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this), |
1562 entry_.address().value(), node_.address().value()); | 1562 entry_.address().value(), node_.address().value()); |
1563 | 1563 |
1564 Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0], | 1564 Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0], |
1565 entry_.Data()->data_addr[1], entry_.Data()->long_key); | 1565 entry_.Data()->data_addr[1], entry_.Data()->long_key); |
1566 | 1566 |
1567 Trace(" doomed: %d 0x%x", doomed_, dirty); | 1567 Trace(" doomed: %d 0x%x", doomed_, dirty); |
1568 } | 1568 } |
1569 | 1569 |
1570 } // namespace disk_cache | 1570 } // namespace disk_cache |
OLD | NEW |