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

Unified Diff: download_action.cc

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 | « download_action.h ('k') | download_action_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: download_action.cc
diff --git a/download_action.cc b/download_action.cc
index 5ecb99e435e66f23fef780fe2660fb64121c58d7..5096703419fe06ce56da445fdd2307b6fade614c 100644
--- a/download_action.cc
+++ b/download_action.cc
@@ -74,6 +74,9 @@ void DownloadAction::PerformAction() {
return;
}
}
+ if (delegate_) {
+ delegate_->SetDownloadStatus(true); // Set to active.
+ }
http_fetcher_->BeginTransfer(install_plan_.download_url);
}
@@ -82,6 +85,9 @@ void DownloadAction::TerminateProcessing() {
CHECK_EQ(writer_->Close(), 0);
writer_ = NULL;
http_fetcher_->TerminateTransfer();
+ if (delegate_) {
+ delegate_->SetDownloadStatus(false); // Set to inactive.
+ }
}
void DownloadAction::ReceivedBytes(HttpFetcher *fetcher,
@@ -116,6 +122,9 @@ void DownloadAction::TransferComplete(HttpFetcher *fetcher, bool successful) {
CHECK_EQ(writer_->Close(), 0) << errno;
writer_ = NULL;
}
+ if (delegate_) {
+ delegate_->SetDownloadStatus(false); // Set to inactive.
+ }
ActionExitCode code =
successful ? kActionCodeSuccess : kActionCodeDownloadTransferError;
if (code == kActionCodeSuccess) {
« no previous file with comments | « download_action.h ('k') | download_action_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698