| Index: storage/browser/fileapi/file_system_operation_impl.cc
|
| diff --git a/storage/browser/fileapi/file_system_operation_impl.cc b/storage/browser/fileapi/file_system_operation_impl.cc
|
| index 84d80f623fd066500c62278a401435ac56ec486a..15700f060c4e17eb4cf27b287fd0ceed33c0e5e0 100644
|
| --- a/storage/browser/fileapi/file_system_operation_impl.cc
|
| +++ b/storage/browser/fileapi/file_system_operation_impl.cc
|
| @@ -5,8 +5,8 @@
|
| #include "storage/browser/fileapi/file_system_operation_impl.h"
|
|
|
| #include <stdint.h>
|
| -
|
| #include <limits>
|
| +#include <utility>
|
|
|
| #include "base/bind.h"
|
| #include "base/single_thread_task_runner.h"
|
| @@ -49,7 +49,7 @@ void DidOpenFile(
|
| base::Bind(&Destruct, base::Passed(&file)));
|
| return;
|
| }
|
| - callback.Run(file.Pass(), on_close_callback);
|
| + callback.Run(std::move(file), on_close_callback);
|
| }
|
|
|
| } // namespace
|
| @@ -59,7 +59,7 @@ FileSystemOperation* FileSystemOperation::Create(
|
| FileSystemContext* file_system_context,
|
| scoped_ptr<FileSystemOperationContext> operation_context) {
|
| return new FileSystemOperationImpl(url, file_system_context,
|
| - operation_context.Pass());
|
| + std::move(operation_context));
|
| }
|
|
|
| FileSystemOperationImpl::~FileSystemOperationImpl() {
|
| @@ -135,7 +135,7 @@ void FileSystemOperationImpl::DirectoryExists(const FileSystemURL& url,
|
| const StatusCallback& callback) {
|
| DCHECK(SetPendingOperationType(kOperationDirectoryExists));
|
| async_file_util_->GetFileInfo(
|
| - operation_context_.Pass(), url, GET_METADATA_FIELD_IS_DIRECTORY,
|
| + std::move(operation_context_), url, GET_METADATA_FIELD_IS_DIRECTORY,
|
| base::Bind(&FileSystemOperationImpl::DidDirectoryExists,
|
| weak_factory_.GetWeakPtr(), callback));
|
| }
|
| @@ -144,7 +144,7 @@ void FileSystemOperationImpl::FileExists(const FileSystemURL& url,
|
| const StatusCallback& callback) {
|
| DCHECK(SetPendingOperationType(kOperationFileExists));
|
| async_file_util_->GetFileInfo(
|
| - operation_context_.Pass(), url, GET_METADATA_FIELD_IS_DIRECTORY,
|
| + std::move(operation_context_), url, GET_METADATA_FIELD_IS_DIRECTORY,
|
| base::Bind(&FileSystemOperationImpl::DidFileExists,
|
| weak_factory_.GetWeakPtr(), callback));
|
| }
|
| @@ -153,15 +153,14 @@ void FileSystemOperationImpl::GetMetadata(const FileSystemURL& url,
|
| int fields,
|
| const GetMetadataCallback& callback) {
|
| DCHECK(SetPendingOperationType(kOperationGetMetadata));
|
| - async_file_util_->GetFileInfo(operation_context_.Pass(), url, fields,
|
| + async_file_util_->GetFileInfo(std::move(operation_context_), url, fields,
|
| callback);
|
| }
|
|
|
| void FileSystemOperationImpl::ReadDirectory(
|
| const FileSystemURL& url, const ReadDirectoryCallback& callback) {
|
| DCHECK(SetPendingOperationType(kOperationReadDirectory));
|
| - async_file_util_->ReadDirectory(
|
| - operation_context_.Pass(), url, callback);
|
| + async_file_util_->ReadDirectory(std::move(operation_context_), url, callback);
|
| }
|
|
|
| void FileSystemOperationImpl::Remove(const FileSystemURL& url,
|
| @@ -175,7 +174,7 @@ void FileSystemOperationImpl::Remove(const FileSystemURL& url,
|
| // first. If not supported, it is delegated to RemoveOperationDelegate
|
| // in DidDeleteRecursively.
|
| async_file_util_->DeleteRecursively(
|
| - operation_context_.Pass(), url,
|
| + std::move(operation_context_), url,
|
| base::Bind(&FileSystemOperationImpl::DidDeleteRecursively,
|
| weak_factory_.GetWeakPtr(), url, callback));
|
| return;
|
| @@ -195,11 +194,11 @@ void FileSystemOperationImpl::Write(
|
| scoped_ptr<net::URLRequest> blob_request,
|
| const WriteCallback& callback) {
|
| DCHECK(SetPendingOperationType(kOperationWrite));
|
| - file_writer_delegate_ = writer_delegate.Pass();
|
| + file_writer_delegate_ = std::move(writer_delegate);
|
| file_writer_delegate_->Start(
|
| - blob_request.Pass(),
|
| - base::Bind(&FileSystemOperationImpl::DidWrite,
|
| - weak_factory_.GetWeakPtr(), url, callback));
|
| + std::move(blob_request),
|
| + base::Bind(&FileSystemOperationImpl::DidWrite, weak_factory_.GetWeakPtr(),
|
| + url, callback));
|
| }
|
|
|
| void FileSystemOperationImpl::Truncate(const FileSystemURL& url,
|
| @@ -227,8 +226,7 @@ void FileSystemOperationImpl::TouchFile(const FileSystemURL& url,
|
| TRACE_EVENT0("io", "FileSystemOperationImpl::TouchFile");
|
|
|
| async_file_util_->Touch(
|
| - operation_context_.Pass(), url,
|
| - last_access_time, last_modified_time,
|
| + std::move(operation_context_), url, last_access_time, last_modified_time,
|
| base::Bind(&FileSystemOperationImpl::DidFinishOperation,
|
| weak_factory_.GetWeakPtr(), callback));
|
| }
|
| @@ -281,8 +279,8 @@ void FileSystemOperationImpl::CreateSnapshotFile(
|
| const FileSystemURL& url,
|
| const SnapshotFileCallback& callback) {
|
| DCHECK(SetPendingOperationType(kOperationCreateSnapshotFile));
|
| - async_file_util_->CreateSnapshotFile(
|
| - operation_context_.Pass(), url, callback);
|
| + async_file_util_->CreateSnapshotFile(std::move(operation_context_), url,
|
| + callback);
|
| }
|
|
|
| void FileSystemOperationImpl::CopyInForeignFile(
|
| @@ -307,7 +305,7 @@ void FileSystemOperationImpl::RemoveFile(
|
| const StatusCallback& callback) {
|
| DCHECK(SetPendingOperationType(kOperationRemove));
|
| async_file_util_->DeleteFile(
|
| - operation_context_.Pass(), url,
|
| + std::move(operation_context_), url,
|
| base::Bind(&FileSystemOperationImpl::DidFinishOperation,
|
| weak_factory_.GetWeakPtr(), callback));
|
| }
|
| @@ -317,7 +315,7 @@ void FileSystemOperationImpl::RemoveDirectory(
|
| const StatusCallback& callback) {
|
| DCHECK(SetPendingOperationType(kOperationRemove));
|
| async_file_util_->DeleteDirectory(
|
| - operation_context_.Pass(), url,
|
| + std::move(operation_context_), url,
|
| base::Bind(&FileSystemOperationImpl::DidFinishOperation,
|
| weak_factory_.GetWeakPtr(), callback));
|
| }
|
| @@ -378,7 +376,7 @@ FileSystemOperationImpl::FileSystemOperationImpl(
|
| FileSystemContext* file_system_context,
|
| scoped_ptr<FileSystemOperationContext> operation_context)
|
| : file_system_context_(file_system_context),
|
| - operation_context_(operation_context.Pass()),
|
| + operation_context_(std::move(operation_context)),
|
| async_file_util_(NULL),
|
| pending_operation_(kOperationNone),
|
| weak_factory_(this) {
|
| @@ -434,11 +432,10 @@ void FileSystemOperationImpl::DoCreateFile(
|
| const StatusCallback& callback,
|
| bool exclusive) {
|
| async_file_util_->EnsureFileExists(
|
| - operation_context_.Pass(), url,
|
| + std::move(operation_context_), url,
|
| base::Bind(
|
| - exclusive ?
|
| - &FileSystemOperationImpl::DidEnsureFileExistsExclusive :
|
| - &FileSystemOperationImpl::DidEnsureFileExistsNonExclusive,
|
| + exclusive ? &FileSystemOperationImpl::DidEnsureFileExistsExclusive
|
| + : &FileSystemOperationImpl::DidEnsureFileExistsNonExclusive,
|
| weak_factory_.GetWeakPtr(), callback));
|
| }
|
|
|
| @@ -447,8 +444,7 @@ void FileSystemOperationImpl::DoCreateDirectory(
|
| const StatusCallback& callback,
|
| bool exclusive, bool recursive) {
|
| async_file_util_->CreateDirectory(
|
| - operation_context_.Pass(),
|
| - url, exclusive, recursive,
|
| + std::move(operation_context_), url, exclusive, recursive,
|
| base::Bind(&FileSystemOperationImpl::DidFinishOperation,
|
| weak_factory_.GetWeakPtr(), callback));
|
| }
|
| @@ -460,7 +456,8 @@ void FileSystemOperationImpl::DoCopyFileLocal(
|
| const CopyFileProgressCallback& progress_callback,
|
| const StatusCallback& callback) {
|
| async_file_util_->CopyFileLocal(
|
| - operation_context_.Pass(), src_url, dest_url, option, progress_callback,
|
| + std::move(operation_context_), src_url, dest_url, option,
|
| + progress_callback,
|
| base::Bind(&FileSystemOperationImpl::DidFinishOperation,
|
| weak_factory_.GetWeakPtr(), callback));
|
| }
|
| @@ -471,7 +468,7 @@ void FileSystemOperationImpl::DoMoveFileLocal(
|
| CopyOrMoveOption option,
|
| const StatusCallback& callback) {
|
| async_file_util_->MoveFileLocal(
|
| - operation_context_.Pass(), src_url, dest_url, option,
|
| + std::move(operation_context_), src_url, dest_url, option,
|
| base::Bind(&FileSystemOperationImpl::DidFinishOperation,
|
| weak_factory_.GetWeakPtr(), callback));
|
| }
|
| @@ -481,8 +478,7 @@ void FileSystemOperationImpl::DoCopyInForeignFile(
|
| const FileSystemURL& dest_url,
|
| const StatusCallback& callback) {
|
| async_file_util_->CopyInForeignFile(
|
| - operation_context_.Pass(),
|
| - src_local_disk_file_path, dest_url,
|
| + std::move(operation_context_), src_local_disk_file_path, dest_url,
|
| base::Bind(&FileSystemOperationImpl::DidFinishOperation,
|
| weak_factory_.GetWeakPtr(), callback));
|
| }
|
| @@ -491,7 +487,7 @@ void FileSystemOperationImpl::DoTruncate(const FileSystemURL& url,
|
| const StatusCallback& callback,
|
| int64_t length) {
|
| async_file_util_->Truncate(
|
| - operation_context_.Pass(), url, length,
|
| + std::move(operation_context_), url, length,
|
| base::Bind(&FileSystemOperationImpl::DidFinishOperation,
|
| weak_factory_.GetWeakPtr(), callback));
|
| }
|
| @@ -500,9 +496,9 @@ void FileSystemOperationImpl::DoOpenFile(const FileSystemURL& url,
|
| const OpenFileCallback& callback,
|
| int file_flags) {
|
| async_file_util_->CreateOrOpen(
|
| - operation_context_.Pass(), url, file_flags,
|
| - base::Bind(&DidOpenFile,
|
| - file_system_context_, weak_factory_.GetWeakPtr(), callback));
|
| + std::move(operation_context_), url, file_flags,
|
| + base::Bind(&DidOpenFile, file_system_context_, weak_factory_.GetWeakPtr(),
|
| + callback));
|
| }
|
|
|
| void FileSystemOperationImpl::DidEnsureFileExistsExclusive(
|
|
|