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

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

Issue 270066: Step 2 in porting disk cache to using FilePath. (Closed)
Patch Set: deprecated Created 11 years, 2 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/block_files_unittest.cc ('k') | net/disk_cache/file.h » ('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) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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/histogram.h" 7 #include "base/histogram.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 else 685 else
686 file = backend_->File(address); 686 file = backend_->File(address);
687 return file; 687 return file;
688 } 688 }
689 689
690 File* EntryImpl::GetExternalFile(Addr address, int index) { 690 File* EntryImpl::GetExternalFile(Addr address, int index) {
691 DCHECK(index >= 0 && index <= kKeyFileIndex); 691 DCHECK(index >= 0 && index <= kKeyFileIndex);
692 if (!files_[index].get()) { 692 if (!files_[index].get()) {
693 // For a key file, use mixed mode IO. 693 // For a key file, use mixed mode IO.
694 scoped_refptr<File> file(new File(kKeyFileIndex == index)); 694 scoped_refptr<File> file(new File(kKeyFileIndex == index));
695 if (file->Init(backend_->GetFileName(address).ToWStringHack())) 695 if (file->Init(backend_->GetFileName(address)))
696 files_[index].swap(file); 696 files_[index].swap(file);
697 } 697 }
698 return files_[index].get(); 698 return files_[index].get();
699 } 699 }
700 700
701 bool EntryImpl::PrepareTarget(int index, int offset, int buf_len, 701 bool EntryImpl::PrepareTarget(int index, int offset, int buf_len,
702 bool truncate) { 702 bool truncate) {
703 Addr address(entry_.Data()->data_addr[index]); 703 Addr address(entry_.Data()->data_addr[index]);
704 704
705 if (address.is_initialized() || user_buffers_[index].get()) 705 if (address.is_initialized() || user_buffers_[index].get())
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this), 918 Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this),
919 entry_.address().value(), node_.address().value()); 919 entry_.address().value(), node_.address().value());
920 920
921 Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0], 921 Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0],
922 entry_.Data()->data_addr[1], entry_.Data()->long_key); 922 entry_.Data()->data_addr[1], entry_.Data()->long_key);
923 923
924 Trace(" doomed: %d 0x%x", doomed_, dirty); 924 Trace(" doomed: %d 0x%x", doomed_, dirty);
925 } 925 }
926 926
927 } // namespace disk_cache 927 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/block_files_unittest.cc ('k') | net/disk_cache/file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698