diff options
author | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-01 19:32:57 +0000 |
---|---|---|
committer | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-01 19:32:57 +0000 |
commit | f2f6418e83b6008902554c0073f070f7c5e1e1d7 (patch) | |
tree | ad3fecd189aeb9170340083485093bd8ce570e6f /webkit | |
parent | 939c7b6ce5e3c7646081794739eeb163bf7d56ee (diff) | |
download | chromium_src-f2f6418e83b6008902554c0073f070f7c5e1e1d7.zip chromium_src-f2f6418e83b6008902554c0073f070f7c5e1e1d7.tar.gz chromium_src-f2f6418e83b6008902554c0073f070f7c5e1e1d7.tar.bz2 |
Pepper: Move FileIO host from renderer to browser.
This change is large because it moves QuotaFileIO and PepperFileIOHost all at
once to the browser process. Some code in the refactored PepperFileIOHost is
moved from what's provided in FileAPIMessageFilter.
Tested locally with Bastion, From Dust, and Angry Bots.
TBR=jschuh
BUG=246396
Review URL: https://codereview.chromium.org/33053002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232440 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
5 files changed, 10 insertions, 31 deletions
diff --git a/webkit/browser/fileapi/file_system_operation.h b/webkit/browser/fileapi/file_system_operation.h index 8ff6956..ded87f7 100644 --- a/webkit/browser/fileapi/file_system_operation.h +++ b/webkit/browser/fileapi/file_system_operation.h @@ -80,8 +80,7 @@ class FileSystemOperation { typedef base::Callback< void(base::PlatformFileError result, base::PlatformFile file, - const base::Closure& on_close_callback, - base::ProcessHandle peer_handle)> OpenFileCallback; + const base::Closure& on_close_callback)> OpenFileCallback; // Used for ReadDirectoryCallback. typedef std::vector<DirectoryEntry> FileEntryList; @@ -355,13 +354,9 @@ class FileSystemOperation { // Opens a file at |path| with |file_flags|, where flags are OR'ed // values of base::PlatformFileFlags. // - // |peer_handle| is the process handle of a pepper plugin process, which - // is necessary for underlying IPC calls with Pepper plugins. - // // This function is used only by Pepper as of writing. virtual void OpenFile(const FileSystemURL& path, int file_flags, - base::ProcessHandle peer_handle, const OpenFileCallback& callback) = 0; // Creates a local snapshot file for a given |path| and returns the diff --git a/webkit/browser/fileapi/file_system_operation_impl.cc b/webkit/browser/fileapi/file_system_operation_impl.cc index 3b4dbaf..180e120 100644 --- a/webkit/browser/fileapi/file_system_operation_impl.cc +++ b/webkit/browser/fileapi/file_system_operation_impl.cc @@ -199,17 +199,14 @@ void FileSystemOperationImpl::TouchFile(const FileSystemURL& url, void FileSystemOperationImpl::OpenFile(const FileSystemURL& url, int file_flags, - base::ProcessHandle peer_handle, const OpenFileCallback& callback) { DCHECK(SetPendingOperationType(kOperationOpenFile)); - peer_handle_ = peer_handle; if (file_flags & (base::PLATFORM_FILE_TEMPORARY | base::PLATFORM_FILE_HIDDEN)) { callback.Run(base::PLATFORM_FILE_ERROR_FAILED, base::kInvalidPlatformFileValue, - base::Closure(), - base::kNullProcessHandle); + base::Closure()); return; } GetUsageAndQuotaThenRunTask( @@ -219,8 +216,7 @@ void FileSystemOperationImpl::OpenFile(const FileSystemURL& url, url, callback, file_flags), base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED, base::kInvalidPlatformFileValue, - base::Closure(), - base::kNullProcessHandle)); + base::Closure())); } // We can only get here on a write or truncate that's not yet completed. @@ -335,7 +331,6 @@ FileSystemOperationImpl::FileSystemOperationImpl( : file_system_context_(file_system_context), operation_context_(operation_context.Pass()), async_file_util_(NULL), - peer_handle_(base::kNullProcessHandle), pending_operation_(kOperationNone), weak_factory_(this) { DCHECK(operation_context_.get()); @@ -553,9 +548,7 @@ void FileSystemOperationImpl::DidOpenFile( base::PlatformFileError rv, base::PassPlatformFile file, const base::Closure& on_close_callback) { - if (rv == base::PLATFORM_FILE_OK) - CHECK_NE(base::kNullProcessHandle, peer_handle_); - callback.Run(rv, file.ReleaseValue(), on_close_callback, peer_handle_); + callback.Run(rv, file.ReleaseValue(), on_close_callback); } bool FileSystemOperationImpl::SetPendingOperationType(OperationType type) { diff --git a/webkit/browser/fileapi/file_system_operation_impl.h b/webkit/browser/fileapi/file_system_operation_impl.h index a4fa3fe..0625995 100644 --- a/webkit/browser/fileapi/file_system_operation_impl.h +++ b/webkit/browser/fileapi/file_system_operation_impl.h @@ -69,7 +69,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationImpl const StatusCallback& callback) OVERRIDE; virtual void OpenFile(const FileSystemURL& url, int file_flags, - base::ProcessHandle peer_handle, const OpenFileCallback& callback) OVERRIDE; virtual void Cancel(const StatusCallback& cancel_callback) OVERRIDE; virtual void CreateSnapshotFile( @@ -195,10 +194,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationImpl StatusCallback cancel_callback_; - // Used only by OpenFile, in order to clone the file handle back to the - // requesting process. - base::ProcessHandle peer_handle_; - // A flag to make sure we call operation only once per instance. OperationType pending_operation_; diff --git a/webkit/browser/fileapi/file_system_operation_runner.cc b/webkit/browser/fileapi/file_system_operation_runner.cc index 8903187..d552a78 100644 --- a/webkit/browser/fileapi/file_system_operation_runner.cc +++ b/webkit/browser/fileapi/file_system_operation_runner.cc @@ -339,7 +339,6 @@ OperationID FileSystemOperationRunner::TouchFile( OperationID FileSystemOperationRunner::OpenFile( const FileSystemURL& url, int file_flags, - base::ProcessHandle peer_handle, const OpenFileCallback& callback) { base::PlatformFileError error = base::PLATFORM_FILE_OK; FileSystemOperation* operation = @@ -348,7 +347,7 @@ OperationID FileSystemOperationRunner::OpenFile( OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { DidOpenFile(handle, callback, error, base::kInvalidPlatformFileValue, - base::Closure(), base::ProcessHandle()); + base::Closure()); return handle.id; } if (file_flags & @@ -362,7 +361,7 @@ OperationID FileSystemOperationRunner::OpenFile( PrepareForRead(handle.id, url); } operation->OpenFile( - url, file_flags, peer_handle, + url, file_flags, base::Bind(&FileSystemOperationRunner::DidOpenFile, AsWeakPtr(), handle, callback)); return handle.id; @@ -578,17 +577,16 @@ void FileSystemOperationRunner::DidOpenFile( const OpenFileCallback& callback, base::PlatformFileError rv, base::PlatformFile file, - const base::Closure& on_close_callback, - base::ProcessHandle peer_handle) { + const base::Closure& on_close_callback) { if (handle.scope) { finished_operations_.insert(handle.id); base::MessageLoopProxy::current()->PostTask( FROM_HERE, base::Bind(&FileSystemOperationRunner::DidOpenFile, AsWeakPtr(), handle, callback, rv, file, - on_close_callback, peer_handle)); + on_close_callback)); return; } - callback.Run(rv, file, on_close_callback, peer_handle); + callback.Run(rv, file, on_close_callback); FinishOperation(handle.id); } diff --git a/webkit/browser/fileapi/file_system_operation_runner.h b/webkit/browser/fileapi/file_system_operation_runner.h index b19a700..fba6b1c 100644 --- a/webkit/browser/fileapi/file_system_operation_runner.h +++ b/webkit/browser/fileapi/file_system_operation_runner.h @@ -145,7 +145,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationRunner // This function is used only by Pepper as of writing. OperationID OpenFile(const FileSystemURL& url, int file_flags, - base::ProcessHandle peer_handle, const OpenFileCallback& callback); // Creates a local snapshot file for a given |url| and returns the @@ -274,8 +273,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationRunner const OpenFileCallback& callback, base::PlatformFileError rv, base::PlatformFile file, - const base::Closure& on_close_callback, - base::ProcessHandle peer_handle); + const base::Closure& on_close_callback); void DidCreateSnapshot( const OperationHandle& handle, const SnapshotFileCallback& callback, |