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

Unified Diff: webkit/child/weburlloader_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: webkit/child/weburlloader_impl.cc
diff --git a/webkit/child/weburlloader_impl.cc b/webkit/child/weburlloader_impl.cc
index 09273f8881b2fe825a330bfc50fbf72138860e49..c05868209b058ff5cf1fc80aebbb69739bbbbcfa 100644
--- a/webkit/child/weburlloader_impl.cc
+++ b/webkit/child/weburlloader_impl.cc
@@ -411,6 +411,25 @@ void WebURLLoaderImpl::Context::Start(
}
break;
case WebHTTPBody::Element::TypeFile:
+#if defined(OS_ANDROID)
+ {
+ GURL content_url = GURL(element.filePath);
+
+ if (content_url.SchemeIsContent()) {
+ if (element.fileLength == -1) {
+ request_body->AppendContentUrlRange(
+ content_url, 0, kuint64max, base::Time());
+ } else {
+ request_body->AppendContentUrlRange(
+ content_url,
+ static_cast<uint64>(element.fileStart),
+ static_cast<uint64>(element.fileLength),
+ base::Time::FromDoubleT(element.modificationTime));
+ }
+ break;
+ }
+ }
+#endif
if (element.fileLength == -1) {
request_body->AppendFileRange(
base::FilePath::FromUTF16Unsafe(element.filePath),

Powered by Google App Engine
This is Rietveld 408576698