Chromium Code Reviews| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 FilePathUpdateCallback; | 165 FilePathUpdateCallback; |
| 166 | 166 |
| 167 // Callback run as a response to LoadFeedFromServer. | 167 // Callback run as a response to LoadFeedFromServer. |
| 168 typedef base::Callback<void(GetDocumentsParams* params, | 168 typedef base::Callback<void(GetDocumentsParams* params, |
| 169 GDataFileError error)> | 169 GDataFileError error)> |
| 170 LoadDocumentFeedCallback; | 170 LoadDocumentFeedCallback; |
| 171 | 171 |
| 172 // Struct used to record UMA stats with FeedToFileResourceMap(). | 172 // Struct used to record UMA stats with FeedToFileResourceMap(). |
| 173 struct FeedToFileResourceMapUmaStats; | 173 struct FeedToFileResourceMapUmaStats; |
| 174 | 174 |
| 175 // Struct used for StartFileUploadOnUIThread(). | |
| 176 struct StartFileUploadParams; | |
|
achuithb
2012/07/23 22:01:45
So the reason for these params is the Bind arg siz
satorux1
2012/07/23 22:02:49
yes.
| |
| 177 | |
| 175 // Finds entry object by |file_path| and returns the entry object. | 178 // Finds entry object by |file_path| and returns the entry object. |
| 176 // Returns NULL if it does not find the entry. | 179 // Returns NULL if it does not find the entry. |
| 177 GDataEntry* GetGDataEntryByPath(const FilePath& file_path); | 180 GDataEntry* GetGDataEntryByPath(const FilePath& file_path); |
| 178 | 181 |
| 179 // Callback passed to |LoadFeedFromServer| from |Search| method. | 182 // Callback passed to |LoadFeedFromServer| from |Search| method. |
| 180 // |callback| is that should be run with data received from | 183 // |callback| is that should be run with data received from |
| 181 // |LoadFeedFromServer|. | 184 // |LoadFeedFromServer|. |
| 182 // |params| params used for getting document feed for content search. | 185 // |params| params used for getting document feed for content search. |
| 183 // |error| error code returned by |LoadFeedFromServer|. | 186 // |error| error code returned by |LoadFeedFromServer|. |
| 184 void OnSearch(const SearchCallback& callback, | 187 void OnSearch(const SearchCallback& callback, |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 641 | 644 |
| 642 // Helper function that completes bookkeeping tasks related to | 645 // Helper function that completes bookkeeping tasks related to |
| 643 // completed file transfer. | 646 // completed file transfer. |
| 644 void OnTransferCompleted( | 647 void OnTransferCompleted( |
| 645 const FileOperationCallback& callback, | 648 const FileOperationCallback& callback, |
| 646 GDataFileError error, | 649 GDataFileError error, |
| 647 scoped_ptr<UploadFileInfo> upload_file_info); | 650 scoped_ptr<UploadFileInfo> upload_file_info); |
| 648 | 651 |
| 649 // Kicks off file upload once it receives |file_size| and |content_type|. | 652 // Kicks off file upload once it receives |file_size| and |content_type|. |
| 650 void StartFileUploadOnUIThread( | 653 void StartFileUploadOnUIThread( |
| 651 const FilePath& local_file, | 654 const StartFileUploadParams& params, |
| 652 const FilePath& remote_dest_file, | |
| 653 const FileOperationCallback& callback, | |
| 654 GDataFileError* error, | 655 GDataFileError* error, |
| 655 int64* file_size, | 656 int64* file_size, |
| 656 std::string* content_type); | 657 std::string* content_type); |
| 657 | 658 |
| 659 // Part of StartFileUploadOnUIThread(). Called after GetEntryInfoByPath() | |
| 660 // is complete. | |
| 661 void StartFileUploadOnUIThreadAfterGetEntryInfo( | |
| 662 const StartFileUploadParams& params, | |
| 663 int64 file_size, | |
| 664 std::string content_type, | |
| 665 GDataFileError error, | |
| 666 scoped_ptr<GDataEntryProto> entry_proto); | |
| 667 | |
| 658 // Cache intermediate callbacks, that run on calling thread, for above cache | 668 // Cache intermediate callbacks, that run on calling thread, for above cache |
| 659 // tasks that were run on blocking pool. | 669 // tasks that were run on blocking pool. |
| 660 | 670 |
| 661 // Helper function for internally handling responses from | 671 // Helper function for internally handling responses from |
| 662 // GetFileFromCacheByResourceIdAndMd5() calls during processing of | 672 // GetFileFromCacheByResourceIdAndMd5() calls during processing of |
| 663 // GetFileByPath() request. | 673 // GetFileByPath() request. |
| 664 void OnGetFileFromCache(const GetFileFromCacheParams& params, | 674 void OnGetFileFromCache(const GetFileFromCacheParams& params, |
| 665 GDataFileError error, | 675 GDataFileError error, |
| 666 const std::string& resource_id, | 676 const std::string& resource_id, |
| 667 const std::string& md5, | 677 const std::string& md5, |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 864 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; | 874 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; |
| 865 | 875 |
| 866 ObserverList<Observer> observers_; | 876 ObserverList<Observer> observers_; |
| 867 | 877 |
| 868 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 878 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
| 869 }; | 879 }; |
| 870 | 880 |
| 871 } // namespace gdata | 881 } // namespace gdata |
| 872 | 882 |
| 873 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 883 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
| OLD | NEW |