Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Unified Diff: trunk/src/webkit/browser/fileapi/file_system_operation_impl.cc

Issue 60323002: Revert 232547 "Pepper: Move FileIO host from renderer to browser." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: trunk/src/webkit/browser/fileapi/file_system_operation_impl.cc
===================================================================
--- trunk/src/webkit/browser/fileapi/file_system_operation_impl.cc (revision 233010)
+++ trunk/src/webkit/browser/fileapi/file_system_operation_impl.cc (working copy)
@@ -199,14 +199,17 @@
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::Closure(),
+ base::kNullProcessHandle);
return;
}
GetUsageAndQuotaThenRunTask(
@@ -216,7 +219,8 @@
url, callback, file_flags),
base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED,
base::kInvalidPlatformFileValue,
- base::Closure()));
+ base::Closure(),
+ base::kNullProcessHandle));
}
// We can only get here on a write or truncate that's not yet completed.
@@ -331,6 +335,7 @@
: 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());
@@ -548,7 +553,9 @@
base::PlatformFileError rv,
base::PassPlatformFile file,
const base::Closure& on_close_callback) {
- callback.Run(rv, file.ReleaseValue(), 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_);
}
bool FileSystemOperationImpl::SetPendingOperationType(OperationType type) {

Powered by Google App Engine
This is Rietveld 408576698