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

Unified Diff: chrome/browser/google_apis/base_requests.cc

Issue 18211008: Add resource ID based download requests in {GDataWapi/Drive} requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reorder parameters. Created 7 years, 6 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/google_apis/base_requests.cc
diff --git a/chrome/browser/google_apis/base_requests.cc b/chrome/browser/google_apis/base_requests.cc
index 8452d07cfb825848a3f94c05b179786c34337b59..49a5f07325c3c8141a87e753642c0ddd2ca40be6 100644
--- a/chrome/browser/google_apis/base_requests.cc
+++ b/chrome/browser/google_apis/base_requests.cc
@@ -602,9 +602,9 @@ GetUploadStatusRequestBase::GetExtraRequestHeaders() const {
return headers;
}
-//============================ DownloadFileRequest ===========================
+//============================ DownloadFileRequestBase =========================
-DownloadFileRequest::DownloadFileRequest(
+DownloadFileRequestBase::DownloadFileRequestBase(
RequestSender* sender,
const DownloadActionCallback& download_action_callback,
const GetContentCallback& get_content_callback,
@@ -622,38 +622,40 @@ DownloadFileRequest::DownloadFileRequest(
// get_content_callback may be null.
}
-DownloadFileRequest::~DownloadFileRequest() {}
+DownloadFileRequestBase::~DownloadFileRequestBase() {}
// Overridden from UrlFetchRequestBase.
-GURL DownloadFileRequest::GetURL() const {
+GURL DownloadFileRequestBase::GetURL() const {
return download_url_;
}
-bool DownloadFileRequest::GetOutputFilePath(base::FilePath* local_file_path) {
+bool DownloadFileRequestBase::GetOutputFilePath(
+ base::FilePath* local_file_path) {
// Configure so that the downloaded content is saved to |output_file_path_|.
*local_file_path = output_file_path_;
return true;
}
-void DownloadFileRequest::OnURLFetchDownloadProgress(const URLFetcher* source,
- int64 current,
- int64 total) {
+void DownloadFileRequestBase::OnURLFetchDownloadProgress(
+ const URLFetcher* source,
+ int64 current,
+ int64 total) {
if (!progress_callback_.is_null())
progress_callback_.Run(current, total);
}
-bool DownloadFileRequest::ShouldSendDownloadData() {
+bool DownloadFileRequestBase::ShouldSendDownloadData() {
return !get_content_callback_.is_null();
}
-void DownloadFileRequest::OnURLFetchDownloadData(
+void DownloadFileRequestBase::OnURLFetchDownloadData(
const URLFetcher* source,
scoped_ptr<std::string> download_data) {
if (!get_content_callback_.is_null())
get_content_callback_.Run(HTTP_SUCCESS, download_data.Pass());
}
-void DownloadFileRequest::ProcessURLFetchResults(const URLFetcher* source) {
+void DownloadFileRequestBase::ProcessURLFetchResults(const URLFetcher* source) {
GDataErrorCode code = GetErrorCode(source);
// Take over the ownership of the the downloaded temp file.
@@ -668,7 +670,8 @@ void DownloadFileRequest::ProcessURLFetchResults(const URLFetcher* source) {
OnProcessURLFetchResultsComplete(code == HTTP_SUCCESS);
}
-void DownloadFileRequest::RunCallbackOnPrematureFailure(GDataErrorCode code) {
+void DownloadFileRequestBase::RunCallbackOnPrematureFailure(
+ GDataErrorCode code) {
download_action_callback_.Run(code, base::FilePath());
}
« no previous file with comments | « chrome/browser/google_apis/base_requests.h ('k') | chrome/browser/google_apis/base_requests_server_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698