OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/mapped_file.h" | 5 #include "net/disk_cache/v2/mapped_file.h" |
6 | 6 |
7 namespace disk_cache { | 7 namespace disk_cache { |
8 | 8 |
9 // Note: Most of this class is implemented in platform-specific files. | 9 // Note: Most of this class is implemented in platform-specific files. |
10 | 10 |
11 bool MappedFile::Load(const FileBlock* block) { | 11 bool MappedFile::Load(const FileBlock* block) { |
12 size_t offset = block->offset() + view_size_; | 12 size_t offset = block->offset() + view_size_; |
13 return Read(block->buffer(), block->size(), offset); | 13 return Read(block->buffer(), block->size(), offset); |
14 } | 14 } |
15 | 15 |
(...skipping 10 matching lines...) Expand all Loading... |
26 } | 26 } |
27 | 27 |
28 bool MappedFile::Store(const FileBlock* block, | 28 bool MappedFile::Store(const FileBlock* block, |
29 FileIOCallback* callback, | 29 FileIOCallback* callback, |
30 bool* completed) { | 30 bool* completed) { |
31 size_t offset = block->offset() + view_size_; | 31 size_t offset = block->offset() + view_size_; |
32 return Write(block->buffer(), block->size(), offset, callback, completed); | 32 return Write(block->buffer(), block->size(), offset, callback, completed); |
33 } | 33 } |
34 | 34 |
35 } // namespace disk_cache | 35 } // namespace disk_cache |
OLD | NEW |