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

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

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/drive_operations.cc
diff --git a/chrome/browser/chromeos/drive/file_system/drive_operations.cc b/chrome/browser/chromeos/drive/file_system/drive_operations.cc
index 9eaef46248255ba69b9187d8fccbcd6031f25ecf..64efe5f91e847fa9a92b5ae90ba279c6012d18ac 100644
--- a/chrome/browser/chromeos/drive/file_system/drive_operations.cc
+++ b/chrome/browser/chromeos/drive/file_system/drive_operations.cc
@@ -8,6 +8,7 @@
#include "chrome/browser/chromeos/drive/file_system/copy_operation.h"
#include "chrome/browser/chromeos/drive/file_system/create_directory_operation.h"
#include "chrome/browser/chromeos/drive/file_system/create_file_operation.h"
+#include "chrome/browser/chromeos/drive/file_system/download_operation.h"
#include "chrome/browser/chromeos/drive/file_system/move_operation.h"
#include "chrome/browser/chromeos/drive/file_system/remove_operation.h"
#include "chrome/browser/chromeos/drive/file_system/search_operation.h"
@@ -57,6 +58,8 @@ void DriveOperations::Init(OperationObserver* observer,
new MoveOperation(observer, scheduler, metadata));
remove_operation_.reset(
new RemoveOperation(observer, scheduler, metadata, cache));
+ download_operation_.reset(new DownloadOperation(
+ blocking_task_runner, observer, scheduler, metadata, cache));
update_operation_.reset(
new UpdateOperation(observer, scheduler, metadata, cache));
search_operation_.reset(
@@ -134,6 +137,20 @@ void DriveOperations::Remove(const base::FilePath& file_path,
remove_operation_->Remove(file_path, is_recursive, callback);
}
+void DriveOperations::EnsureFileDownloaded(
+ const base::FilePath& file_path,
+ DriveClientContext context,
+ const GetFileContentInitializedCallback& initialized_callback,
+ const google_apis::GetContentCallback& get_content_callback,
+ const GetFileCallback& completion_callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(!completion_callback.is_null());
+
+ download_operation_->EnsureFileDownloaded(
+ file_path, context, initialized_callback, get_content_callback,
+ completion_callback);
+}
+
void DriveOperations::UpdateFileByResourceId(
const std::string& resource_id,
DriveClientContext context,

Powered by Google App Engine
This is Rietveld 408576698