OLD | NEW |
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 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 const FilePath& remote_dest_file_path, | 217 const FilePath& remote_dest_file_path, |
218 const FileOperationCallback& callback); | 218 const FileOperationCallback& callback); |
219 | 219 |
220 // Invoked during the process of CreateFile. | 220 // Invoked during the process of CreateFile. |
221 // First, FindEntryByPathAsyncOnUIThread is called and the result is returned | 221 // First, FindEntryByPathAsyncOnUIThread is called and the result is returned |
222 // to OnGetEntryInfoForCreateFile. By using the information, CreateFile deals | 222 // to OnGetEntryInfoForCreateFile. By using the information, CreateFile deals |
223 // with the cases when an entry already existed at the path. If there was no | 223 // with the cases when an entry already existed at the path. If there was no |
224 // entry, a new empty file is uploaded, and when it finishes | 224 // entry, a new empty file is uploaded, and when it finishes |
225 // DidUploadForCreateBrandNewFile does the final clean up. | 225 // DidUploadForCreateBrandNewFile does the final clean up. |
226 // |callback| must not be null. | 226 // |callback| must not be null. |
227 void OnGetEntryInfoForCreateFile( | 227 void OnGetEntryInfoForCreateFile(const FilePath& file_path, |
228 const FilePath& file_path, | 228 bool is_exclusive, |
229 bool is_exclusive, | 229 const FileOperationCallback& callback, |
230 const FileOperationCallback& callback, | 230 GDataFileError result, |
231 GDataFileError result, | 231 scoped_ptr<GDataEntryProto> entry_proto); |
232 scoped_ptr<GDataEntryProto> entry_proto); | 232 void DoUploadForCreateBrandNewFile(const FilePath& remote_path, |
233 void DoUploadForCreateBrandNewFile( | 233 FilePath* local_path, |
234 const FilePath& remote_path, | 234 const FileOperationCallback& callback); |
235 FilePath* local_path, | 235 void DidUploadForCreateBrandNewFile(const FilePath& local_path, |
236 const FileOperationCallback& callback); | 236 const FileOperationCallback& callback, |
237 void DidUploadForCreateBrandNewFile( | 237 GDataFileError result); |
238 const FilePath& local_path, | |
239 const FileOperationCallback& callback, | |
240 GDataFileError result); | |
241 | 238 |
242 // Invoked upon completion of GetEntryInfoByPath initiated by | 239 // Invoked upon completion of GetEntryInfoByPath initiated by |
243 // GetFileByPath. It then continues to invoke GetResolvedFileByPath. | 240 // GetFileByPath. It then continues to invoke GetResolvedFileByPath. |
244 void OnGetEntryInfoCompleteForGetFileByPath( | 241 void OnGetEntryInfoCompleteForGetFileByPath( |
245 const FilePath& file_path, | 242 const FilePath& file_path, |
246 const GetFileCallback& get_file_callback, | 243 const GetFileCallback& get_file_callback, |
247 const GetContentCallback& get_content_callback, | 244 const GetContentCallback& get_content_callback, |
248 GDataFileError error, | 245 GDataFileError error, |
249 scoped_ptr<GDataEntryProto> file_info); | 246 scoped_ptr<GDataEntryProto> file_info); |
250 | 247 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 // FileMoveCallback to FileOperationCallback. | 415 // FileMoveCallback to FileOperationCallback. |
419 void OnFilePathUpdated(const FileOperationCallback& cllback, | 416 void OnFilePathUpdated(const FileOperationCallback& cllback, |
420 GDataFileError error, | 417 GDataFileError error, |
421 const FilePath& file_path); | 418 const FilePath& file_path); |
422 | 419 |
423 // Invoked upon completion of MarkDirtyInCache initiated by OpenFile. Invokes | 420 // Invoked upon completion of MarkDirtyInCache initiated by OpenFile. Invokes |
424 // |callback| with |cache_file_path|, which is the path of the cache file | 421 // |callback| with |cache_file_path|, which is the path of the cache file |
425 // ready for modification. | 422 // ready for modification. |
426 // | 423 // |
427 // Must be called on UI thread. | 424 // Must be called on UI thread. |
428 void OnMarkDirtyInCacheCompleteForOpenFile( | 425 void OnMarkDirtyInCacheCompleteForOpenFile(const OpenFileCallback& callback, |
429 const OpenFileCallback& callback, | 426 GDataFileError error, |
430 GDataFileError error, | 427 const std::string& resource_id, |
431 const std::string& resource_id, | 428 const std::string& md5, |
432 const std::string& md5, | 429 const FilePath& cache_file_path); |
433 const FilePath& cache_file_path); | |
434 | 430 |
435 // Callback for handling document copy attempt. | 431 // Callback for handling document copy attempt. |
436 // |callback| must not be null. | 432 // |callback| must not be null. |
437 void OnCopyDocumentCompleted(const FilePath& dir_path, | 433 void OnCopyDocumentCompleted(const FilePath& dir_path, |
438 const FileOperationCallback& callback, | 434 const FileOperationCallback& callback, |
439 GDataErrorCode status, | 435 GDataErrorCode status, |
440 scoped_ptr<base::Value> data); | 436 scoped_ptr<base::Value> data); |
441 | 437 |
442 // Callback for handling an attempt to move a file or directory from the | 438 // Callback for handling an attempt to move a file or directory from the |
443 // root directory to another directory on the server side. This function | 439 // root directory to another directory on the server side. This function |
444 // moves |entry| to the root directory on the client side with | 440 // moves |entry| to the root directory on the client side with |
445 // GDataDirectoryService::MoveEntryToDirectory(). | 441 // GDataDirectoryService::MoveEntryToDirectory(). |
446 // | 442 // |
447 // |callback| must not be null. | 443 // |callback| must not be null. |
448 void OnMoveEntryFromRootDirectoryCompleted( | 444 void OnMoveEntryFromRootDirectoryCompleted( |
449 const FileOperationCallback& callback, | 445 const FileOperationCallback& callback, |
450 const FilePath& file_path, | 446 const FilePath& file_path, |
451 const FilePath& dir_path, | 447 const FilePath& dir_path, |
452 GDataErrorCode status, | 448 GDataErrorCode status, |
453 const GURL& document_url); | 449 const GURL& document_url); |
454 | 450 |
455 // Callback for handling account metadata fetch. | 451 // Callback for handling account metadata fetch. |
456 void OnGetAvailableSpace( | 452 void OnGetAvailableSpace(const GetAvailableSpaceCallback& callback, |
457 const GetAvailableSpaceCallback& callback, | 453 GDataErrorCode status, |
458 GDataErrorCode status, | 454 scoped_ptr<base::Value> data); |
459 scoped_ptr<base::Value> data); | |
460 | 455 |
461 // Callback for handling Drive V2 about resource fetch. | 456 // Callback for handling Drive V2 about resource fetch. |
462 void OnGetAboutResource( | 457 void OnGetAboutResource(const GetAvailableSpaceCallback& callback, |
463 const GetAvailableSpaceCallback& callback, | 458 GDataErrorCode status, |
464 GDataErrorCode status, | 459 scoped_ptr<base::Value> data); |
465 scoped_ptr<base::Value> data); | |
466 | 460 |
467 // Callback for handling document remove attempt. | 461 // Callback for handling document remove attempt. |
468 void OnRemovedDocument( | 462 void OnRemovedDocument(const FileOperationCallback& callback, |
469 const FileOperationCallback& callback, | 463 const FilePath& file_path, |
470 const FilePath& file_path, | 464 GDataErrorCode status, |
471 GDataErrorCode status, | 465 const GURL& document_url); |
472 const GURL& document_url); | |
473 | 466 |
474 // Callback for handling directory create requests. | 467 // Callback for handling directory create requests. |
475 void OnCreateDirectoryCompleted( | 468 void OnCreateDirectoryCompleted(const CreateDirectoryParams& params, |
476 const CreateDirectoryParams& params, | 469 GDataErrorCode status, |
477 GDataErrorCode status, | 470 scoped_ptr<base::Value> created_entry); |
478 scoped_ptr<base::Value> created_entry); | |
479 | 471 |
480 // Callback for handling file downloading requests. | 472 // Callback for handling file downloading requests. |
481 void OnFileDownloaded( | 473 void OnFileDownloaded(const GetFileFromCacheParams& params, |
482 const GetFileFromCacheParams& params, | 474 GDataErrorCode status, |
483 GDataErrorCode status, | 475 const GURL& content_url, |
484 const GURL& content_url, | 476 const FilePath& downloaded_file_path); |
485 const FilePath& downloaded_file_path); | |
486 | 477 |
487 // Unpins file if cache entry is pinned. | 478 // Unpins file if cache entry is pinned. |
488 void UnpinIfPinned(const std::string& resource_id, | 479 void UnpinIfPinned(const std::string& resource_id, |
489 const std::string& md5, | 480 const std::string& md5, |
490 bool success, | 481 bool success, |
491 const GDataCacheEntry& cache_entry); | 482 const GDataCacheEntry& cache_entry); |
492 | 483 |
493 // Similar to OnFileDownloaded() but takes |has_enough_space| so we report | 484 // Similar to OnFileDownloaded() but takes |has_enough_space| so we report |
494 // an error in case we don't have enough disk space. | 485 // an error in case we don't have enough disk space. |
495 void OnFileDownloadedAndSpaceChecked( | 486 void OnFileDownloadedAndSpaceChecked(const GetFileFromCacheParams& params, |
496 const GetFileFromCacheParams& params, | 487 GDataErrorCode status, |
497 GDataErrorCode status, | 488 const GURL& content_url, |
498 const GURL& content_url, | 489 const FilePath& downloaded_file_path, |
499 const FilePath& downloaded_file_path, | 490 bool* has_enough_space); |
500 bool* has_enough_space); | |
501 | 491 |
502 // Callback for handling internal StoreToCache() calls after downloading | 492 // Callback for handling internal StoreToCache() calls after downloading |
503 // file content. | 493 // file content. |
504 void OnDownloadStoredToCache(GDataFileError error, | 494 void OnDownloadStoredToCache(GDataFileError error, |
505 const std::string& resource_id, | 495 const std::string& resource_id, |
506 const std::string& md5); | 496 const std::string& md5); |
507 | 497 |
508 // Callback for handling resource rename attempt. Renames a file or | 498 // Callback for handling resource rename attempt. Renames a file or |
509 // directory at |file_path| on the client side. | 499 // directory at |file_path| on the client side. |
510 // |callback| must not be null. | 500 // |callback| must not be null. |
511 void RenameEntryLocally(const FilePath& file_path, | 501 void RenameEntryLocally(const FilePath& file_path, |
512 const FilePath::StringType& new_name, | 502 const FilePath::StringType& new_name, |
513 const FileMoveCallback& callback, | 503 const FileMoveCallback& callback, |
514 GDataErrorCode status, | 504 GDataErrorCode status, |
515 const GURL& document_url); | 505 const GURL& document_url); |
516 | 506 |
517 // Callback for handling an attempt to remove a file or directory from | 507 // Callback for handling an attempt to remove a file or directory from |
518 // another directory. Moves a file or directory at |file_path| to root on | 508 // another directory. Moves a file or directory at |file_path| to root on |
519 // the client side. | 509 // the client side. |
520 // |callback| must not be null. | 510 // |callback| must not be null. |
521 void MoveEntryToRootDirectoryLocally( | 511 void MoveEntryToRootDirectoryLocally(const FileMoveCallback& callback, |
522 const FileMoveCallback& callback, | 512 const FilePath& file_path, |
523 const FilePath& file_path, | 513 const FilePath& dir_path, |
524 const FilePath& dir_path, | 514 GDataErrorCode status, |
525 GDataErrorCode status, | 515 const GURL& document_url); |
526 const GURL& document_url); | |
527 | 516 |
528 // Removes a file or directory under |file_path| on the client side and the | 517 // Removes a file or directory under |file_path| on the client side and the |
529 // corresponding file from cache if it exists. Returns PLATFORM_FILE_OK if | 518 // corresponding file from cache if it exists. Returns PLATFORM_FILE_OK if |
530 // successful. | 519 // successful. |
531 GDataFileError RemoveEntryAndCacheLocally(const FilePath& file_path); | 520 GDataFileError RemoveEntryAndCacheLocally(const FilePath& file_path); |
532 | 521 |
533 // Callback when an entry is moved to another directory on the client side. | 522 // Callback when an entry is moved to another directory on the client side. |
534 // Notifies the directory change and runs |callback|. | 523 // Notifies the directory change and runs |callback|. |
535 // |callback| must not be null. | 524 // |callback| must not be null. |
536 void NotifyAndRunFileMoveCallback( | 525 void NotifyAndRunFileMoveCallback( |
(...skipping 11 matching lines...) Expand all Loading... |
548 | 537 |
549 // Callback for GetEntryByResourceIdAsync. | 538 // Callback for GetEntryByResourceIdAsync. |
550 // Removes stale entry upon upload of file. | 539 // Removes stale entry upon upload of file. |
551 static void RemoveStaleEntryOnUpload(const std::string& resource_id, | 540 static void RemoveStaleEntryOnUpload(const std::string& resource_id, |
552 GDataDirectory* parent_dir, | 541 GDataDirectory* parent_dir, |
553 GDataEntry* existing_entry); | 542 GDataEntry* existing_entry); |
554 | 543 |
555 // Converts |entry_value| into GFileDocument instance and adds it | 544 // Converts |entry_value| into GFileDocument instance and adds it |
556 // to virtual file system at |directory_path|. | 545 // to virtual file system at |directory_path|. |
557 GDataFileError AddNewDirectory(const FilePath& directory_path, | 546 GDataFileError AddNewDirectory(const FilePath& directory_path, |
558 base::Value* entry_value); | 547 base::Value* entry_value); |
559 | 548 |
560 // Given non-existing |directory_path|, finds the first missing parent | 549 // Given non-existing |directory_path|, finds the first missing parent |
561 // directory of |directory_path|. | 550 // directory of |directory_path|. |
562 FindMissingDirectoryResult FindFirstMissingParentDirectory( | 551 FindMissingDirectoryResult FindFirstMissingParentDirectory( |
563 const FilePath& directory_path, | 552 const FilePath& directory_path, |
564 GURL* last_dir_content_url, | 553 GURL* last_dir_content_url, |
565 FilePath* first_missing_parent_path); | 554 FilePath* first_missing_parent_path); |
566 | 555 |
567 // Callback for handling results of ReloadFeedFromServerIfNeeded() initiated | 556 // Callback for handling results of ReloadFeedFromServerIfNeeded() initiated |
568 // from CheckForUpdates(). This callback checks whether feed is successfully | 557 // from CheckForUpdates(). This callback checks whether feed is successfully |
569 // reloaded, and in case of failure, restores the content origin of the root | 558 // reloaded, and in case of failure, restores the content origin of the root |
570 // directory. | 559 // directory. |
571 void OnUpdateChecked(ContentOrigin initial_origin, | 560 void OnUpdateChecked(ContentOrigin initial_origin, |
572 GDataFileError error, | 561 GDataFileError error, |
573 GDataEntry* entry); | 562 GDataEntry* entry); |
574 | 563 |
575 // Runs the callback and notifies that the initial load is finished. | 564 // Runs the callback and notifies that the initial load is finished. |
576 void RunAndNotifyInitialLoadFinished( | 565 void RunAndNotifyInitialLoadFinished(const FindEntryCallback& callback, |
577 const FindEntryCallback& callback, | 566 GDataFileError error, |
578 GDataFileError error, | 567 GDataEntry* entry); |
579 GDataEntry* entry); | |
580 | 568 |
581 // Helper function that completes bookkeeping tasks related to | 569 // Helper function that completes bookkeeping tasks related to |
582 // completed file transfer. | 570 // completed file transfer. |
583 void OnTransferCompleted( | 571 void OnTransferCompleted(const FileOperationCallback& callback, |
584 const FileOperationCallback& callback, | 572 GDataFileError error, |
585 GDataFileError error, | 573 scoped_ptr<UploadFileInfo> upload_file_info); |
586 scoped_ptr<UploadFileInfo> upload_file_info); | |
587 | 574 |
588 // Kicks off file upload once it receives |file_size| and |content_type|. | 575 // Kicks off file upload once it receives |file_size| and |content_type|. |
589 void StartFileUploadOnUIThread( | 576 void StartFileUploadOnUIThread(const StartFileUploadParams& params, |
590 const StartFileUploadParams& params, | 577 GDataFileError* error, |
591 GDataFileError* error, | 578 int64* file_size, |
592 int64* file_size, | 579 std::string* content_type); |
593 std::string* content_type); | |
594 | 580 |
595 // Part of StartFileUploadOnUIThread(). Called after GetEntryInfoByPath() | 581 // Part of StartFileUploadOnUIThread(). Called after GetEntryInfoByPath() |
596 // is complete. | 582 // is complete. |
597 void StartFileUploadOnUIThreadAfterGetEntryInfo( | 583 void StartFileUploadOnUIThreadAfterGetEntryInfo( |
598 const StartFileUploadParams& params, | 584 const StartFileUploadParams& params, |
599 int64 file_size, | 585 int64 file_size, |
600 std::string content_type, | 586 std::string content_type, |
601 GDataFileError error, | 587 GDataFileError error, |
602 scoped_ptr<GDataEntryProto> entry_proto); | 588 scoped_ptr<GDataEntryProto> entry_proto); |
603 | 589 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 // OnGetEntryInfoCompleteForOpenFile. | 648 // OnGetEntryInfoCompleteForOpenFile. |
663 void GetResolvedFileByPath( | 649 void GetResolvedFileByPath( |
664 const FilePath& file_path, | 650 const FilePath& file_path, |
665 const GetFileCallback& get_file_callback, | 651 const GetFileCallback& get_file_callback, |
666 const GetContentCallback& get_content_callback, | 652 const GetContentCallback& get_content_callback, |
667 GDataFileError error, | 653 GDataFileError error, |
668 const GDataEntryProto* entry_proto); | 654 const GDataEntryProto* entry_proto); |
669 | 655 |
670 // Called when GDataCache::GetFileOnUIThread() is completed for | 656 // Called when GDataCache::GetFileOnUIThread() is completed for |
671 // UpdateFileByResourceId(). | 657 // UpdateFileByResourceId(). |
672 void OnGetFileCompleteForUpdateFile( | 658 void OnGetFileCompleteForUpdateFile(const FileOperationCallback& callback, |
673 const FileOperationCallback& callback, | 659 GDataFileError error, |
674 GDataFileError error, | 660 const std::string& resource_id, |
675 const std::string& resource_id, | 661 const std::string& md5, |
676 const std::string& md5, | 662 const FilePath& cache_file_path); |
677 const FilePath& cache_file_path); | |
678 | 663 |
679 // Callback for getting the size of the cache file in the blocking pool. | 664 // Callback for getting the size of the cache file in the blocking pool. |
680 void OnGetFileSizeCompleteForUpdateFile( | 665 void OnGetFileSizeCompleteForUpdateFile(const FileOperationCallback& callback, |
681 const FileOperationCallback& callback, | 666 const std::string& resource_id, |
682 const std::string& resource_id, | 667 const std::string& md5, |
683 const std::string& md5, | 668 const FilePath& cache_file_path, |
684 const FilePath& cache_file_path, | 669 GDataFileError* error, |
685 GDataFileError* error, | 670 int64* file_size); |
686 int64* file_size); | |
687 | 671 |
688 // Callback for GDataRootDirectory::GetEntryByResourceIdAsync. | 672 // Callback for GDataRootDirectory::GetEntryByResourceIdAsync. |
689 void OnGetFileCompleteForUpdateFileByEntry( | 673 void OnGetFileCompleteForUpdateFileByEntry( |
690 const FileOperationCallback& callback, | 674 const FileOperationCallback& callback, |
691 const std::string& md5, | 675 const std::string& md5, |
692 int64 file_size, | 676 int64 file_size, |
693 const FilePath& cache_file_path, | 677 const FilePath& cache_file_path, |
694 GDataEntry* entry); | 678 GDataEntry* entry); |
695 | 679 |
696 // Called when GDataUploader::UploadUpdatedFile() is completed for | 680 // Called when GDataUploader::UploadUpdatedFile() is completed for |
697 // UpdateFileByResourceId(). | 681 // UpdateFileByResourceId(). |
698 void OnUpdatedFileUploaded( | 682 void OnUpdatedFileUploaded(const FileOperationCallback& callback, |
699 const FileOperationCallback& callback, | 683 GDataFileError error, |
700 GDataFileError error, | 684 scoped_ptr<UploadFileInfo> upload_file_info); |
701 scoped_ptr<UploadFileInfo> upload_file_info); | |
702 | 685 |
703 // The following functions are used to forward calls to asynchronous public | 686 // The following functions are used to forward calls to asynchronous public |
704 // member functions to UI thread. | 687 // member functions to UI thread. |
705 void SearchAsyncOnUIThread(const std::string& search_query, | 688 void SearchAsyncOnUIThread(const std::string& search_query, |
706 const GURL& next_feed, | 689 const GURL& next_feed, |
707 const SearchCallback& callback); | 690 const SearchCallback& callback); |
708 void OpenFileOnUIThread(const FilePath& file_path, | 691 void OpenFileOnUIThread(const FilePath& file_path, |
709 const OpenFileCallback& callback); | 692 const OpenFileCallback& callback); |
710 void CloseFileOnUIThread(const FilePath& file_path, | 693 void CloseFileOnUIThread(const FilePath& file_path, |
711 const FileOperationCallback& callback); | 694 const FileOperationCallback& callback); |
(...skipping 21 matching lines...) Expand all Loading... |
733 const std::string& resource_id, | 716 const std::string& resource_id, |
734 const GetFileCallback& get_file_callback, | 717 const GetFileCallback& get_file_callback, |
735 const GetContentCallback& get_content_callback); | 718 const GetContentCallback& get_content_callback); |
736 void GetFileByEntryOnUIThread( | 719 void GetFileByEntryOnUIThread( |
737 const GetFileCallback& get_file_callback, | 720 const GetFileCallback& get_file_callback, |
738 const GetContentCallback& get_content_callback, | 721 const GetContentCallback& get_content_callback, |
739 GDataEntry* entry); | 722 GDataEntry* entry); |
740 void GetEntryInfoByEntryOnUIThread( | 723 void GetEntryInfoByEntryOnUIThread( |
741 const GetEntryInfoWithFilePathCallback& callback, | 724 const GetEntryInfoWithFilePathCallback& callback, |
742 GDataEntry* entry); | 725 GDataEntry* entry); |
743 void UpdateFileByResourceIdOnUIThread( | 726 void UpdateFileByResourceIdOnUIThread(const std::string& resource_id, |
744 const std::string& resource_id, | 727 const FileOperationCallback& callback); |
745 const FileOperationCallback& callback); | |
746 void UpdateFileByEntryOnUIThread(const FileOperationCallback& callback, | 728 void UpdateFileByEntryOnUIThread(const FileOperationCallback& callback, |
747 GDataEntry* entry); | 729 GDataEntry* entry); |
748 void GetEntryInfoByPathAsyncOnUIThread( | 730 void GetEntryInfoByPathAsyncOnUIThread(const FilePath& file_path, |
749 const FilePath& file_path, | 731 const GetEntryInfoCallback& callback); |
750 const GetEntryInfoCallback& callback); | |
751 void GetEntryInfoByResourceIdOnUIThread( | 732 void GetEntryInfoByResourceIdOnUIThread( |
752 const std::string& resource_id, | 733 const std::string& resource_id, |
753 const GetEntryInfoWithFilePathCallback& callback); | 734 const GetEntryInfoWithFilePathCallback& callback); |
754 void ReadDirectoryByPathAsyncOnUIThread( | 735 void ReadDirectoryByPathAsyncOnUIThread( |
755 const FilePath& file_path, | 736 const FilePath& file_path, |
756 const ReadDirectoryWithSettingCallback& callback); | 737 const ReadDirectoryWithSettingCallback& callback); |
757 void RequestDirectoryRefreshOnUIThread( | 738 void RequestDirectoryRefreshOnUIThread(const FilePath& file_path); |
758 const FilePath& file_path); | |
759 void OnRequestDirectoryRefresh(GetDocumentsParams* params, | 739 void OnRequestDirectoryRefresh(GetDocumentsParams* params, |
760 GDataFileError error); | 740 GDataFileError error); |
761 void RequestDirectoryRefreshByEntry( | 741 void RequestDirectoryRefreshByEntry(const FilePath& directory_path, |
762 const FilePath& directory_path, | 742 const std::string& directory_resource_id, |
763 const std::string& directory_resource_id, | 743 const FileResourceIdMap& file_map, |
764 const FileResourceIdMap& file_map, | 744 GDataEntry* directory_entry); |
765 GDataEntry* directory_entry); | |
766 void GetAvailableSpaceOnUIThread(const GetAvailableSpaceCallback& callback); | 745 void GetAvailableSpaceOnUIThread(const GetAvailableSpaceCallback& callback); |
767 void AddUploadedFileOnUIThread(UploadMode upload_mode, | 746 void AddUploadedFileOnUIThread(UploadMode upload_mode, |
768 const FilePath& virtual_dir_path, | 747 const FilePath& virtual_dir_path, |
769 scoped_ptr<DocumentEntry> entry, | 748 scoped_ptr<DocumentEntry> entry, |
770 const FilePath& file_content_path, | 749 const FilePath& file_content_path, |
771 GDataCache::FileOperationType cache_operation, | 750 GDataCache::FileOperationType cache_operation, |
772 const base::Closure& callback); | 751 const base::Closure& callback); |
773 | 752 |
774 // Part of CopyOnUIThread(). Called after GetEntryInfoPairByPaths() is | 753 // Part of CopyOnUIThread(). Called after GetEntryInfoPairByPaths() is |
775 // complete. |callback| must not be null. | 754 // complete. |callback| must not be null. |
776 void CopyOnUIThreadAfterGetEntryInfoPair( | 755 void CopyOnUIThreadAfterGetEntryInfoPair( |
777 const FilePath& dest_file_path, | 756 const FilePath& dest_file_path, |
778 const FileOperationCallback& callback, | 757 const FileOperationCallback& callback, |
779 scoped_ptr<EntryInfoPairResult> result); | 758 scoped_ptr<EntryInfoPairResult> result); |
780 | 759 |
781 // Part of MoveOnUIThread(). Called after GetEntryInfoPairByPaths() is | 760 // Part of MoveOnUIThread(). Called after GetEntryInfoPairByPaths() is |
782 // complete. |callback| must not be null. | 761 // complete. |callback| must not be null. |
783 void MoveOnUIThreadAfterGetEntryInfoPair( | 762 void MoveOnUIThreadAfterGetEntryInfoPair( |
784 const FilePath& dest_file_path, | 763 const FilePath& dest_file_path, |
785 const FileOperationCallback& callback, | 764 const FileOperationCallback& callback, |
786 scoped_ptr<EntryInfoPairResult> result); | 765 scoped_ptr<EntryInfoPairResult> result); |
787 | 766 |
788 // Part of RemoveOnUIThread(). Called after GetEntryInfoByPath() is | 767 // Part of RemoveOnUIThread(). Called after GetEntryInfoByPath() is |
789 // complete. | 768 // complete. |
790 void RemoveOnUIThreadAfterGetEntryInfo( | 769 void RemoveOnUIThreadAfterGetEntryInfo( |
791 const FilePath& file_path, | 770 const FilePath& file_path, |
792 bool is_recursive, | 771 bool is_recursive, |
793 const FileOperationCallback& callback, | 772 const FileOperationCallback& callback, |
794 GDataFileError error, | 773 GDataFileError error, |
795 scoped_ptr<GDataEntryProto> entry_proto); | 774 scoped_ptr<GDataEntryProto> entry_proto); |
796 | 775 |
797 // Part of RequestDirectoryRefreshOnUIThread(). Called after | 776 // Part of RequestDirectoryRefreshOnUIThread(). Called after |
798 // GetEntryInfoByPath() is complete. | 777 // GetEntryInfoByPath() is complete. |
799 void RequestDirectoryRefreshOnUIThreadAfterGetEntryInfo( | 778 void RequestDirectoryRefreshOnUIThreadAfterGetEntryInfo( |
800 const FilePath& file_path, | 779 const FilePath& file_path, |
801 GDataFileError error, | 780 GDataFileError error, |
802 scoped_ptr<GDataEntryProto> entry_proto); | 781 scoped_ptr<GDataEntryProto> entry_proto); |
803 | 782 |
804 // Part of GetEntryByResourceId and GetEntryByPath. Checks whether there is a | 783 // Part of GetEntryByResourceId and GetEntryByPath. Checks whether there is a |
805 // local dirty cache for the entry, and if there is, replace the | 784 // local dirty cache for the entry, and if there is, replace the |
806 // PlatformFileInfo part of the |entry_proto| with the locally modified info. | 785 // PlatformFileInfo part of the |entry_proto| with the locally modified info. |
807 void CheckLocalModificationAndRun(scoped_ptr<GDataEntryProto> entry_proto, | 786 void CheckLocalModificationAndRun(scoped_ptr<GDataEntryProto> entry_proto, |
808 const GetEntryInfoCallback& callback); | 787 const GetEntryInfoCallback& callback); |
809 void CheckLocalModificationAndRunAfterGetCacheEntry( | 788 void CheckLocalModificationAndRunAfterGetCacheEntry( |
810 scoped_ptr<GDataEntryProto> entry_proto, | 789 scoped_ptr<GDataEntryProto> entry_proto, |
811 const GetEntryInfoCallback& callback, | 790 const GetEntryInfoCallback& callback, |
812 bool success, | 791 bool success, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 // invalidate the weak pointers before any other members are destroyed. | 845 // invalidate the weak pointers before any other members are destroyed. |
867 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; | 846 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; |
868 // Unlike other classes, we need this as we need this to redirect a task | 847 // Unlike other classes, we need this as we need this to redirect a task |
869 // from IO thread to UI thread. | 848 // from IO thread to UI thread. |
870 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; | 849 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; |
871 }; | 850 }; |
872 | 851 |
873 } // namespace gdata | 852 } // namespace gdata |
874 | 853 |
875 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 854 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
OLD | NEW |