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

Unified Diff: chrome/browser/chromeos/gdata/gdata_operations.cc

Issue 9742002: Wired GDataFileSystem::GetFile() method with internal cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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/gdata/gdata_operations.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_operations.cc b/chrome/browser/chromeos/gdata/gdata_operations.cc
index a0df4d8f45279ca722e2b77b3016bb8de2302f92..fde6b225982bf727abac1d7a930f7e8d8309df08 100644
--- a/chrome/browser/chromeos/gdata/gdata_operations.cc
+++ b/chrome/browser/chromeos/gdata/gdata_operations.cc
@@ -187,6 +187,9 @@ void UrlFetchOperationBase::Start(const std::string& auth_token) {
if (save_temp_file_) {
url_fetcher_->SaveResponseToTemporaryFile(
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE));
+ } else if (!output_file_path_.empty()){
+ url_fetcher_->SaveResponseToFileAtPath(output_file_path_,
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE));
}
// Add request headers.
@@ -427,7 +430,8 @@ DownloadFileOperation::DownloadFileOperation(
Profile* profile,
const DownloadActionCallback& callback,
const GURL& document_url,
- const FilePath& virtual_path)
+ const FilePath& virtual_path,
+ const FilePath& output_file_path)
: UrlFetchOperationBase(registry,
GDataOperationRegistry::OPERATION_DOWNLOAD,
virtual_path,
@@ -435,7 +439,10 @@ DownloadFileOperation::DownloadFileOperation(
callback_(callback),
document_url_(document_url) {
// Make sure we download the content into a temp file.
- save_temp_file_ = true;
+ if (output_file_path.empty())
+ save_temp_file_ = true;
+ else
+ output_file_path_ = output_file_path;
}
DownloadFileOperation::~DownloadFileOperation() {}

Powered by Google App Engine
This is Rietveld 408576698