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

Unified Diff: download_action.h

Issue 3131022: AU: Update status to DOWNLOADING only after receiving some bytes from server. (Closed) Base URL: http://src.chromium.org/git/update_engine.git
Patch Set: review feedback Created 10 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
« no previous file with comments | « no previous file | download_action.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: download_action.h
diff --git a/download_action.h b/download_action.h
index e1e8aeb37b17dd98da8fd5319d43e5b7a1728748..a46124f0d2253b517a75525f97242bdaa6acc11d 100644
--- a/download_action.h
+++ b/download_action.h
@@ -35,10 +35,15 @@ namespace chromeos_update_engine {
class DownloadActionDelegate {
public:
- // Called before any bytes are received and periodically after
- // bytes are received.
- // bytes_received is the number of bytes downloaded thus far.
- // total is the number of bytes expected.
+ // Called right before starting the download with |active| set to
+ // true. Called after completing the download with |active| set to
+ // false.
+ virtual void SetDownloadStatus(bool active) = 0;
+
+ // Called periodically after bytes are received. This method will be
+ // invoked only if the download is active. |bytes_received| is the
+ // number of bytes downloaded thus far. |total| is the number of
+ // bytes expected.
virtual void BytesReceived(uint64_t bytes_received, uint64_t total) = 0;
};
@@ -106,11 +111,11 @@ class DownloadAction : public Action<DownloadAction>,
// Used to find the hash of the bytes downloaded
OmahaHashCalculator omaha_hash_calculator_;
-
+
// For reporting status to outsiders
DownloadActionDelegate* delegate_;
uint64_t bytes_received_;
-
+
DISALLOW_COPY_AND_ASSIGN(DownloadAction);
};
« no previous file with comments | « no previous file | download_action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698