| 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 0c886c93bacd230da1466d47ce1b256959f55828..bb9b43139b532bb3cc310ef4a84ada7b5b3c4d05 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
|
| @@ -97,14 +97,22 @@ void CreateDirectoryOnUIThread(
|
| }
|
|
|
| parser.file_system()->CreateDirectory(
|
| - parser.file_path(), exclusive, recursive, callback);
|
| + parser.file_path(), recursive, callback);
|
| }
|
|
|
| // Routes the response of CreateDirectory back to the IO thread.
|
| -void OnCreateDirectory(const storage::AsyncFileUtil::StatusCallback& callback,
|
| +void OnCreateDirectory(bool exclusive,
|
| + const storage::AsyncFileUtil::StatusCallback& callback,
|
| base::File::Error result) {
|
| + // If the directory already existed and the operation wasn't exclusive, then
|
| + // return success anyway, since it is not an error.
|
| + const base::File::Error error =
|
| + (result == base::File::FILE_ERROR_EXISTS && !exclusive)
|
| + ? base::File::FILE_OK
|
| + : result;
|
| +
|
| BrowserThread::PostTask(
|
| - BrowserThread::IO, FROM_HERE, base::Bind(callback, result));
|
| + BrowserThread::IO, FROM_HERE, base::Bind(callback, error));
|
| }
|
|
|
| // Executes DeleteEntry on the UI thread.
|
| @@ -282,14 +290,15 @@ void ProviderAsyncFileUtil::CreateDirectory(
|
| bool recursive,
|
| const StatusCallback& callback) {
|
| DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
| - BrowserThread::PostTask(BrowserThread::UI,
|
| - FROM_HERE,
|
| - base::Bind(&CreateDirectoryOnUIThread,
|
| - base::Passed(&context),
|
| - url,
|
| - exclusive,
|
| - recursive,
|
| - base::Bind(&OnCreateDirectory, callback)));
|
| + BrowserThread::PostTask(
|
| + BrowserThread::UI,
|
| + FROM_HERE,
|
| + base::Bind(&CreateDirectoryOnUIThread,
|
| + base::Passed(&context),
|
| + url,
|
| + exclusive,
|
| + recursive,
|
| + base::Bind(&OnCreateDirectory, exclusive, callback)));
|
| }
|
|
|
| void ProviderAsyncFileUtil::GetFileInfo(
|
|
|