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

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: merge 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..8eb7ccd995c68a4a005a4b963d17326b0a4b066b 100644
--- a/chrome/browser/chromeos/gdata/gdata_operations.cc
+++ b/chrome/browser/chromeos/gdata/gdata_operations.cc
@@ -183,10 +183,14 @@ void UrlFetchOperationBase::Start(const std::string& auth_token) {
url_fetcher_->SetRequestContext(profile_->GetRequestContext());
// Always set flags to neither send nor save cookies.
url_fetcher_->SetLoadFlags(
- net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES);
+ net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES |
+ net::LOAD_DISABLE_CACHE);
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 +431,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 +440,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() {}
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_operations.h ('k') | chrome/browser/chromeos/gdata/mock_gdata_documents_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698