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

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

Issue 23050014: Convert drive::FileWriteHelper to a single function for simplification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/drive/download_handler.cc
diff --git a/chrome/browser/chromeos/drive/download_handler.cc b/chrome/browser/chromeos/drive/download_handler.cc
index 850caf9877792f966a881637ac0bc8f58da05d1f..3a41065599322034cfc5ae6ad680d9415d4355e5 100644
--- a/chrome/browser/chromeos/drive/download_handler.cc
+++ b/chrome/browser/chromeos/drive/download_handler.cc
@@ -12,7 +12,7 @@
#include "chrome/browser/chromeos/drive/drive_integration_service.h"
#include "chrome/browser/chromeos/drive/file_system_interface.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
-#include "chrome/browser/chromeos/drive/file_write_helper.h"
+#include "chrome/browser/chromeos/drive/write_on_cache_file.h"
#include "content/public/browser/browser_thread.h"
using content::BrowserThread;
@@ -95,11 +95,8 @@ bool IsPersistedDriveDownload(const base::FilePath& drive_tmp_download_path,
} // namespace
-DownloadHandler::DownloadHandler(
- FileWriteHelper* file_write_helper,
- FileSystemInterface* file_system)
- : file_write_helper_(file_write_helper),
- file_system_(file_system),
+DownloadHandler::DownloadHandler(FileSystemInterface* file_system)
+ : file_system_(file_system),
weak_ptr_factory_(this) {
}
@@ -303,7 +300,8 @@ void DownloadHandler::OnCreateDirectory(
void DownloadHandler::UploadDownloadItem(DownloadItem* download) {
DCHECK_EQ(DownloadItem::COMPLETE, download->GetState());
- file_write_helper_->PrepareWritableFileAndRun(
+ WriteOnCacheFile(
+ file_system_,
util::ExtractDrivePath(GetTargetPath(download)),
base::Bind(&MoveDownloadedFile, download->GetTargetFilePath()));
}
« no previous file with comments | « chrome/browser/chromeos/drive/download_handler.h ('k') | chrome/browser/chromeos/drive/download_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698