| Index: webkit/browser/fileapi/async_file_util_adapter.cc
|
| diff --git a/webkit/browser/fileapi/async_file_util_adapter.cc b/webkit/browser/fileapi/async_file_util_adapter.cc
|
| index b66cf02ae13bd91c8c254de402b3be48fae49288..20463d15a7a4a888e8809857bafd0425238268a3 100644
|
| --- a/webkit/browser/fileapi/async_file_util_adapter.cc
|
| +++ b/webkit/browser/fileapi/async_file_util_adapter.cc
|
| @@ -133,11 +133,22 @@ void ReadDirectoryHelper(FileSystemFileUtil* file_util,
|
| }
|
|
|
| void RunCreateOrOpenCallback(
|
| + FileSystemOperationContext* context,
|
| const AsyncFileUtil::CreateOrOpenCallback& callback,
|
| - base::File::Error result,
|
| - base::PassPlatformFile file,
|
| - bool created) {
|
| - callback.Run(result, file, base::Closure());
|
| + base::File file) {
|
| + // TODO(rvargas): Remove PlatformFile from AsyncFileUtil.
|
| + base::File::Error error;
|
| + base::PlatformFile platform_file;
|
| + if (file.IsValid()) {
|
| + error = base::File::FILE_OK;
|
| + platform_file = file.TakePlatformFile();
|
| + } else {
|
| + error = file.error_details();
|
| + platform_file = base::kInvalidPlatformFileValue;
|
| + }
|
| +
|
| + callback.Run(error, base::PassPlatformFile(&platform_file), base::Closure());
|
| + base::File closer(platform_file);
|
| }
|
|
|
| } // namespace
|
| @@ -157,14 +168,12 @@ void AsyncFileUtilAdapter::CreateOrOpen(
|
| int file_flags,
|
| const CreateOrOpenCallback& callback) {
|
| FileSystemOperationContext* context_ptr = context.release();
|
| - const bool success = base::FileUtilProxy::RelayCreateOrOpen(
|
| + base::PostTaskAndReplyWithResult(
|
| context_ptr->task_runner(),
|
| + FROM_HERE,
|
| Bind(&FileSystemFileUtil::CreateOrOpen, Unretained(sync_file_util_.get()),
|
| context_ptr, url, file_flags),
|
| - Bind(&FileSystemFileUtil::Close, Unretained(sync_file_util_.get()),
|
| - base::Owned(context_ptr)),
|
| - Bind(&RunCreateOrOpenCallback, callback));
|
| - DCHECK(success);
|
| + Bind(&RunCreateOrOpenCallback, base::Owned(context_ptr), callback));
|
| }
|
|
|
| void AsyncFileUtilAdapter::EnsureFileExists(
|
|
|