Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(723)

Side by Side Diff: net/disk_cache/blockfile/entry_impl.cc

Issue 1841863002: Update monet. (Closed) Base URL: https://github.com/domokit/monet.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/disk_cache/backend_unittest.cc ('k') | net/disk_cache/blockfile/index_table_v3_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 static_assert(kNumStreams == kKeyFileIndex, "invalid key index"); 779 static_assert(kNumStreams == kKeyFileIndex, "invalid key index");
780 File* key_file = const_cast<EntryImpl*>(this)->GetBackingFile(address, 780 File* key_file = const_cast<EntryImpl*>(this)->GetBackingFile(address,
781 kKeyFileIndex); 781 kKeyFileIndex);
782 if (!key_file) 782 if (!key_file)
783 return std::string(); 783 return std::string();
784 784
785 ++key_len; // We store a trailing \0 on disk that we read back below. 785 ++key_len; // We store a trailing \0 on disk that we read back below.
786 if (!offset && key_file->GetLength() != static_cast<size_t>(key_len)) 786 if (!offset && key_file->GetLength() != static_cast<size_t>(key_len))
787 return std::string(); 787 return std::string();
788 788
789 if (!key_file->Read(WriteInto(&key_, key_len), key_len, offset)) 789 if (!key_file->Read(base::WriteInto(&key_, key_len), key_len, offset))
790 key_.clear(); 790 key_.clear();
791 return key_; 791 return key_;
792 } 792 }
793 793
794 Time EntryImpl::GetLastUsed() const { 794 Time EntryImpl::GetLastUsed() const {
795 CacheRankingsBlock* node = const_cast<CacheRankingsBlock*>(&node_); 795 CacheRankingsBlock* node = const_cast<CacheRankingsBlock*>(&node_);
796 return Time::FromInternalValue(node->Data()->last_used); 796 return Time::FromInternalValue(node->Data()->last_used);
797 } 797 }
798 798
799 Time EntryImpl::GetLastModified() const { 799 Time EntryImpl::GetLastModified() const {
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
1545 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),
1546 entry_.address().value(), node_.address().value()); 1546 entry_.address().value(), node_.address().value());
1547 1547
1548 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],
1549 entry_.Data()->data_addr[1], entry_.Data()->long_key); 1549 entry_.Data()->data_addr[1], entry_.Data()->long_key);
1550 1550
1551 Trace(" doomed: %d 0x%x", doomed_, dirty); 1551 Trace(" doomed: %d 0x%x", doomed_, dirty);
1552 } 1552 }
1553 1553
1554 } // namespace disk_cache 1554 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/backend_unittest.cc ('k') | net/disk_cache/blockfile/index_table_v3_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698