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

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

Issue 16190003: drive: Add DownloadOperation::EnsureFileDownloadedByResourceId (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment 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.cc
diff --git a/chrome/browser/chromeos/drive/file_system.cc b/chrome/browser/chromeos/drive/file_system.cc
index 95e78921ba970ef9d941c1103c595a2ec13afe4d..1454eddc7c013ce75389712ba231bf2fbe964482 100644
--- a/chrome/browser/chromeos/drive/file_system.cc
+++ b/chrome/browser/chromeos/drive/file_system.cc
@@ -381,7 +381,7 @@ void FileSystem::GetFileByPath(const base::FilePath& file_path,
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
- operations_.EnsureFileDownloaded(
+ operations_.EnsureFileDownloadedByPath(
file_path,
ClientContext(USER_INITIATED),
GetFileContentInitializedCallback(),
@@ -398,33 +398,8 @@ void FileSystem::GetFileByResourceId(
DCHECK(!resource_id.empty());
DCHECK(!get_file_callback.is_null());
- resource_metadata_->GetResourceEntryByIdOnUIThread(
+ operations_.EnsureFileDownloadedByResourceId(
resource_id,
- base::Bind(&FileSystem::GetFileByResourceIdAfterGetEntry,
- weak_ptr_factory_.GetWeakPtr(),
- context,
- get_file_callback,
- get_content_callback));
-}
-
-void FileSystem::GetFileByResourceIdAfterGetEntry(
- const ClientContext& context,
- const GetFileCallback& get_file_callback,
- const google_apis::GetContentCallback& get_content_callback,
- FileError error,
- const base::FilePath& file_path,
- scoped_ptr<ResourceEntry> entry) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK(!get_file_callback.is_null());
-
- if (error != FILE_ERROR_OK) {
- get_file_callback.Run(FILE_ERROR_NOT_FOUND, base::FilePath(),
- scoped_ptr<ResourceEntry>());
- return;
- }
-
- operations_.EnsureFileDownloaded(
- file_path,
context,
GetFileContentInitializedCallback(),
get_content_callback,
@@ -441,7 +416,7 @@ void FileSystem::GetFileContentByPath(
DCHECK(!get_content_callback.is_null());
DCHECK(!completion_callback.is_null());
- operations_.EnsureFileDownloaded(
+ operations_.EnsureFileDownloadedByPath(
file_path,
ClientContext(USER_INITIATED),
initialized_callback,
@@ -888,7 +863,7 @@ void FileSystem::OpenFile(const base::FilePath& file_path,
}
open_files_.insert(file_path);
- operations_.EnsureFileDownloaded(
+ operations_.EnsureFileDownloadedByPath(
file_path,
ClientContext(USER_INITIATED),
GetFileContentInitializedCallback(),
« no previous file with comments | « chrome/browser/chromeos/drive/file_system.h ('k') | chrome/browser/chromeos/drive/file_system/download_operation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698