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

Side by Side Diff: webkit/fileapi/syncable/syncable_file_system_operation.cc

Issue 12051055: 2nd try: FileAPI: Split recursive remove into multiple tasks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 10 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/fileapi/syncable/syncable_file_system_operation.h" 5 #include "webkit/fileapi/syncable/syncable_file_system_operation.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "webkit/blob/shareable_file_reference.h" 8 #include "webkit/blob/shareable_file_reference.h"
9 #include "webkit/fileapi/file_system_context.h" 9 #include "webkit/fileapi/file_system_context.h"
10 #include "webkit/fileapi/file_system_url.h" 10 #include "webkit/fileapi/file_system_url.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 const StatusCallback& cancel_callback) { 307 const StatusCallback& cancel_callback) {
308 DCHECK(CalledOnValidThread()); 308 DCHECK(CalledOnValidThread());
309 DCHECK(file_system_operation_); 309 DCHECK(file_system_operation_);
310 completion_callback_ = cancel_callback; 310 completion_callback_ = cancel_callback;
311 file_system_operation_->Cancel( 311 file_system_operation_->Cancel(
312 base::Bind(&self::DidFinish, base::Owned(this))); 312 base::Bind(&self::DidFinish, base::Owned(this)));
313 } 313 }
314 314
315 LocalFileSystemOperation* 315 LocalFileSystemOperation*
316 SyncableFileSystemOperation::AsLocalFileSystemOperation() { 316 SyncableFileSystemOperation::AsLocalFileSystemOperation() {
317 NOTREACHED(); 317 // This must be called for nested sub-task operations
318 return NULL; 318 // where we don't need extra task queueing.
319 // Just return the internal file_system_operation_ and let this
320 // instance goes away when the operation dies.
321 file_system_operation_->set_termination_callback(
322 base::Bind(&SyncableFileSystemOperation::Destruct,
323 base::Unretained(this)));
324 return file_system_operation_;
319 } 325 }
320 326
321 void SyncableFileSystemOperation::CreateSnapshotFile( 327 void SyncableFileSystemOperation::CreateSnapshotFile(
322 const FileSystemURL& path, 328 const FileSystemURL& path,
323 const SnapshotFileCallback& callback) { 329 const SnapshotFileCallback& callback) {
324 DCHECK(CalledOnValidThread()); 330 DCHECK(CalledOnValidThread());
325 if (!operation_runner_) { 331 if (!operation_runner_) {
326 callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, 332 callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND,
327 base::PlatformFileInfo(), FilePath(), NULL); 333 base::PlatformFileInfo(), FilePath(), NULL);
328 delete file_system_operation_; 334 delete file_system_operation_;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 } 387 }
382 388
383 void SyncableFileSystemOperation::AbortOperation( 389 void SyncableFileSystemOperation::AbortOperation(
384 const StatusCallback& callback, 390 const StatusCallback& callback,
385 base::PlatformFileError error) { 391 base::PlatformFileError error) {
386 callback.Run(error); 392 callback.Run(error);
387 delete file_system_operation_; 393 delete file_system_operation_;
388 delete this; 394 delete this;
389 } 395 }
390 396
397 void SyncableFileSystemOperation::Destruct() {
398 delete this;
399 }
400
391 } // namespace fileapi 401 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/syncable/syncable_file_system_operation.h ('k') | webkit/fileapi/webkit_fileapi.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698