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) { |