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

Side by Side Diff: webkit/browser/fileapi/local_file_system_operation.cc

Issue 15754005: Fix dependency: make file_system_util not depend on FileSystemURL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
« no previous file with comments | « webkit/browser/fileapi/cross_operation_delegate.cc ('k') | webkit/fileapi/file_system_url.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser/fileapi/local_file_system_operation.h" 5 #include "webkit/browser/fileapi/local_file_system_operation.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 operation_context(), url, 510 operation_context(), url,
511 base::Bind(&LocalFileSystemOperation::DidFinishFileOperation, 511 base::Bind(&LocalFileSystemOperation::DidFinishFileOperation,
512 base::Owned(this), callback)); 512 base::Owned(this), callback));
513 } 513 }
514 514
515 void LocalFileSystemOperation::CopyFileLocal( 515 void LocalFileSystemOperation::CopyFileLocal(
516 const FileSystemURL& src_url, 516 const FileSystemURL& src_url,
517 const FileSystemURL& dest_url, 517 const FileSystemURL& dest_url,
518 const StatusCallback& callback) { 518 const StatusCallback& callback) {
519 DCHECK(SetPendingOperationType(kOperationCopy)); 519 DCHECK(SetPendingOperationType(kOperationCopy));
520 DCHECK(AreSameFileSystem(src_url, dest_url)); 520 DCHECK(src_url.IsInSameFileSystem(dest_url));
521 521
522 base::PlatformFileError result = SetUp(src_url, OPERATION_MODE_READ); 522 base::PlatformFileError result = SetUp(src_url, OPERATION_MODE_READ);
523 if (result == base::PLATFORM_FILE_OK) 523 if (result == base::PLATFORM_FILE_OK)
524 result = SetUp(dest_url, OPERATION_MODE_WRITE); 524 result = SetUp(dest_url, OPERATION_MODE_WRITE);
525 if (result != base::PLATFORM_FILE_OK) { 525 if (result != base::PLATFORM_FILE_OK) {
526 callback.Run(result); 526 callback.Run(result);
527 delete this; 527 delete this;
528 return; 528 return;
529 } 529 }
530 530
531 GetUsageAndQuotaThenRunTask( 531 GetUsageAndQuotaThenRunTask(
532 dest_url, 532 dest_url,
533 base::Bind(&LocalFileSystemOperation::DoCopyFileLocal, 533 base::Bind(&LocalFileSystemOperation::DoCopyFileLocal,
534 base::Unretained(this), src_url, dest_url, callback), 534 base::Unretained(this), src_url, dest_url, callback),
535 base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED)); 535 base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED));
536 } 536 }
537 537
538 void LocalFileSystemOperation::MoveFileLocal( 538 void LocalFileSystemOperation::MoveFileLocal(
539 const FileSystemURL& src_url, 539 const FileSystemURL& src_url,
540 const FileSystemURL& dest_url, 540 const FileSystemURL& dest_url,
541 const StatusCallback& callback) { 541 const StatusCallback& callback) {
542 DCHECK(SetPendingOperationType(kOperationMove)); 542 DCHECK(SetPendingOperationType(kOperationMove));
543 DCHECK(AreSameFileSystem(src_url, dest_url)); 543 DCHECK(src_url.IsInSameFileSystem(dest_url));
544 544
545 base::PlatformFileError result = SetUp(src_url, OPERATION_MODE_WRITE); 545 base::PlatformFileError result = SetUp(src_url, OPERATION_MODE_WRITE);
546 if (result == base::PLATFORM_FILE_OK) 546 if (result == base::PLATFORM_FILE_OK)
547 result = SetUp(dest_url, OPERATION_MODE_WRITE); 547 result = SetUp(dest_url, OPERATION_MODE_WRITE);
548 if (result != base::PLATFORM_FILE_OK) { 548 if (result != base::PLATFORM_FILE_OK) {
549 callback.Run(result); 549 callback.Run(result);
550 delete this; 550 delete this;
551 return; 551 return;
552 } 552 }
553 553
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 } 871 }
872 872
873 bool LocalFileSystemOperation::SetPendingOperationType(OperationType type) { 873 bool LocalFileSystemOperation::SetPendingOperationType(OperationType type) {
874 if (pending_operation_ != kOperationNone) 874 if (pending_operation_ != kOperationNone)
875 return false; 875 return false;
876 pending_operation_ = type; 876 pending_operation_ = type;
877 return true; 877 return true;
878 } 878 }
879 879
880 } // namespace fileapi 880 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/cross_operation_delegate.cc ('k') | webkit/fileapi/file_system_url.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698