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

Unified Diff: content/child/webblobregistry_impl.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: content/child/webblobregistry_impl.cc
diff --git a/content/child/webblobregistry_impl.cc b/content/child/webblobregistry_impl.cc
index 6d272eec136bdc3f87168a11d86a4babe5c8143f..cd3b76a41bbe50749dc2a366c62865e6cceae841 100644
--- a/content/child/webblobregistry_impl.cc
+++ b/content/child/webblobregistry_impl.cc
@@ -57,11 +57,24 @@ void WebBlobRegistryImpl::registerBlobData(
case WebBlobData::Item::TypeFile:
if (data_item.length) {
webkit_blob::BlobData::Item item;
+#if defined(OS_ANDROID)
+ GURL content_url = GURL(data_item.filePath);
+ if (content_url.SchemeIsContent()) {
+ item.SetToContentUrlRange(
+ content_url,
+ static_cast<uint64>(data_item.offset),
+ static_cast<uint64>(data_item.length),
+ base::Time::FromDoubleT(data_item.expectedModificationTime));
+ } else {
+#endif
item.SetToFilePathRange(
base::FilePath::FromUTF16Unsafe(data_item.filePath),
static_cast<uint64>(data_item.offset),
static_cast<uint64>(data_item.length),
base::Time::FromDoubleT(data_item.expectedModificationTime));
+#if defined(OS_ANDROID)
+ }
+#endif
sender_->Send(
new BlobHostMsg_AppendBlobDataItem(uuid_str, item));
}

Powered by Google App Engine
This is Rietveld 408576698