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

Unified Diff: chrome/browser/chromeos/drive/file_system.h

Issue 15681009: Extract GetResolveFile into DownloadOperation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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/drive/file_system.h
diff --git a/chrome/browser/chromeos/drive/file_system.h b/chrome/browser/chromeos/drive/file_system.h
index d602caa1dc8fe6f83e15ba940ccff66af5071dc2..ca12b9d56d73dd12addbf427d917eb6fd7961afa 100644
--- a/chrome/browser/chromeos/drive/file_system.h
+++ b/chrome/browser/chromeos/drive/file_system.h
@@ -169,13 +169,6 @@ class FileSystem : public FileSystemInterface,
private:
friend class DriveFileSystemTest;
- // Defines set of parameters passed to an intermediate callback
- // OnGetFileCompleteForOpen, during execution of OpenFile() method.
- struct GetFileCompleteForOpenParams;
-
- // Defines set of parameters for GetResolvedFileByPath().
- struct GetResolvedFileParams;
-
// Used to implement Reload().
void ReloadAfterReset(FileError error);
@@ -210,23 +203,20 @@ class FileSystem : public FileSystemInterface,
FileError error,
scoped_ptr<ResourceEntry> entry);
- // Invoked upon completion of GetResourceEntryByPath initiated by
- // GetFileByPath. It then continues to invoke GetResolvedFileByPath.
- // |callback| must not be null.
- void OnGetResourceEntryCompleteForGetFileByPath(
+ // Part of OpenFile(). Called after the file downloading is completed.
+ void OpenFileAfterFileDownloaded(
const base::FilePath& file_path,
- const GetFileCallback& callback,
+ const OpenFileCallback& callback,
FileError error,
- scoped_ptr<ResourceEntry> file_info);
+ const base::FilePath& local_file_path,
+ scoped_ptr<ResourceEntry> entry);
- // Invoked upon completion of GetResourceEntryByPath initiated by OpenFile.
- // It then continues to invoke GetResolvedFileByPath and proceeds to
- // OnGetFileCompleteForOpenFile.
- void OnGetResourceEntryCompleteForOpenFile(
- const base::FilePath& file_path,
+ // Part of OpenFile(). Called after the cache file is marked dirty.
+ void OpenFileAfterMarkDirty(
+ const std::string& resource_id,
+ const std::string& md5,
const OpenFileCallback& callback,
- FileError error,
- scoped_ptr<ResourceEntry> file_info);
+ FileError error);
// Invoked at the last step of OpenFile. It removes |file_path| from the
// current set of opened files if |result| is an error, and then invokes the
@@ -250,20 +240,6 @@ class FileSystem : public FileSystemInterface,
const FileOperationCallback& callback,
FileError result);
- // Invoked upon completion of GetFileByPath initiated by OpenFile. If
- // GetFileByPath is successful, calls MarkDirtyInCache to mark the cache
- // file as dirty for the file identified by |file_info.resource_id| and
- // |file_info.md5|.
- void OnGetFileCompleteForOpenFile(const GetFileCompleteForOpenParams& params,
- FileError error,
- const base::FilePath& file_path,
- scoped_ptr<ResourceEntry> entry);
-
- // Invoked upon completion of MarkDirtyInCache initiated by OpenFile.
- void OnMarkDirtyInCacheCompleteForOpenFile(
- const GetFileCompleteForOpenParams& params,
- FileError error);
-
// Callback for handling about resource fetch.
void OnGetAboutResource(
const GetAvailableSpaceCallback& callback,
@@ -322,55 +298,6 @@ class FileSystem : public FileSystemInterface,
FileError error,
scoped_ptr<ResourceEntryVector> entries);
- // Gets the file at |file_path| from the cache (if found in the cache),
- // or the server (if not found in the cache) after the file info is
- // already resolved with GetResourceEntryByPath() or GetResourceEntryById().
- void GetResolvedFileByPath(scoped_ptr<GetResolvedFileParams> params);
- void GetResolvedFileByPathAfterCreateDocumentJsonFile(
- scoped_ptr<GetResolvedFileParams> params,
- const base::FilePath* file_path,
- FileError error);
- void GetResolvedFileByPathAfterGetFileFromCache(
- scoped_ptr<GetResolvedFileParams> params,
- FileError error,
- const base::FilePath& cache_file_path);
- void GetResolvedFileByPathAfterGetResourceEntry(
- scoped_ptr<GetResolvedFileParams> params,
- google_apis::GDataErrorCode status,
- scoped_ptr<google_apis::ResourceEntry> entry);
- void GetResolvedFileByPathAfterRefreshEntry(
- scoped_ptr<GetResolvedFileParams> params,
- const GURL& download_url,
- FileError error,
- const base::FilePath& drive_file_path,
- scoped_ptr<ResourceEntry> entry);
- void GetResolvedFileByPathAfterFreeDiskSpace(
- scoped_ptr<GetResolvedFileParams> params,
- const GURL& download_url,
- bool has_enough_space);
- void GetResolveFileByPathAfterCreateTemporaryFile(
- scoped_ptr<GetResolvedFileParams> params,
- const GURL& download_url,
- base::FilePath* temp_file,
- bool success);
- void GetResolvedFileByPathAfterDownloadFile(
- scoped_ptr<GetResolvedFileParams> params,
- google_apis::GDataErrorCode status,
- const base::FilePath& downloaded_file_path);
- void GetResolvedFileByPathAfterGetCacheEntryForCancel(
- const std::string& resource_id,
- const std::string& md5,
- bool success,
- const FileCacheEntry& cache_entry);
- void GetResolvedFileByPathAfterStore(
- scoped_ptr<GetResolvedFileParams> params,
- const base::FilePath& downloaded_file_path,
- FileError error);
- void GetResolvedFileByPathAfterGetFile(
- scoped_ptr<GetResolvedFileParams> params,
- FileError error,
- const base::FilePath& cache_file);
-
// Part of GetResourceEntryById(). Called after
// ResourceMetadata::GetResourceEntryById() is complete.
// |callback| must not be null.
@@ -392,18 +319,6 @@ class FileSystem : public FileSystemInterface,
const base::FilePath& file_path,
scoped_ptr<ResourceEntry> entry);
- // Part of GetFileContentByPath(). Called after
- // ResourceMetadata::GetResourceEntryByPath() is complete.
- // |initialized_callback|, |get_content_callback| and |completion_callback|
- // must not be null.
- void GetFileContentByPathAfterGetEntry(
- const base::FilePath& file_path,
- const GetFileContentInitializedCallback& initialized_callback,
- const google_apis::GetContentCallback& get_content_callback,
- const FileOperationCallback& completion_callback,
- FileError error,
- scoped_ptr<ResourceEntry> entry);
-
// Part of RefreshDirectory(). Called after
// GetResourceEntryByPath() is complete.
void RefreshDirectoryAfterGetResourceEntry(

Powered by Google App Engine
This is Rietveld 408576698