OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_system_operation.h" | 5 #include "webkit/fileapi/file_system_operation.h" |
6 | 6 |
7 #include "base/time.h" | 7 #include "base/time.h" |
8 #include "net/url_request/url_request_context.h" | 8 #include "net/url_request/url_request_context.h" |
9 #include "webkit/fileapi/file_system_callback_dispatcher.h" | 9 #include "webkit/fileapi/file_system_callback_dispatcher.h" |
10 #include "webkit/fileapi/file_system_context.h" | 10 #include "webkit/fileapi/file_system_context.h" |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 } else if (rv == base::PLATFORM_FILE_OK) { | 447 } else if (rv == base::PLATFORM_FILE_OK) { |
448 dispatcher_->DidSucceed(); | 448 dispatcher_->DidSucceed(); |
449 } else { | 449 } else { |
450 dispatcher_->DidFail(rv); | 450 dispatcher_->DidFail(rv); |
451 } | 451 } |
452 delete this; | 452 delete this; |
453 } | 453 } |
454 | 454 |
455 void FileSystemOperation::DidDirectoryExists( | 455 void FileSystemOperation::DidDirectoryExists( |
456 base::PlatformFileError rv, | 456 base::PlatformFileError rv, |
457 const base::PlatformFileInfo& file_info) { | 457 const base::PlatformFileInfo& file_info, |
| 458 const FilePath& unused) { |
458 if (rv == base::PLATFORM_FILE_OK) { | 459 if (rv == base::PLATFORM_FILE_OK) { |
459 if (file_info.is_directory) | 460 if (file_info.is_directory) |
460 dispatcher_->DidSucceed(); | 461 dispatcher_->DidSucceed(); |
461 else | 462 else |
462 dispatcher_->DidFail(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY); | 463 dispatcher_->DidFail(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY); |
463 } else { | 464 } else { |
464 dispatcher_->DidFail(rv); | 465 dispatcher_->DidFail(rv); |
465 } | 466 } |
466 delete this; | 467 delete this; |
467 } | 468 } |
468 | 469 |
469 void FileSystemOperation::DidFileExists( | 470 void FileSystemOperation::DidFileExists( |
470 base::PlatformFileError rv, | 471 base::PlatformFileError rv, |
471 const base::PlatformFileInfo& file_info) { | 472 const base::PlatformFileInfo& file_info, |
| 473 const FilePath& unused) { |
472 if (rv == base::PLATFORM_FILE_OK) { | 474 if (rv == base::PLATFORM_FILE_OK) { |
473 if (file_info.is_directory) | 475 if (file_info.is_directory) |
474 dispatcher_->DidFail(base::PLATFORM_FILE_ERROR_NOT_A_FILE); | 476 dispatcher_->DidFail(base::PLATFORM_FILE_ERROR_NOT_A_FILE); |
475 else | 477 else |
476 dispatcher_->DidSucceed(); | 478 dispatcher_->DidSucceed(); |
477 } else { | 479 } else { |
478 dispatcher_->DidFail(rv); | 480 dispatcher_->DidFail(rv); |
479 } | 481 } |
480 delete this; | 482 delete this; |
481 } | 483 } |
482 | 484 |
483 void FileSystemOperation::DidGetMetadata( | 485 void FileSystemOperation::DidGetMetadata( |
484 base::PlatformFileError rv, | 486 base::PlatformFileError rv, |
485 const base::PlatformFileInfo& file_info) { | 487 const base::PlatformFileInfo& file_info, |
| 488 const FilePath& platform_path) { |
486 if (rv == base::PLATFORM_FILE_OK) | 489 if (rv == base::PLATFORM_FILE_OK) |
487 dispatcher_->DidReadMetadata(file_info); | 490 dispatcher_->DidReadMetadata(file_info, platform_path); |
488 else | 491 else |
489 dispatcher_->DidFail(rv); | 492 dispatcher_->DidFail(rv); |
490 delete this; | 493 delete this; |
491 } | 494 } |
492 | 495 |
493 void FileSystemOperation::DidReadDirectory( | 496 void FileSystemOperation::DidReadDirectory( |
494 base::PlatformFileError rv, | 497 base::PlatformFileError rv, |
495 const std::vector<base::FileUtilProxy::Entry>& entries) { | 498 const std::vector<base::FileUtilProxy::Entry>& entries) { |
496 | 499 |
497 if (rv == base::PLATFORM_FILE_OK) | 500 if (rv == base::PLATFORM_FILE_OK) |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 } | 589 } |
587 // TODO(kinuko): the check must be moved to QuotaFileSystemFileUtil. | 590 // TODO(kinuko): the check must be moved to QuotaFileSystemFileUtil. |
588 if (!file_system_context()->IsStorageUnlimited(*origin_url)) { | 591 if (!file_system_context()->IsStorageUnlimited(*origin_url)) { |
589 dispatcher_->DidFail(base::PLATFORM_FILE_ERROR_NO_SPACE); | 592 dispatcher_->DidFail(base::PLATFORM_FILE_ERROR_NO_SPACE); |
590 return false; | 593 return false; |
591 } | 594 } |
592 return true; | 595 return true; |
593 } | 596 } |
594 | 597 |
595 } // namespace fileapi | 598 } // namespace fileapi |
OLD | NEW |