Index: chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc |
diff --git a/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc b/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc |
index 77bcfeb059b48412225f16d1ec23118b0943a431..b1de0ee18e1091e475108b0c9237fcc81712f098 100644 |
--- a/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc |
+++ b/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc |
@@ -104,6 +104,26 @@ void ArcFileSystemOperationRunner::GetFileSize( |
file_system_instance->GetFileSize(url.spec(), callback); |
} |
+void ArcFileSystemOperationRunner::GetMimeType( |
+ const GURL& url, |
+ const GetMimeTypeCallback& callback) { |
+ DCHECK_CURRENTLY_ON(BrowserThread::UI); |
+ if (should_defer_) { |
+ deferred_operations_.emplace_back( |
+ base::Bind(&ArcFileSystemOperationRunner::GetMimeType, |
+ weak_ptr_factory_.GetWeakPtr(), url, callback)); |
+ return; |
+ } |
+ auto* file_system_instance = ARC_GET_INSTANCE_FOR_METHOD( |
+ arc_bridge_service()->file_system(), GetMimeType); |
+ if (!file_system_instance) { |
+ base::ThreadTaskRunnerHandle::Get()->PostTask( |
+ FROM_HERE, base::BindOnce(callback, base::nullopt)); |
+ return; |
+ } |
+ file_system_instance->GetMimeType(url.spec(), callback); |
+} |
+ |
void ArcFileSystemOperationRunner::OpenFileToRead( |
const GURL& url, |
const OpenFileToReadCallback& callback) { |