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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
10 | 10 |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 GDataEntry* GetGDataEntryByPath(const FilePath& file_path); | 579 GDataEntry* GetGDataEntryByPath(const FilePath& file_path); |
580 | 580 |
581 // Inits cache directory paths in the provided root. | 581 // Inits cache directory paths in the provided root. |
582 // Should be called before cache is initialized. | 582 // Should be called before cache is initialized. |
583 void SetCachePaths(const FilePath& root_path); | 583 void SetCachePaths(const FilePath& root_path); |
584 | 584 |
585 // Initiates upload operation of file defined with |file_name|, | 585 // Initiates upload operation of file defined with |file_name|, |
586 // |content_type| and |content_length|. The operation will place the newly | 586 // |content_type| and |content_length|. The operation will place the newly |
587 // created file entity into |destination_directory|. | 587 // created file entity into |destination_directory|. |
588 // | 588 // |
589 // Can be called from UI/IO thread. |callback| is run on the calling thread. | 589 // Can be called from *UI* thread. |callback| is run on the calling thread. |
| 590 // TODO(satorux,achuith): Remove this: crosbug.com/29943 |
590 void InitiateUpload(const std::string& file_name, | 591 void InitiateUpload(const std::string& file_name, |
591 const std::string& content_type, | 592 const std::string& content_type, |
592 int64 content_length, | 593 int64 content_length, |
593 const FilePath& destination_directory, | 594 const FilePath& destination_directory, |
594 const FilePath& virtual_path, | 595 const FilePath& virtual_path, |
595 const InitiateUploadCallback& callback); | 596 const InitiateUploadCallback& callback); |
596 | 597 |
597 // Resumes upload operation for chunk of file defined in |params.. | 598 // Resumes upload operation for chunk of file defined in |params.. |
598 // | 599 // |
599 // Can be called from UI/IO thread. |callback| is run on the calling thread. | 600 // Can be called from *UI* thread. |callback| is run on the calling thread. |
| 601 // TODO(satorux,achuith): Remove this: crosbug.com/29943 |
600 void ResumeUpload(const ResumeUploadParams& params, | 602 void ResumeUpload(const ResumeUploadParams& params, |
601 const ResumeFileUploadCallback& callback); | 603 const ResumeFileUploadCallback& callback); |
602 | 604 |
603 // Unsafe (unlocked) version of FindEntryByPathSync method. | 605 // Unsafe (unlocked) version of FindEntryByPathSync method. |
604 void UnsafeFindEntryByPath(const FilePath& file_path, | 606 void UnsafeFindEntryByPath(const FilePath& file_path, |
605 FindEntryDelegate* delegate); | 607 FindEntryDelegate* delegate); |
606 | 608 |
607 // Converts document feed from gdata service into DirectoryInfo. On failure, | 609 // Converts document feed from gdata service into DirectoryInfo. On failure, |
608 // returns NULL and fills in |error| with an appropriate value. | 610 // returns NULL and fills in |error| with an appropriate value. |
609 GDataDirectory* ParseGDataFeed(GDataErrorCode status, | 611 GDataDirectory* ParseGDataFeed(GDataErrorCode status, |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 const GURL& content_url, | 765 const GURL& content_url, |
764 const FilePath& downloaded_file_path, | 766 const FilePath& downloaded_file_path, |
765 bool* has_enough_space); | 767 bool* has_enough_space); |
766 | 768 |
767 // Callback for handling internal StoreToCache() calls after downloading | 769 // Callback for handling internal StoreToCache() calls after downloading |
768 // file content. | 770 // file content. |
769 void OnDownloadStoredToCache(base::PlatformFileError error, | 771 void OnDownloadStoredToCache(base::PlatformFileError error, |
770 const std::string& resource_id, | 772 const std::string& resource_id, |
771 const std::string& md5); | 773 const std::string& md5); |
772 | 774 |
773 // Callback for handling file upload initialization requests. | |
774 void OnUploadLocationReceived( | |
775 const InitiateUploadCallback& callback, | |
776 scoped_refptr<base::MessageLoopProxy> message_loop_proxy, | |
777 GDataErrorCode code, | |
778 const GURL& upload_location); | |
779 | |
780 // Callback for handling file upload resume requests. | |
781 void OnResumeUpload( | |
782 scoped_refptr<base::MessageLoopProxy> message_loop_proxy, | |
783 const ResumeFileUploadCallback& callback, | |
784 const ResumeUploadResponse& response, | |
785 scoped_ptr<DocumentEntry> new_entry); | |
786 | |
787 // Renames a file or directory at |file_path| on in-memory snapshot | 775 // Renames a file or directory at |file_path| on in-memory snapshot |
788 // of the file system. Returns PLATFORM_FILE_OK if successful. | 776 // of the file system. Returns PLATFORM_FILE_OK if successful. |
789 base::PlatformFileError RenameFileOnFilesystem( | 777 base::PlatformFileError RenameFileOnFilesystem( |
790 const FilePath& file_path, const FilePath::StringType& new_name, | 778 const FilePath& file_path, const FilePath::StringType& new_name, |
791 FilePath* updated_file_path); | 779 FilePath* updated_file_path); |
792 | 780 |
793 // Adds a file or directory at |file_path| to another directory at | 781 // Adds a file or directory at |file_path| to another directory at |
794 // |dir_path| on in-memory snapshot of the file system. | 782 // |dir_path| on in-memory snapshot of the file system. |
795 // Returns PLATFORM_FILE_OK if successful. | 783 // Returns PLATFORM_FILE_OK if successful. |
796 base::PlatformFileError AddEntryToDirectoryOnFilesystem( | 784 base::PlatformFileError AddEntryToDirectoryOnFilesystem( |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1326 }; | 1314 }; |
1327 | 1315 |
1328 // Sets the free disk space getter for testing. | 1316 // Sets the free disk space getter for testing. |
1329 // The existing getter is deleted. | 1317 // The existing getter is deleted. |
1330 void SetFreeDiskSpaceGetterForTesting( | 1318 void SetFreeDiskSpaceGetterForTesting( |
1331 FreeDiskSpaceGetterInterface* getter); | 1319 FreeDiskSpaceGetterInterface* getter); |
1332 | 1320 |
1333 } // namespace gdata | 1321 } // namespace gdata |
1334 | 1322 |
1335 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 1323 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
OLD | NEW |