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..231215743a75f831d764e04565a1951c76b02bb7 100644 |
--- a/chrome/browser/extensions/api/file_system/file_system_api.cc |
+++ b/chrome/browser/extensions/api/file_system/file_system_api.cc |
@@ -506,6 +506,8 @@ ExtensionFunction::ResponseAction FileSystemGetDisplayPathFunction::Run() { |
FileSystemEntryFunction::FileSystemEntryFunction() |
: multiple_(false), is_directory_(false) {} |
+FileSystemEntryFunction::~FileSystemEntryFunction() {} |
+ |
void FileSystemEntryFunction::PrepareFilesForWritableApp( |
const std::vector<base::FilePath>& paths) { |
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
@@ -591,8 +593,8 @@ bool FileSystemGetWritableEntryFunction::RunAsync() { |
render_frame_host()->GetProcess()->GetID(), &path_, &error_)) |
return false; |
- content::BrowserThread::PostTaskAndReply( |
- content::BrowserThread::FILE, FROM_HERE, |
+ task_runner_->PostTaskAndReply( |
fdoray
2017/05/16 15:23:26
Unless RunAsync() is invoked multiple times on the
Sébastien Marchand
2017/05/16 15:53:09
SGTM, I'll check with the owner to make sure that
|
+ FROM_HERE, |
base::BindOnce( |
&FileSystemGetWritableEntryFunction::SetIsDirectoryOnFileThread, |
fdoray
2017/05/16 15:23:26
s/OnFileThread/Async/
Sébastien Marchand
2017/05/16 15:53:09
Done.
|
this), |
@@ -616,7 +618,7 @@ void FileSystemGetWritableEntryFunction::CheckPermissionAndSendResponse() { |
} |
void FileSystemGetWritableEntryFunction::SetIsDirectoryOnFileThread() { |
- DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); |
+ DCHECK(task_runner_->RunsTasksInCurrentSequence()); |
if (base::DirectoryExists(path_)) { |
is_directory_ = true; |
} |
@@ -878,8 +880,8 @@ void FileSystemChooseEntryFunction::FilesSelected( |
file_manager::util::IsUnderNonNativeLocalPath(GetProfile(), paths[0]); |
#endif |
- content::BrowserThread::PostTask( |
- content::BrowserThread::FILE, FROM_HERE, |
+ task_runner_->PostTask( |
fdoray
2017/05/16 15:23:26
ditto (a sequence may not be required)
Sébastien Marchand
2017/05/16 15:53:09
Done.
|
+ FROM_HERE, |
base::BindOnce( |
&FileSystemChooseEntryFunction::ConfirmDirectoryAccessOnFileThread, |
this, non_native_path, paths, web_contents)); |
@@ -1114,8 +1116,8 @@ bool FileSystemChooseEntryFunction::RunAsync() { |
return true; |
} |
#endif |
- content::BrowserThread::PostTaskAndReplyWithResult( |
- content::BrowserThread::FILE, FROM_HERE, |
+ base::PostTaskAndReplyWithResult( |
+ task_runner_.get(), FROM_HERE, |
base::Bind(&base::DirectoryExists, previous_path), |
set_initial_path_callback); |