Chromium Code Reviews| Index: components/arc/test/fake_file_system_instance.cc |
| diff --git a/components/arc/test/fake_file_system_instance.cc b/components/arc/test/fake_file_system_instance.cc |
| index f522024e2c1f847d018479fc0045790146709617..72a31f9297e739dfeb7925c6ad784617252972e8 100644 |
| --- a/components/arc/test/fake_file_system_instance.cc |
| +++ b/components/arc/test/fake_file_system_instance.cc |
| @@ -64,8 +64,9 @@ FakeFileSystemInstance::File::File(const File& that) = default; |
| FakeFileSystemInstance::File::File(const std::string& url, |
| const std::string& content, |
| + const std::string& mime_type, |
| Seekable seekable) |
| - : url(url), content(content), seekable(seekable) {} |
| + : url(url), content(content), mime_type(mime_type), seekable(seekable) {} |
| FakeFileSystemInstance::File::~File() = default; |
| @@ -170,6 +171,20 @@ void FakeFileSystemInstance::GetFileSize(const std::string& url, |
| FROM_HERE, base::Bind(callback, file.content.size())); |
| } |
| +void FakeFileSystemInstance::GetMimeType(const std::string& url, |
| + const GetMimeTypeCallback& callback) { |
| + DCHECK(thread_checker_.CalledOnValidThread()); |
| + auto iter = files_.find(url); |
| + if (iter == files_.end()) { |
| + base::ThreadTaskRunnerHandle::Get()->PostTask( |
|
mtomasz
2017/06/05 04:29:55
nit: ditto here and below. @tzik has been refactor
hashimoto
2017/06/05 04:55:37
Done.
|
| + FROM_HERE, base::Bind(callback, base::nullopt)); |
| + return; |
| + } |
| + const File& file = iter->second; |
| + base::ThreadTaskRunnerHandle::Get()->PostTask( |
| + FROM_HERE, base::Bind(callback, file.mime_type)); |
| +} |
| + |
| void FakeFileSystemInstance::OpenFileToRead( |
| const std::string& url, |
| const OpenFileToReadCallback& callback) { |