| Index: storage/browser/fileapi/file_system_operation_runner.cc
|
| diff --git a/webkit/browser/fileapi/file_system_operation_runner.cc b/storage/browser/fileapi/file_system_operation_runner.cc
|
| similarity index 63%
|
| rename from webkit/browser/fileapi/file_system_operation_runner.cc
|
| rename to storage/browser/fileapi/file_system_operation_runner.cc
|
| index 1d588a77dbd48ee31c4b7090d00433c0e9c22bfa..a5fdcc2ff95fc54e1d708df76a2d96548f46a77e 100644
|
| --- a/webkit/browser/fileapi/file_system_operation_runner.cc
|
| +++ b/storage/browser/fileapi/file_system_operation_runner.cc
|
| @@ -2,21 +2,21 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "webkit/browser/fileapi/file_system_operation_runner.h"
|
| +#include "storage/browser/fileapi/file_system_operation_runner.h"
|
|
|
| #include "base/bind.h"
|
| #include "base/message_loop/message_loop_proxy.h"
|
| #include "base/stl_util.h"
|
| #include "net/url_request/url_request_context.h"
|
| -#include "webkit/browser/blob/blob_url_request_job_factory.h"
|
| -#include "webkit/browser/fileapi/file_observers.h"
|
| -#include "webkit/browser/fileapi/file_stream_writer.h"
|
| -#include "webkit/browser/fileapi/file_system_context.h"
|
| -#include "webkit/browser/fileapi/file_system_operation.h"
|
| -#include "webkit/browser/fileapi/file_writer_delegate.h"
|
| -#include "webkit/common/blob/shareable_file_reference.h"
|
| +#include "storage/browser/blob/blob_url_request_job_factory.h"
|
| +#include "storage/browser/fileapi/file_observers.h"
|
| +#include "storage/browser/fileapi/file_stream_writer.h"
|
| +#include "storage/browser/fileapi/file_system_context.h"
|
| +#include "storage/browser/fileapi/file_system_operation.h"
|
| +#include "storage/browser/fileapi/file_writer_delegate.h"
|
| +#include "storage/common/blob/shareable_file_reference.h"
|
|
|
| -namespace fileapi {
|
| +namespace storage {
|
|
|
| typedef FileSystemOperationRunner::OperationID OperationID;
|
|
|
| @@ -25,12 +25,15 @@ class FileSystemOperationRunner::BeginOperationScoper
|
| FileSystemOperationRunner::BeginOperationScoper> {
|
| public:
|
| BeginOperationScoper() {}
|
| +
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(BeginOperationScoper);
|
| };
|
|
|
| -FileSystemOperationRunner::OperationHandle::OperationHandle() {}
|
| -FileSystemOperationRunner::OperationHandle::~OperationHandle() {}
|
| +FileSystemOperationRunner::OperationHandle::OperationHandle() {
|
| +}
|
| +FileSystemOperationRunner::OperationHandle::~OperationHandle() {
|
| +}
|
|
|
| FileSystemOperationRunner::~FileSystemOperationRunner() {
|
| }
|
| @@ -54,10 +57,12 @@ OperationID FileSystemOperationRunner::CreateFile(
|
| return handle.id;
|
| }
|
| PrepareForWrite(handle.id, url);
|
| - operation->CreateFile(
|
| - url, exclusive,
|
| - base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
|
| - handle, callback));
|
| + operation->CreateFile(url,
|
| + exclusive,
|
| + base::Bind(&FileSystemOperationRunner::DidFinish,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| @@ -76,10 +81,13 @@ OperationID FileSystemOperationRunner::CreateDirectory(
|
| return handle.id;
|
| }
|
| PrepareForWrite(handle.id, url);
|
| - operation->CreateDirectory(
|
| - url, exclusive, recursive,
|
| - base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
|
| - handle, callback));
|
| + operation->CreateDirectory(url,
|
| + exclusive,
|
| + recursive,
|
| + base::Bind(&FileSystemOperationRunner::DidFinish,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| @@ -100,22 +108,26 @@ OperationID FileSystemOperationRunner::Copy(
|
| }
|
| PrepareForWrite(handle.id, dest_url);
|
| PrepareForRead(handle.id, src_url);
|
| - operation->Copy(
|
| - src_url, dest_url, option,
|
| - progress_callback.is_null() ?
|
| - CopyProgressCallback() :
|
| - base::Bind(&FileSystemOperationRunner::OnCopyProgress, AsWeakPtr(),
|
| - handle, progress_callback),
|
| - base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
|
| - handle, callback));
|
| + operation->Copy(src_url,
|
| + dest_url,
|
| + option,
|
| + progress_callback.is_null()
|
| + ? CopyProgressCallback()
|
| + : base::Bind(&FileSystemOperationRunner::OnCopyProgress,
|
| + AsWeakPtr(),
|
| + handle,
|
| + progress_callback),
|
| + base::Bind(&FileSystemOperationRunner::DidFinish,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| -OperationID FileSystemOperationRunner::Move(
|
| - const FileSystemURL& src_url,
|
| - const FileSystemURL& dest_url,
|
| - CopyOrMoveOption option,
|
| - const StatusCallback& callback) {
|
| +OperationID FileSystemOperationRunner::Move(const FileSystemURL& src_url,
|
| + const FileSystemURL& dest_url,
|
| + CopyOrMoveOption option,
|
| + const StatusCallback& callback) {
|
| base::File::Error error = base::File::FILE_OK;
|
| FileSystemOperation* operation =
|
| file_system_context_->CreateFileSystemOperation(dest_url, &error);
|
| @@ -127,10 +139,13 @@ OperationID FileSystemOperationRunner::Move(
|
| }
|
| PrepareForWrite(handle.id, dest_url);
|
| PrepareForWrite(handle.id, src_url);
|
| - operation->Move(
|
| - src_url, dest_url, option,
|
| - base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
|
| - handle, callback));
|
| + operation->Move(src_url,
|
| + dest_url,
|
| + option,
|
| + base::Bind(&FileSystemOperationRunner::DidFinish,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| @@ -147,10 +162,11 @@ OperationID FileSystemOperationRunner::DirectoryExists(
|
| return handle.id;
|
| }
|
| PrepareForRead(handle.id, url);
|
| - operation->DirectoryExists(
|
| - url,
|
| - base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
|
| - handle, callback));
|
| + operation->DirectoryExists(url,
|
| + base::Bind(&FileSystemOperationRunner::DidFinish,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| @@ -167,10 +183,11 @@ OperationID FileSystemOperationRunner::FileExists(
|
| return handle.id;
|
| }
|
| PrepareForRead(handle.id, url);
|
| - operation->FileExists(
|
| - url,
|
| - base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
|
| - handle, callback));
|
| + operation->FileExists(url,
|
| + base::Bind(&FileSystemOperationRunner::DidFinish,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| @@ -187,10 +204,11 @@ OperationID FileSystemOperationRunner::GetMetadata(
|
| return handle.id;
|
| }
|
| PrepareForRead(handle.id, url);
|
| - operation->GetMetadata(
|
| - url,
|
| - base::Bind(&FileSystemOperationRunner::DidGetMetadata, AsWeakPtr(),
|
| - handle, callback));
|
| + operation->GetMetadata(url,
|
| + base::Bind(&FileSystemOperationRunner::DidGetMetadata,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| @@ -203,21 +221,23 @@ OperationID FileSystemOperationRunner::ReadDirectory(
|
| BeginOperationScoper scope;
|
| OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr());
|
| if (!operation) {
|
| - DidReadDirectory(handle, callback, error, std::vector<DirectoryEntry>(),
|
| - false);
|
| + DidReadDirectory(
|
| + handle, callback, error, std::vector<DirectoryEntry>(), false);
|
| return handle.id;
|
| }
|
| PrepareForRead(handle.id, url);
|
| operation->ReadDirectory(
|
| url,
|
| - base::Bind(&FileSystemOperationRunner::DidReadDirectory, AsWeakPtr(),
|
| - handle, callback));
|
| + base::Bind(&FileSystemOperationRunner::DidReadDirectory,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| -OperationID FileSystemOperationRunner::Remove(
|
| - const FileSystemURL& url, bool recursive,
|
| - const StatusCallback& callback) {
|
| +OperationID FileSystemOperationRunner::Remove(const FileSystemURL& url,
|
| + bool recursive,
|
| + const StatusCallback& callback) {
|
| base::File::Error error = base::File::FILE_OK;
|
| FileSystemOperation* operation =
|
| file_system_context_->CreateFileSystemOperation(url, &error);
|
| @@ -228,17 +248,19 @@ OperationID FileSystemOperationRunner::Remove(
|
| return handle.id;
|
| }
|
| PrepareForWrite(handle.id, url);
|
| - operation->Remove(
|
| - url, recursive,
|
| - base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
|
| - handle, callback));
|
| + operation->Remove(url,
|
| + recursive,
|
| + base::Bind(&FileSystemOperationRunner::DidFinish,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| OperationID FileSystemOperationRunner::Write(
|
| const net::URLRequestContext* url_request_context,
|
| const FileSystemURL& url,
|
| - scoped_ptr<webkit_blob::BlobDataHandle> blob,
|
| + scoped_ptr<storage::BlobDataHandle> blob,
|
| int64 offset,
|
| const WriteCallback& callback) {
|
| base::File::Error error = base::File::FILE_OK;
|
| @@ -268,21 +290,22 @@ OperationID FileSystemOperationRunner::Write(
|
| new FileWriterDelegate(writer.Pass(), flush_policy));
|
|
|
| scoped_ptr<net::URLRequest> blob_request(
|
| - webkit_blob::BlobProtocolHandler::CreateBlobRequest(
|
| - blob.Pass(),
|
| - url_request_context,
|
| - writer_delegate.get()));
|
| + storage::BlobProtocolHandler::CreateBlobRequest(
|
| + blob.Pass(), url_request_context, writer_delegate.get()));
|
|
|
| PrepareForWrite(handle.id, url);
|
| operation->Write(
|
| - url, writer_delegate.Pass(), blob_request.Pass(),
|
| - base::Bind(&FileSystemOperationRunner::DidWrite, AsWeakPtr(),
|
| - handle, callback));
|
| + url,
|
| + writer_delegate.Pass(),
|
| + blob_request.Pass(),
|
| + base::Bind(
|
| + &FileSystemOperationRunner::DidWrite, AsWeakPtr(), handle, callback));
|
| return handle.id;
|
| }
|
|
|
| OperationID FileSystemOperationRunner::Truncate(
|
| - const FileSystemURL& url, int64 length,
|
| + const FileSystemURL& url,
|
| + int64 length,
|
| const StatusCallback& callback) {
|
| base::File::Error error = base::File::FILE_OK;
|
| FileSystemOperation* operation =
|
| @@ -294,16 +317,17 @@ OperationID FileSystemOperationRunner::Truncate(
|
| return handle.id;
|
| }
|
| PrepareForWrite(handle.id, url);
|
| - operation->Truncate(
|
| - url, length,
|
| - base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
|
| - handle, callback));
|
| + operation->Truncate(url,
|
| + length,
|
| + base::Bind(&FileSystemOperationRunner::DidFinish,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| -void FileSystemOperationRunner::Cancel(
|
| - OperationID id,
|
| - const StatusCallback& callback) {
|
| +void FileSystemOperationRunner::Cancel(OperationID id,
|
| + const StatusCallback& callback) {
|
| if (ContainsKey(finished_operations_, id)) {
|
| DCHECK(!ContainsKey(stray_cancel_callbacks_, id));
|
| stray_cancel_callbacks_[id] = callback;
|
| @@ -333,10 +357,13 @@ OperationID FileSystemOperationRunner::TouchFile(
|
| return handle.id;
|
| }
|
| PrepareForWrite(handle.id, url);
|
| - operation->TouchFile(
|
| - url, last_access_time, last_modified_time,
|
| - base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
|
| - handle, callback));
|
| + operation->TouchFile(url,
|
| + last_access_time,
|
| + last_modified_time,
|
| + base::Bind(&FileSystemOperationRunner::DidFinish,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| @@ -357,16 +384,17 @@ OperationID FileSystemOperationRunner::OpenFile(
|
| (base::File::FLAG_CREATE | base::File::FLAG_OPEN_ALWAYS |
|
| base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_OPEN_TRUNCATED |
|
| base::File::FLAG_WRITE | base::File::FLAG_EXCLUSIVE_WRITE |
|
| - base::File::FLAG_DELETE_ON_CLOSE |
|
| - base::File::FLAG_WRITE_ATTRIBUTES)) {
|
| + base::File::FLAG_DELETE_ON_CLOSE | base::File::FLAG_WRITE_ATTRIBUTES)) {
|
| PrepareForWrite(handle.id, url);
|
| } else {
|
| PrepareForRead(handle.id, url);
|
| }
|
| - operation->OpenFile(
|
| - url, file_flags,
|
| - base::Bind(&FileSystemOperationRunner::DidOpenFile, AsWeakPtr(),
|
| - handle, callback));
|
| + operation->OpenFile(url,
|
| + file_flags,
|
| + base::Bind(&FileSystemOperationRunner::DidOpenFile,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| @@ -379,15 +407,17 @@ OperationID FileSystemOperationRunner::CreateSnapshotFile(
|
| BeginOperationScoper scope;
|
| OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr());
|
| if (!operation) {
|
| - DidCreateSnapshot(handle, callback, error, base::File::Info(),
|
| - base::FilePath(), NULL);
|
| + DidCreateSnapshot(
|
| + handle, callback, error, base::File::Info(), base::FilePath(), NULL);
|
| return handle.id;
|
| }
|
| PrepareForRead(handle.id, url);
|
| operation->CreateSnapshotFile(
|
| url,
|
| - base::Bind(&FileSystemOperationRunner::DidCreateSnapshot, AsWeakPtr(),
|
| - handle, callback));
|
| + base::Bind(&FileSystemOperationRunner::DidCreateSnapshot,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| @@ -404,10 +434,12 @@ OperationID FileSystemOperationRunner::CopyInForeignFile(
|
| DidFinish(handle, callback, error);
|
| return handle.id;
|
| }
|
| - operation->CopyInForeignFile(
|
| - src_local_disk_path, dest_url,
|
| - base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
|
| - handle, callback));
|
| + operation->CopyInForeignFile(src_local_disk_path,
|
| + dest_url,
|
| + base::Bind(&FileSystemOperationRunner::DidFinish,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| @@ -423,10 +455,11 @@ OperationID FileSystemOperationRunner::RemoveFile(
|
| DidFinish(handle, callback, error);
|
| return handle.id;
|
| }
|
| - operation->RemoveFile(
|
| - url,
|
| - base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
|
| - handle, callback));
|
| + operation->RemoveFile(url,
|
| + base::Bind(&FileSystemOperationRunner::DidFinish,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| @@ -442,10 +475,11 @@ OperationID FileSystemOperationRunner::RemoveDirectory(
|
| DidFinish(handle, callback, error);
|
| return handle.id;
|
| }
|
| - operation->RemoveDirectory(
|
| - url,
|
| - base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
|
| - handle, callback));
|
| + operation->RemoveDirectory(url,
|
| + base::Bind(&FileSystemOperationRunner::DidFinish,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| @@ -464,10 +498,14 @@ OperationID FileSystemOperationRunner::CopyFileLocal(
|
| DidFinish(handle, callback, error);
|
| return handle.id;
|
| }
|
| - operation->CopyFileLocal(
|
| - src_url, dest_url, option, progress_callback,
|
| - base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
|
| - handle, callback));
|
| + operation->CopyFileLocal(src_url,
|
| + dest_url,
|
| + option,
|
| + progress_callback,
|
| + base::Bind(&FileSystemOperationRunner::DidFinish,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| @@ -485,10 +523,13 @@ OperationID FileSystemOperationRunner::MoveFileLocal(
|
| DidFinish(handle, callback, error);
|
| return handle.id;
|
| }
|
| - operation->MoveFileLocal(
|
| - src_url, dest_url, option,
|
| - base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
|
| - handle, callback));
|
| + operation->MoveFileLocal(src_url,
|
| + dest_url,
|
| + option,
|
| + base::Bind(&FileSystemOperationRunner::DidFinish,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| @@ -505,17 +546,21 @@ base::File::Error FileSystemOperationRunner::SyncGetPlatformPath(
|
|
|
| FileSystemOperationRunner::FileSystemOperationRunner(
|
| FileSystemContext* file_system_context)
|
| - : file_system_context_(file_system_context) {}
|
| + : file_system_context_(file_system_context) {
|
| +}
|
|
|
| -void FileSystemOperationRunner::DidFinish(
|
| - const OperationHandle& handle,
|
| - const StatusCallback& callback,
|
| - base::File::Error rv) {
|
| +void FileSystemOperationRunner::DidFinish(const OperationHandle& handle,
|
| + const StatusCallback& callback,
|
| + base::File::Error rv) {
|
| if (handle.scope) {
|
| finished_operations_.insert(handle.id);
|
| base::MessageLoopProxy::current()->PostTask(
|
| - FROM_HERE, base::Bind(&FileSystemOperationRunner::DidFinish,
|
| - AsWeakPtr(), handle, callback, rv));
|
| + FROM_HERE,
|
| + base::Bind(&FileSystemOperationRunner::DidFinish,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback,
|
| + rv));
|
| return;
|
| }
|
| callback.Run(rv);
|
| @@ -530,8 +575,13 @@ void FileSystemOperationRunner::DidGetMetadata(
|
| if (handle.scope) {
|
| finished_operations_.insert(handle.id);
|
| base::MessageLoopProxy::current()->PostTask(
|
| - FROM_HERE, base::Bind(&FileSystemOperationRunner::DidGetMetadata,
|
| - AsWeakPtr(), handle, callback, rv, file_info));
|
| + FROM_HERE,
|
| + base::Bind(&FileSystemOperationRunner::DidGetMetadata,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback,
|
| + rv,
|
| + file_info));
|
| return;
|
| }
|
| callback.Run(rv, file_info);
|
| @@ -547,9 +597,14 @@ void FileSystemOperationRunner::DidReadDirectory(
|
| if (handle.scope) {
|
| finished_operations_.insert(handle.id);
|
| base::MessageLoopProxy::current()->PostTask(
|
| - FROM_HERE, base::Bind(&FileSystemOperationRunner::DidReadDirectory,
|
| - AsWeakPtr(), handle, callback, rv,
|
| - entries, has_more));
|
| + FROM_HERE,
|
| + base::Bind(&FileSystemOperationRunner::DidReadDirectory,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback,
|
| + rv,
|
| + entries,
|
| + has_more));
|
| return;
|
| }
|
| callback.Run(rv, entries, has_more);
|
| @@ -557,17 +612,22 @@ void FileSystemOperationRunner::DidReadDirectory(
|
| FinishOperation(handle.id);
|
| }
|
|
|
| -void FileSystemOperationRunner::DidWrite(
|
| - const OperationHandle& handle,
|
| - const WriteCallback& callback,
|
| - base::File::Error rv,
|
| - int64 bytes,
|
| - bool complete) {
|
| +void FileSystemOperationRunner::DidWrite(const OperationHandle& handle,
|
| + const WriteCallback& callback,
|
| + base::File::Error rv,
|
| + int64 bytes,
|
| + bool complete) {
|
| if (handle.scope) {
|
| finished_operations_.insert(handle.id);
|
| base::MessageLoopProxy::current()->PostTask(
|
| - FROM_HERE, base::Bind(&FileSystemOperationRunner::DidWrite, AsWeakPtr(),
|
| - handle, callback, rv, bytes, complete));
|
| + FROM_HERE,
|
| + base::Bind(&FileSystemOperationRunner::DidWrite,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback,
|
| + rv,
|
| + bytes,
|
| + complete));
|
| return;
|
| }
|
| callback.Run(rv, bytes, complete);
|
| @@ -583,9 +643,13 @@ void FileSystemOperationRunner::DidOpenFile(
|
| if (handle.scope) {
|
| finished_operations_.insert(handle.id);
|
| base::MessageLoopProxy::current()->PostTask(
|
| - FROM_HERE, base::Bind(&FileSystemOperationRunner::DidOpenFile,
|
| - AsWeakPtr(), handle, callback, Passed(&file),
|
| - on_close_callback));
|
| + FROM_HERE,
|
| + base::Bind(&FileSystemOperationRunner::DidOpenFile,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback,
|
| + Passed(&file),
|
| + on_close_callback));
|
| return;
|
| }
|
| callback.Run(file.Pass(), on_close_callback);
|
| @@ -598,13 +662,19 @@ void FileSystemOperationRunner::DidCreateSnapshot(
|
| base::File::Error rv,
|
| const base::File::Info& file_info,
|
| const base::FilePath& platform_path,
|
| - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) {
|
| + const scoped_refptr<storage::ShareableFileReference>& file_ref) {
|
| if (handle.scope) {
|
| finished_operations_.insert(handle.id);
|
| base::MessageLoopProxy::current()->PostTask(
|
| - FROM_HERE, base::Bind(&FileSystemOperationRunner::DidCreateSnapshot,
|
| - AsWeakPtr(), handle, callback, rv, file_info,
|
| - platform_path, file_ref));
|
| + FROM_HERE,
|
| + base::Bind(&FileSystemOperationRunner::DidCreateSnapshot,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback,
|
| + rv,
|
| + file_info,
|
| + platform_path,
|
| + file_ref));
|
| return;
|
| }
|
| callback.Run(rv, file_info, platform_path, file_ref);
|
| @@ -620,9 +690,15 @@ void FileSystemOperationRunner::OnCopyProgress(
|
| int64 size) {
|
| if (handle.scope) {
|
| base::MessageLoopProxy::current()->PostTask(
|
| - FROM_HERE, base::Bind(
|
| - &FileSystemOperationRunner::OnCopyProgress,
|
| - AsWeakPtr(), handle, callback, type, source_url, dest_url, size));
|
| + FROM_HERE,
|
| + base::Bind(&FileSystemOperationRunner::OnCopyProgress,
|
| + AsWeakPtr(),
|
| + handle,
|
| + callback,
|
| + type,
|
| + source_url,
|
| + dest_url,
|
| + size));
|
| return;
|
| }
|
| callback.Run(type, source_url, dest_url, size);
|
| @@ -631,8 +707,8 @@ void FileSystemOperationRunner::OnCopyProgress(
|
| void FileSystemOperationRunner::PrepareForWrite(OperationID id,
|
| const FileSystemURL& url) {
|
| if (file_system_context_->GetUpdateObservers(url.type())) {
|
| - file_system_context_->GetUpdateObservers(url.type())->Notify(
|
| - &FileUpdateObserver::OnStartUpdate, MakeTuple(url));
|
| + file_system_context_->GetUpdateObservers(url.type())
|
| + ->Notify(&FileUpdateObserver::OnStartUpdate, MakeTuple(url));
|
| }
|
| write_target_urls_[id].insert(url);
|
| }
|
| @@ -640,8 +716,8 @@ void FileSystemOperationRunner::PrepareForWrite(OperationID id,
|
| void FileSystemOperationRunner::PrepareForRead(OperationID id,
|
| const FileSystemURL& url) {
|
| if (file_system_context_->GetAccessObservers(url.type())) {
|
| - file_system_context_->GetAccessObservers(url.type())->Notify(
|
| - &FileAccessObserver::OnAccess, MakeTuple(url));
|
| + file_system_context_->GetAccessObservers(url.type())
|
| + ->Notify(&FileAccessObserver::OnAccess, MakeTuple(url));
|
| }
|
| }
|
|
|
| @@ -660,10 +736,11 @@ void FileSystemOperationRunner::FinishOperation(OperationID id) {
|
| if (found != write_target_urls_.end()) {
|
| const FileSystemURLSet& urls = found->second;
|
| for (FileSystemURLSet::const_iterator iter = urls.begin();
|
| - iter != urls.end(); ++iter) {
|
| + iter != urls.end();
|
| + ++iter) {
|
| if (file_system_context_->GetUpdateObservers(iter->type())) {
|
| - file_system_context_->GetUpdateObservers(iter->type())->Notify(
|
| - &FileUpdateObserver::OnEndUpdate, MakeTuple(*iter));
|
| + file_system_context_->GetUpdateObservers(iter->type())
|
| + ->Notify(&FileUpdateObserver::OnEndUpdate, MakeTuple(*iter));
|
| }
|
| }
|
| write_target_urls_.erase(found);
|
| @@ -686,4 +763,4 @@ void FileSystemOperationRunner::FinishOperation(OperationID id) {
|
| }
|
| }
|
|
|
| -} // namespace fileapi
|
| +} // namespace storage
|
|
|