Index: chrome/browser/local_discovery/storage/privet_filesystem_operations.h |
diff --git a/chrome/browser/local_discovery/storage/privet_filesystem_operations.h b/chrome/browser/local_discovery/storage/privet_filesystem_operations.h |
index 701411715e014315a1d0af46abf60567b7694b13..af86a3b072af3f0a02d1cbb58ee012d31025184d 100644 |
--- a/chrome/browser/local_discovery/storage/privet_filesystem_operations.h |
+++ b/chrome/browser/local_discovery/storage/privet_filesystem_operations.h |
@@ -73,6 +73,10 @@ class PrivetFileSystemOperationFactory |
bool exclusive, |
bool recursive, |
const fileapi::AsyncFileUtil::StatusCallback& callback); |
+ void CopyInForeignFile( |
+ base::FilePath src_file_path, |
+ const fileapi::FileSystemURL& dest_url, |
+ const fileapi::AsyncFileUtil::StatusCallback& callback); |
base::WeakPtr<PrivetFileSystemOperationFactory> GetWeakPtr() { |
return weak_factory_.GetWeakPtr(); |
@@ -326,6 +330,40 @@ class PrivetFileSystemStatusOperation |
scoped_ptr<PrivetJSONOperation> operation_; |
}; |
+class PrivetFileSystemUploadOperation |
+ : public PrivetFileSystemAsyncOperationUtil::Delegate, |
+ public local_discovery::PrivetFileSystemAsyncOperation { |
+ public: |
+ PrivetFileSystemUploadOperation( |
+ const base::FilePath& full_path, |
+ const base::FilePath& upload_path, |
+ content::BrowserContext* browser_context, |
+ PrivetFileSystemAsyncOperationContainer* container, |
+ const fileapi::AsyncFileUtil::StatusCallback& callback); |
+ virtual ~PrivetFileSystemUploadOperation(); |
+ |
+ virtual void Start() OVERRIDE; |
+ |
+ virtual void PrivetFileSystemResolved(PrivetHTTPClient* http_client, |
+ const std::string& path) OVERRIDE; |
+ |
+ private: |
+ void OnStorageOverwriteResult( |
+ PrivetDataReadOperation::ResponseType result_type, |
+ const std::string& data, |
+ const base::FilePath& file); |
+ void SignalError(); |
+ void TriggerCallbackAndDestroy(base::File::Error result); |
+ |
+ PrivetFileSystemAsyncOperationUtil core_; |
+ base::FilePath full_path_; |
+ base::FilePath upload_path_; |
+ PrivetFileSystemAsyncOperationContainer* container_; |
+ fileapi::AsyncFileUtil::StatusCallback callback_; |
+ |
+ scoped_ptr<PrivetDataReadOperation> overwrite_operation_; |
+}; |
+ |
} // namespace local_discovery |
#endif // CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_OPERATIONS_H_ |