| Index: webkit/blob/blob_storage_controller.cc
|
| diff --git a/webkit/blob/blob_storage_controller.cc b/webkit/blob/blob_storage_controller.cc
|
| index 79508fc4b39c693edaf6e49f7a21b90db2276f0c..7e5a8607f6a9cd52c7867152bb12ad8413e6548d 100644
|
| --- a/webkit/blob/blob_storage_controller.cc
|
| +++ b/webkit/blob/blob_storage_controller.cc
|
| @@ -65,6 +65,8 @@ void BlobStorageController::AppendBlobDataItem(
|
| // 1) The Data item is denoted by the raw data and the range.
|
| // 2) The File item is denoted by the file path, the range and the expected
|
| // modification time.
|
| + // 3) The FileSystem File item is denoted by the FileSystem URL, the range
|
| + // and the expected modification time.
|
| // All the Blob items in the passing blob data are resolved and expanded into
|
| // a set of Data and File items.
|
|
|
| @@ -86,8 +88,8 @@ void BlobStorageController::AppendBlobDataItem(
|
| item.length,
|
| item.expected_modification_time);
|
| break;
|
| - case BlobData::TYPE_BLOB:
|
| - BlobData* src_blob_data = GetBlobDataFromUrl(item.blob_url);
|
| + case BlobData::TYPE_BLOB: {
|
| + BlobData* src_blob_data = GetBlobDataFromUrl(item.url);
|
| DCHECK(src_blob_data);
|
| if (src_blob_data)
|
| AppendStorageItems(target_blob_data,
|
| @@ -95,6 +97,14 @@ void BlobStorageController::AppendBlobDataItem(
|
| item.offset,
|
| item.length);
|
| break;
|
| + }
|
| + case BlobData::TYPE_FILE_FILESYSTEM:
|
| + AppendFileSystemFileItem(target_blob_data,
|
| + item.url,
|
| + item.offset,
|
| + item.length,
|
| + item.expected_modification_time);
|
| + break;
|
| }
|
|
|
| memory_usage_ += target_blob_data->GetMemoryUsage();
|
| @@ -183,7 +193,7 @@ void BlobStorageController::ResolveBlobReferencesInUploadData(
|
| }
|
|
|
| // Find the referred blob data.
|
| - BlobData* blob_data = GetBlobDataFromUrl(iter->blob_url());
|
| + BlobData* blob_data = GetBlobDataFromUrl(iter->url());
|
| DCHECK(blob_data);
|
| if (!blob_data) {
|
| // TODO(jianli): We should probably fail uploading the data
|
| @@ -228,6 +238,13 @@ void BlobStorageController::ResolveBlobReferencesInUploadData(
|
| item.length,
|
| item.expected_modification_time);
|
| break;
|
| + case BlobData::TYPE_FILE_FILESYSTEM:
|
| + iter->SetToFileSystemURLRange(
|
| + item.url,
|
| + item.offset,
|
| + item.length,
|
| + item.expected_modification_time);
|
| + break;
|
| default:
|
| NOTREACHED();
|
| break;
|
| @@ -287,6 +304,14 @@ void BlobStorageController::AppendFileItem(
|
| target_blob_data->AttachShareableFileReference(shareable_file);
|
| }
|
|
|
| +void BlobStorageController::AppendFileSystemFileItem(
|
| + BlobData* target_blob_data,
|
| + const GURL& url, uint64 offset, uint64 length,
|
| + const base::Time& expected_modification_time) {
|
| + target_blob_data->AppendFileSystemFile(url, offset, length,
|
| + expected_modification_time);
|
| +}
|
| +
|
| void BlobStorageController::IncrementBlobDataUsage(BlobData* blob_data) {
|
| blob_data_usage_count_[blob_data] += 1;
|
| }
|
|
|