Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2452)

Unified Diff: chrome/browser/local_discovery/storage/privet_filesystem_operations.h

Issue 177373010: [Privet FS] Allow files to be able to be copied in to the privet filesystem (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698