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

Unified Diff: chrome/browser/chromeos/gdata/gdata_file_system.h

Issue 10827211: Replace GDataDirectory::TakeEntry with GDataDirectoryService::AddEntryToDirectory. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: expect/assert after RunBlockingTask Created 8 years, 4 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/chromeos/gdata/gdata_file_system.h
===================================================================
--- chrome/browser/chromeos/gdata/gdata_file_system.h (revision 150441)
+++ chrome/browser/chromeos/gdata/gdata_file_system.h (working copy)
@@ -171,10 +171,6 @@
// execution of GetFileByPath() method.
struct GetFileFromCacheParams;
- // Callback similar to FileOperationCallback but with a given |file_path|.
- typedef base::Callback<void(GDataFileError error,
- const FilePath& file_path)>
- FilePathUpdateCallback;
// Struct used for StartFileUploadOnUIThread().
struct StartFileUploadParams;
@@ -411,13 +407,6 @@
const std::string& md5,
const FilePath& cache_file_path);
- // Callback for handling resource rename attempt.
- void OnRenameResourceCompleted(const FilePath& file_path,
- const FilePath::StringType& new_name,
- const FilePathUpdateCallback& callback,
- GDataErrorCode status,
- const GURL& document_url);
-
// Callback for handling document copy attempt.
void OnCopyDocumentCompleted(const FilePath& dir_path,
const FileOperationCallback& callback,
@@ -432,15 +421,6 @@
GDataErrorCode status,
const GURL& document_url);
- // Callback for handling an attempt to remove a file or directory from
- // another directory.
- void OnRemoveEntryFromDirectoryCompleted(
- const FilePathUpdateCallback& callback,
- const FilePath& file_path,
- const FilePath& dir_path,
- GDataErrorCode status,
- const GURL& document_url);
-
// Callback for handling account metadata fetch.
void OnGetAvailableSpace(
const GetAvailableSpaceCallback& callback,
@@ -488,29 +468,43 @@
const std::string& resource_id,
const std::string& md5);
- // Renames a file or directory at |file_path| on in-memory snapshot
- // of the file system. Returns PLATFORM_FILE_OK if successful.
- GDataFileError RenameFileOnFilesystem(
- const FilePath& file_path, const FilePath::StringType& new_name,
- FilePath* updated_file_path);
+ // Callback for handling resource rename attempt. Renames a file or
+ // directory at |file_path| on in-memory snapshot of the file system.
+ void RenameFileOnFileSystem(const FilePath& file_path,
+ const FilePath::StringType& new_name,
+ const FilePathUpdateCallback& callback,
+ GDataErrorCode status,
+ const GURL& document_url);
- // Adds an |entry| to another directory at |dir_path| on in-memory snapshot
- // of the file system. Returns PLATFORM_FILE_OK if successful.
- GDataFileError AddEntryToDirectoryOnFilesystem(
- GDataEntry* entry, const FilePath& dir_path);
+ // Callback for handling an attempt to remove a file or directory from
+ // another directory. Removes a file or directory at |file_path| and moves it
+ // to root on in-memory snapshot of the file system.
+ void RemoveEntryFromDirectoryOnFileSystem(
+ const FilePathUpdateCallback& callback,
+ const FilePath& file_path,
+ const FilePath& dir_path,
+ GDataErrorCode status,
+ const GURL& document_url);
- // Removes a file or directory at |file_path| from another directory at
- // |dir_path| on in-memory snapshot of the file system.
- // Returns PLATFORM_FILE_OK if successful.
- GDataFileError RemoveEntryFromDirectoryOnFilesystem(
- const FilePath& file_path, const FilePath& dir_path,
- FilePath* updated_file_path);
-
// Removes a file or directory under |file_path| from in-memory snapshot of
// the file system and the corresponding file from cache if it exists.
// Return PLATFORM_FILE_OK if successful.
GDataFileError RemoveEntryFromFileSystem(const FilePath& file_path);
+ // Callback for GDataDirectoryService::AddEntryToDirectory with
+ // FilePathUpdateCallback.
+ void OnAddEntryToDirectoryWithFileUpdateCallback(
+ const FilePathUpdateCallback& callback,
+ GDataFileError error,
+ const FilePath& updated_file_path);
+
+ // Callback for GDataDirectoryService::AddEntryToDirectory with
+ // FileOperationCallback.
+ void OnAddEntryToDirectoryWithFileOperationCallback(
+ const FileOperationCallback& callback,
+ GDataFileError error,
+ const FilePath& updated_file_path);
+
// Callback for GetEntryByResourceIdAsync.
// Removes stale entry upon upload of file.
static void RemoveStaleEntryOnUpload(const std::string& resource_id,
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_file_system.cc » ('j') | chrome/browser/chromeos/gdata/gdata_file_system.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698