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

Unified Diff: chrome/browser/google_apis/base_operations.h

Issue 14215003: Add ProgressCallback to DriveServiceInterface::DownloadFile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 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
« no previous file with comments | « chrome/browser/chromeos/drive/drive_scheduler.cc ('k') | chrome/browser/google_apis/base_operations.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/base_operations.h
diff --git a/chrome/browser/google_apis/base_operations.h b/chrome/browser/google_apis/base_operations.h
index fc1f8b57666a55e68067ba0fdf8026384ffbc878..f92ce67bc6fdb60ae72f6ea3d1eb2a6a3e9784bb 100644
--- a/chrome/browser/google_apis/base_operations.h
+++ b/chrome/browser/google_apis/base_operations.h
@@ -34,6 +34,9 @@ namespace google_apis {
// then the passed argument is null.
typedef base::Callback<void(scoped_ptr<base::Value> value)> ParseJsonCallback;
+// Callback used for DownloadOperation and ResumeUploadOperation.
+typedef base::Callback<void(int64 progress, int64 total)> ProgressCallback;
+
// Parses JSON passed in |json| on blocking pool. Runs |callback| on the calling
// thread when finished with either success or failure.
// The callback must not be null.
@@ -458,6 +461,10 @@ class DownloadFileOperation : public UrlFetchOperationBase {
// This callback is called when some part of the content is
// read. Used to read the download content progressively. May be null.
//
+ // progress_callback:
+ // This callback is called for periodically reporting the number of bytes
+ // downloaded so far. May be null.
+ //
// download_url:
// Specifies the target file to download.
//
@@ -473,6 +480,7 @@ class DownloadFileOperation : public UrlFetchOperationBase {
net::URLRequestContextGetter* url_request_context_getter,
const DownloadActionCallback& download_action_callback,
const GetContentCallback& get_content_callback,
+ const ProgressCallback& progress_callback,
const GURL& download_url,
const base::FilePath& drive_file_path,
const base::FilePath& output_file_path);
@@ -495,6 +503,7 @@ class DownloadFileOperation : public UrlFetchOperationBase {
private:
const DownloadActionCallback download_action_callback_;
const GetContentCallback get_content_callback_;
+ const ProgressCallback progress_callback_;
const GURL download_url_;
DISALLOW_COPY_AND_ASSIGN(DownloadFileOperation);
« no previous file with comments | « chrome/browser/chromeos/drive/drive_scheduler.cc ('k') | chrome/browser/google_apis/base_operations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698