| Index: chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util.cc
|
| diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util.cc b/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util.cc
|
| index f733a1cdd844cb4de52b1a1c0ee714da3356d8c2..a3f0ce62af96ede7dc541876898814c9c71baf67 100644
|
| --- a/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util.cc
|
| +++ b/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util.cc
|
| @@ -83,6 +83,30 @@ void OnReadDirectory(
|
| base::Bind(callback, result, entry_list, has_more));
|
| }
|
|
|
| +// Executes CreateDirectory on the UI thread.
|
| +void CreateDirectoryOnUIThread(
|
| + scoped_ptr<fileapi::FileSystemOperationContext> context,
|
| + const fileapi::FileSystemURL& url,
|
| + bool exclusive,
|
| + bool recursive,
|
| + const fileapi::AsyncFileUtil::StatusCallback& callback) {
|
| + util::FileSystemURLParser parser(url);
|
| + if (!parser.Parse()) {
|
| + callback.Run(base::File::FILE_ERROR_INVALID_OPERATION);
|
| + return;
|
| + }
|
| +
|
| + parser.file_system()->CreateDirectory(
|
| + parser.file_path(), exclusive, recursive, callback);
|
| +}
|
| +
|
| +// Routes the response of CreateDirectory back to the IO thread.
|
| +void OnCreateDirectory(const fileapi::AsyncFileUtil::StatusCallback& callback,
|
| + base::File::Error result) {
|
| + BrowserThread::PostTask(
|
| + BrowserThread::IO, FROM_HERE, base::Bind(callback, result));
|
| +}
|
| +
|
| } // namespace
|
|
|
| ProviderAsyncFileUtil::ProviderAsyncFileUtil() {}
|
| @@ -124,7 +148,14 @@ void ProviderAsyncFileUtil::CreateDirectory(
|
| bool recursive,
|
| const StatusCallback& callback) {
|
| DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
| - callback.Run(base::File::FILE_ERROR_ACCESS_DENIED);
|
| + BrowserThread::PostTask(BrowserThread::UI,
|
| + FROM_HERE,
|
| + base::Bind(&CreateDirectoryOnUIThread,
|
| + base::Passed(&context),
|
| + url,
|
| + exclusive,
|
| + recursive,
|
| + base::Bind(&OnCreateDirectory, callback)));
|
| }
|
|
|
| void ProviderAsyncFileUtil::GetFileInfo(
|
|
|