| Index: storage/browser/blob/blob_data_item.cc
|
| diff --git a/storage/browser/blob/blob_data_item.cc b/storage/browser/blob/blob_data_item.cc
|
| index 504a1c3e8be39939d58c0ac19702f7c6d3e2ac89..22ed7bb7dfcc885584f86b0e583a3077d81405c0 100644
|
| --- a/storage/browser/blob/blob_data_item.cc
|
| +++ b/storage/browser/blob/blob_data_item.cc
|
| @@ -6,12 +6,38 @@
|
|
|
| namespace storage {
|
|
|
| -BlobDataItem::BlobDataItem(scoped_ptr<DataElement> item,
|
| - scoped_refptr<ShareableFileReference> file_handle)
|
| - : item_(item.Pass()), file_handle_(file_handle) {
|
| +uint64 BlobDataItem::GetLength() const {
|
| + if (type() == DataElement::TYPE_DISK_CACHE_ENTRY)
|
| + return disk_cache_entry_->GetDataSize(disk_cache_stream_index_);
|
| + return item_->length();
|
| +}
|
| +
|
| +uint64 BlobDataItem::GetOffset() const {
|
| + if (type() == DataElement::TYPE_DISK_CACHE_ENTRY)
|
| + return 0;
|
| + return item_->offset();
|
| }
|
| +
|
| BlobDataItem::BlobDataItem(scoped_ptr<DataElement> item) : item_(item.Pass()) {
|
| }
|
| +
|
| +BlobDataItem::BlobDataItem(
|
| + scoped_ptr<DataElement> item,
|
| + const scoped_refptr<ShareableFileReference>& file_handle)
|
| + : item_(item.Pass()),
|
| + file_handle_(file_handle) {
|
| +}
|
| +
|
| +BlobDataItem::BlobDataItem(scoped_ptr<DataElement> item,
|
| + scoped_ptr<ExtraData> extra_data,
|
| + disk_cache::ScopedEntryPtr disk_cache_entry,
|
| + int disk_cache_stream_index)
|
| + : item_(item.Pass()),
|
| + extra_data_(extra_data.Pass()),
|
| + disk_cache_entry_(disk_cache_entry.Pass()),
|
| + disk_cache_stream_index_(disk_cache_stream_index) {
|
| +}
|
| +
|
| BlobDataItem::~BlobDataItem() {
|
| }
|
|
|
|
|