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

Unified Diff: content/browser/renderer_host/file_utilities_message_filter.cc

Issue 46303005: Fix chrome upload with content uri (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: simplify the change using FILE enum instead of adding a new enum 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/browser/renderer_host/file_utilities_message_filter.cc
diff --git a/content/browser/renderer_host/file_utilities_message_filter.cc b/content/browser/renderer_host/file_utilities_message_filter.cc
index 65645e014eff6e375ed097fab7c90b424a689935..8fe56bae4a2af8d4914df82a47116732f5648ea7 100644
--- a/content/browser/renderer_host/file_utilities_message_filter.cc
+++ b/content/browser/renderer_host/file_utilities_message_filter.cc
@@ -8,6 +8,10 @@
#include "content/browser/child_process_security_policy_impl.h"
#include "content/common/file_utilities_messages.h"
+#if defined(OS_ANDROID)
+#include "net/android/content_uri_utils.h"
+#endif
+
namespace content {
FileUtilitiesMessageFilter::FileUtilitiesMessageFilter(int process_id)
@@ -48,6 +52,17 @@ void FileUtilitiesMessageFilter::OnGetFileInfo(
return;
}
+#if defined(OS_ANDROID)
joth 2013/10/31 06:42:39 whats the reason to do this here, and not inside f
qinmin 2013/11/05 01:41:31 Done.
+ if (path.IsContentUrl()) {
+ // TODO(qinmin): Move the logic to content_uri_utils.h and find a way
+ // to extract information other than size.
joth 2013/10/31 06:42:39 nit: populate PlatformFileInfo fields other than s
qinmin 2013/11/05 01:41:31 Done.
+ int64 size = net::GetContentUrlLengthSync(path);
+ if (size < 0)
+ *status = base::PLATFORM_FILE_ERROR_FAILED;
+ result->size = size;
+ return;
+ }
+#endif
if (!file_util::GetFileInfo(path, result))
*status = base::PLATFORM_FILE_ERROR_FAILED;
}

Powered by Google App Engine
This is Rietveld 408576698