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..61bda37c9818525b4a9e05d90260f331cc7d5dfc 100644 |
--- a/storage/browser/blob/blob_data_item.cc |
+++ b/storage/browser/blob/blob_data_item.cc |
@@ -6,12 +6,35 @@ |
namespace storage { |
+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) |
michaeln
2015/06/12 22:35:09
does this break blob.slice()?
|
+ return 0; |
+ return item_->offset(); |
+} |
+ |
BlobDataItem::BlobDataItem(scoped_ptr<DataElement> item, |
scoped_refptr<ShareableFileReference> file_handle) |
- : item_(item.Pass()), file_handle_(file_handle) { |
+ : item_(item.Pass()), |
+ file_handle_(file_handle) { |
} |
+ |
BlobDataItem::BlobDataItem(scoped_ptr<DataElement> item) : item_(item.Pass()) { |
} |
+ |
+BlobDataItem::BlobDataItem(scoped_ptr<DataElement> item, |
+ disk_cache::ScopedEntryPtr disk_cache_entry, |
+ int disk_cache_stream_index) |
+ : item_(item.Pass()), |
+ disk_cache_entry_(disk_cache_entry.Pass()), |
+ disk_cache_stream_index_(disk_cache_stream_index) { |
+} |
+ |
BlobDataItem::~BlobDataItem() { |
} |