OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "storage/browser/blob/blob_data_builder.h" | 5 #include "storage/browser/blob/blob_data_builder.h" |
6 | 6 |
7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
8 #include "storage/browser/blob/shareable_file_reference.h" | 8 #include "storage/browser/blob/shareable_file_reference.h" |
9 | 9 |
10 namespace storage { | 10 namespace storage { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 uint64_t offset, | 53 uint64_t offset, |
54 uint64_t length, | 54 uint64_t length, |
55 const base::Time& expected_modification_time) { | 55 const base::Time& expected_modification_time) { |
56 DCHECK(length > 0); | 56 DCHECK(length > 0); |
57 scoped_ptr<DataElement> element(new DataElement()); | 57 scoped_ptr<DataElement> element(new DataElement()); |
58 element->SetToFileSystemUrlRange(url, offset, length, | 58 element->SetToFileSystemUrlRange(url, offset, length, |
59 expected_modification_time); | 59 expected_modification_time); |
60 items_.push_back(new BlobDataItem(element.Pass())); | 60 items_.push_back(new BlobDataItem(element.Pass())); |
61 } | 61 } |
62 | 62 |
| 63 void BlobDataBuilder::AppendDiskCacheEntry( |
| 64 const scoped_refptr<DataHandle>& data_handle, |
| 65 disk_cache::Entry* disk_cache_entry, |
| 66 int disk_cache_stream_index) { |
| 67 scoped_ptr<DataElement> element(new DataElement()); |
| 68 element->SetToDiskCacheEntryRange( |
| 69 0U, disk_cache_entry->GetDataSize(disk_cache_stream_index)); |
| 70 items_.push_back( |
| 71 new BlobDataItem(element.Pass(), data_handle, disk_cache_entry, |
| 72 disk_cache_stream_index)); |
| 73 } |
| 74 |
63 } // namespace storage | 75 } // namespace storage |
OLD | NEW |