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

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

Issue 1223983002: Move WriteInto to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/cert/x509_util_openssl.cc ('k') | net/disk_cache/blockfile/entry_impl_v3.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/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 static_assert(kNumStreams == kKeyFileIndex, "invalid key index"); 778 static_assert(kNumStreams == kKeyFileIndex, "invalid key index");
779 File* key_file = const_cast<EntryImpl*>(this)->GetBackingFile(address, 779 File* key_file = const_cast<EntryImpl*>(this)->GetBackingFile(address,
780 kKeyFileIndex); 780 kKeyFileIndex);
781 if (!key_file) 781 if (!key_file)
782 return std::string(); 782 return std::string();
783 783
784 ++key_len; // We store a trailing \0 on disk that we read back below. 784 ++key_len; // We store a trailing \0 on disk that we read back below.
785 if (!offset && key_file->GetLength() != static_cast<size_t>(key_len)) 785 if (!offset && key_file->GetLength() != static_cast<size_t>(key_len))
786 return std::string(); 786 return std::string();
787 787
788 if (!key_file->Read(WriteInto(&key_, key_len), key_len, offset)) 788 if (!key_file->Read(base::WriteInto(&key_, key_len), key_len, offset))
789 key_.clear(); 789 key_.clear();
790 return key_; 790 return key_;
791 } 791 }
792 792
793 Time EntryImpl::GetLastUsed() const { 793 Time EntryImpl::GetLastUsed() const {
794 CacheRankingsBlock* node = const_cast<CacheRankingsBlock*>(&node_); 794 CacheRankingsBlock* node = const_cast<CacheRankingsBlock*>(&node_);
795 return Time::FromInternalValue(node->Data()->last_used); 795 return Time::FromInternalValue(node->Data()->last_used);
796 } 796 }
797 797
798 Time EntryImpl::GetLastModified() const { 798 Time EntryImpl::GetLastModified() const {
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this), 1544 Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this),
1545 entry_.address().value(), node_.address().value()); 1545 entry_.address().value(), node_.address().value());
1546 1546
1547 Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0], 1547 Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0],
1548 entry_.Data()->data_addr[1], entry_.Data()->long_key); 1548 entry_.Data()->data_addr[1], entry_.Data()->long_key);
1549 1549
1550 Trace(" doomed: %d 0x%x", doomed_, dirty); 1550 Trace(" doomed: %d 0x%x", doomed_, dirty);
1551 } 1551 }
1552 1552
1553 } // namespace disk_cache 1553 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/cert/x509_util_openssl.cc ('k') | net/disk_cache/blockfile/entry_impl_v3.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698