Index: net/url_request/url_request_file_job.cc |
diff --git a/net/url_request/url_request_file_job.cc b/net/url_request/url_request_file_job.cc |
index 7b3b1954c057c0fd5ad1a0009b6c5f3c31657f90..239b9d3621e85545619f3c7534606350ad03fedb 100644 |
--- a/net/url_request/url_request_file_job.cc |
+++ b/net/url_request/url_request_file_job.cc |
@@ -41,6 +41,10 @@ |
#include "net/url_request/url_request_file_dir_job.h" |
#include "url/gurl.h" |
+#if defined(OS_ANDROID) |
+#include "base/android/content_uri_utils.h" |
+#endif |
+ |
#if defined(OS_WIN) |
#include "base/win/shortcut.h" |
#endif |
@@ -213,6 +217,15 @@ void URLRequestFileJob::FetchMetaInfo(const base::FilePath& file_path, |
meta_info->file_size = file_info.size; |
meta_info->is_directory = file_info.is_directory; |
} |
+#if defined(OS_ANDROID) |
+ if (file_path.IsContentUri()) { |
+ if (meta_info->file_exists) { |
+ meta_info->mime_type = base::GetContentUriMimeType(file_path); |
+ meta_info->mime_type_result = !meta_info->mime_type.empty(); |
+ } |
+ return; |
+ } |
+#endif |
// On Windows GetMimeTypeFromFile() goes to the registry. Thus it should be |
// done in WorkerPool. |
meta_info->mime_type_result = GetMimeTypeFromFile(file_path, |