Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(851)

Unified Diff: webkit/browser/blob/blob_storage_context.cc

Issue 46303005: Fix chrome upload with content uri (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/browser/blob/blob_storage_context.cc
diff --git a/webkit/browser/blob/blob_storage_context.cc b/webkit/browser/blob/blob_storage_context.cc
index f62a26dbe545aed3ab1bd27c1d6a83096670cd7e..eb8c2710982a713288f5d8d1172e5ffcba17c2b0 100644
--- a/webkit/browser/blob/blob_storage_context.cc
+++ b/webkit/browser/blob/blob_storage_context.cc
@@ -174,6 +174,15 @@ void BlobStorageContext::AppendBlobDataItem(
item.length());
break;
}
+#if defined(OS_ANDROID)
+ case BlobData::Item::TYPE_CONTENT_URL:
+ AppendContentUrlItem(target_blob_data,
+ item.content_url(),
+ item.offset(),
+ item.length(),
+ item.expected_modification_time());
+ break;
+#endif
default:
NOTREACHED();
break;
@@ -258,6 +267,14 @@ bool BlobStorageContext::ExpandStorageItems(
iter->offset() + offset,
new_length,
iter->expected_modification_time());
+#if defined(OS_ANDROID)
+ } else if (iter->type() == BlobData::Item::TYPE_CONTENT_URL) {
+ AppendContentUrlItem(target_blob_data,
+ iter->content_url(),
+ iter->offset() + offset,
+ new_length,
+ iter->expected_modification_time());
+#endif
} else {
DCHECK(iter->type() == BlobData::Item::TYPE_FILE_FILESYSTEM);
AppendFileSystemFileItem(target_blob_data,
@@ -307,6 +324,16 @@ void BlobStorageContext::AppendFileSystemFileItem(
expected_modification_time);
}
+#if defined(OS_ANDROID)
+void BlobStorageContext::AppendContentUrlItem(
+ BlobData* target_blob_data,
+ const GURL& content_url, uint64 offset, uint64 length,
+ const base::Time& expected_modification_time) {
+ target_blob_data->AppendContentUrlFile(content_url, offset, length,
+ expected_modification_time);
+}
+#endif
+
bool BlobStorageContext::IsInUse(const std::string& uuid) {
return blob_map_.find(uuid) != blob_map_.end();
}

Powered by Google App Engine
This is Rietveld 408576698