Chromium Code Reviews| Index: chrome/browser/extensions/api/file_system/file_system_api.cc |
| diff --git a/chrome/browser/extensions/api/file_system/file_system_api.cc b/chrome/browser/extensions/api/file_system/file_system_api.cc |
| index 966ec6635852503db2694689f1fab495b39c56f9..da71319374c953b1198b19ee3ad7182c3f596be8 100644 |
| --- a/chrome/browser/extensions/api/file_system/file_system_api.cc |
| +++ b/chrome/browser/extensions/api/file_system/file_system_api.cc |
| @@ -23,6 +23,7 @@ |
| #include "base/strings/stringprintf.h" |
| #include "base/strings/sys_string_conversions.h" |
| #include "base/strings/utf_string_conversions.h" |
| +#include "base/task_scheduler/post_task.h" |
| #include "base/value_conversions.h" |
| #include "base/values.h" |
| #include "build/build_config.h" |
| @@ -591,11 +592,10 @@ bool FileSystemGetWritableEntryFunction::RunAsync() { |
| render_frame_host()->GetProcess()->GetID(), &path_, &error_)) |
| return false; |
| - content::BrowserThread::PostTaskAndReply( |
| - content::BrowserThread::FILE, FROM_HERE, |
| - base::BindOnce( |
| - &FileSystemGetWritableEntryFunction::SetIsDirectoryOnFileThread, |
| - this), |
| + base::PostTaskWithTraitsAndReply( |
| + FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, |
| + base::BindOnce(&FileSystemGetWritableEntryFunction::SetIsDirectoryAsync, |
| + this), |
| base::BindOnce( |
| &FileSystemGetWritableEntryFunction::CheckPermissionAndSendResponse, |
| this)); |
| @@ -615,8 +615,7 @@ void FileSystemGetWritableEntryFunction::CheckPermissionAndSendResponse() { |
| PrepareFilesForWritableApp(paths); |
| } |
| -void FileSystemGetWritableEntryFunction::SetIsDirectoryOnFileThread() { |
| - DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); |
| +void FileSystemGetWritableEntryFunction::SetIsDirectoryAsync() { |
| if (base::DirectoryExists(path_)) { |
| is_directory_ = true; |
| } |
| @@ -878,8 +877,8 @@ void FileSystemChooseEntryFunction::FilesSelected( |
| file_manager::util::IsUnderNonNativeLocalPath(GetProfile(), paths[0]); |
| #endif |
| - content::BrowserThread::PostTask( |
| - content::BrowserThread::FILE, FROM_HERE, |
| + base::PostTaskWithTraits( |
| + FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, |
| base::BindOnce( |
| &FileSystemChooseEntryFunction::ConfirmDirectoryAccessOnFileThread, |
|
benwells
2017/05/17 01:03:52
Could you rename ConfirmDirectoryAccessOnFileThrea
Sébastien Marchand
2017/05/17 18:43:00
Done.
|
| this, non_native_path, paths, web_contents)); |
| @@ -1114,8 +1113,8 @@ bool FileSystemChooseEntryFunction::RunAsync() { |
| return true; |
| } |
| #endif |
| - content::BrowserThread::PostTaskAndReplyWithResult( |
| - content::BrowserThread::FILE, FROM_HERE, |
| + base::PostTaskWithTraitsAndReplyWithResult( |
| + FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, |
| base::Bind(&base::DirectoryExists, previous_path), |
| set_initial_path_callback); |