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

Side by Side Diff: webkit/chromeos/fileapi/remote_file_system_operation.cc

Issue 14472008: [FileAPI] Add file open ID and close callback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/chromeos/fileapi/remote_file_system_operation.h" 5 #include "webkit/chromeos/fileapi/remote_file_system_operation.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "base/platform_file.h" 9 #include "base/platform_file.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 void RemoteFileSystemOperation::OpenFile(const FileSystemURL& url, 190 void RemoteFileSystemOperation::OpenFile(const FileSystemURL& url,
191 int file_flags, 191 int file_flags,
192 base::ProcessHandle peer_handle, 192 base::ProcessHandle peer_handle,
193 const OpenFileCallback& callback) { 193 const OpenFileCallback& callback) {
194 DCHECK(SetPendingOperationType(kOperationOpenFile)); 194 DCHECK(SetPendingOperationType(kOperationOpenFile));
195 remote_proxy_->OpenFile( 195 remote_proxy_->OpenFile(
196 url, 196 url,
197 file_flags, 197 file_flags,
198 peer_handle, 198 peer_handle,
199 base::Bind(&RemoteFileSystemOperation::DidOpenFile, 199 base::Bind(&RemoteFileSystemOperation::DidOpenFile,
200 base::Owned(this), callback)); 200 base::Owned(this), url, callback));
201 } 201 }
202 202
203 void RemoteFileSystemOperation::NotifyCloseFile( 203 void RemoteFileSystemOperation::NotifyCloseFile(
204 const fileapi::FileSystemURL& url) { 204 const fileapi::FileSystemURL& url) {
205 DCHECK(SetPendingOperationType(kOperationCloseFile)); 205 DCHECK(SetPendingOperationType(kOperationCloseFile));
206 remote_proxy_->NotifyCloseFile(url); 206 remote_proxy_->NotifyCloseFile(url);
207 // Unlike other operations, NotifyCloseFile does not require callback. 207 // Unlike other operations, NotifyCloseFile does not require callback.
208 // So it must be deleted here right now. 208 // So it must be deleted here right now.
209 delete this; 209 delete this;
210 } 210 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 void RemoteFileSystemOperation::DidCreateSnapshotFile( 309 void RemoteFileSystemOperation::DidCreateSnapshotFile(
310 const SnapshotFileCallback& callback, 310 const SnapshotFileCallback& callback,
311 base::PlatformFileError result, 311 base::PlatformFileError result,
312 const base::PlatformFileInfo& file_info, 312 const base::PlatformFileInfo& file_info,
313 const base::FilePath& platform_path, 313 const base::FilePath& platform_path,
314 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { 314 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) {
315 callback.Run(result, file_info, platform_path, file_ref); 315 callback.Run(result, file_info, platform_path, file_ref);
316 } 316 }
317 317
318 void RemoteFileSystemOperation::DidOpenFile( 318 void RemoteFileSystemOperation::DidOpenFile(
319 const fileapi::FileSystemURL& url,
319 const OpenFileCallback& callback, 320 const OpenFileCallback& callback,
320 base::PlatformFileError result, 321 base::PlatformFileError result,
321 base::PlatformFile file, 322 base::PlatformFile file,
322 base::ProcessHandle peer_handle) { 323 base::ProcessHandle peer_handle) {
323 callback.Run(result, file, peer_handle); 324 callback.Run(
325 result, file,
326 base::Bind(&fileapi::RemoteFileSystemProxyInterface::NotifyCloseFile,
327 remote_proxy_, url),
328 peer_handle);
324 } 329 }
325 330
326 } // namespace chromeos 331 } // namespace chromeos
OLDNEW
« no previous file with comments | « webkit/chromeos/fileapi/remote_file_system_operation.h ('k') | webkit/fileapi/file_system_callback_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698