summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/drive/drive_file_system_interface.h
diff options
context:
space:
mode:
authorhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-07 12:14:55 +0000
committerhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-07 12:14:55 +0000
commita7a99d04b69f9fbbcb08f586a4314fff61116dfb (patch)
treeb82761c158e7406a8973c1075f873c2ef572314a /chrome/browser/chromeos/drive/drive_file_system_interface.h
parent2a0749fe775bc5fa0a8cae4d41d2a6aed7af3926 (diff)
downloadchromium_src-a7a99d04b69f9fbbcb08f586a4314fff61116dfb.zip
chromium_src-a7a99d04b69f9fbbcb08f586a4314fff61116dfb.tar.gz
chromium_src-a7a99d04b69f9fbbcb08f586a4314fff61116dfb.tar.bz2
chromeos: Polish DriveFileSystem::AddUploadedFile/UpdateEntryData
AddUploadedFile was doing completely different things based on the value of |upload_mode|. upload_mode==UPLOAD_EXISTING_FILE case was only used by OnUpdatedFileUploaded(), now the code used to handle this case is merged to OnUpdatedFileUploaded(). AddUploadedFile and UpdateEntryData's argument callback type changed from base::Closure to FileOperationCallback. These methods no longer allow null callbacks to be passed as their arguments. BUG=159368 TEST=unit_tests --gtest_filter="Drive*" and download files to Drive directory (both overwriting case and not-overwriting case). Review URL: https://chromiumcodereview.appspot.com/11361030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166395 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/drive/drive_file_system_interface.h')
-rw-r--r--chrome/browser/chromeos/drive/drive_file_system_interface.h26
1 files changed, 10 insertions, 16 deletions
diff --git a/chrome/browser/chromeos/drive/drive_file_system_interface.h b/chrome/browser/chromeos/drive/drive_file_system_interface.h
index 296efcf1..7623fc98 100644
--- a/chrome/browser/chromeos/drive/drive_file_system_interface.h
+++ b/chrome/browser/chromeos/drive/drive_file_system_interface.h
@@ -326,31 +326,25 @@ class DriveFileSystemInterface {
virtual void GetAvailableSpace(const GetAvailableSpaceCallback& callback) = 0;
// Adds a file entry from |doc_entry| under |directory_path|, and modifies
- // the cache state.
- //
- // When uploading a new file, adds a new file entry, and store its content
- // from |file_content_path| into the cache.
- //
- // When uploading an existing file, replaces the file entry with a new one,
- // and clears the dirty bit in the cache.
+ // the cache state. Adds a new file entry, and store its content from
+ // |file_content_path| into the cache.
//
// |callback| will be called on the UI thread upon completion of operation.
- virtual void AddUploadedFile(google_apis::UploadMode upload_mode,
- const FilePath& directory_path,
+ // |callback| must not be null.
+ virtual void AddUploadedFile(const FilePath& directory_path,
scoped_ptr<google_apis::DocumentEntry> doc_entry,
const FilePath& file_content_path,
DriveCache::FileOperationType cache_operation,
- const base::Closure& callback) = 0;
+ const FileOperationCallback& callback) = 0;
- // Updates the data associated with the file referenced by |resource_id| and
- // |md5|. The data is copied from |file_content_path|.
+ // Updates the data associated with the file referenced by |entry|.
+ // The data is copied from |file_content_path|.
//
// |callback| will be called on the UI thread upon completion of operation.
- virtual void UpdateEntryData(const std::string& resource_id,
- const std::string& md5,
- scoped_ptr<google_apis::DocumentEntry> entry,
+ // |callback| must not be null.
+ virtual void UpdateEntryData(scoped_ptr<google_apis::DocumentEntry> entry,
const FilePath& file_content_path,
- const base::Closure& callback) = 0;
+ const FileOperationCallback& callback) = 0;
// Returns miscellaneous metadata of the file system like the largest
// timestamp. Used in chrome:drive-internals.