Index: update_attempter.cc |
diff --git a/update_attempter.cc b/update_attempter.cc |
index f56c0d1275ffd3dca0aeb1e720b5ac59e342a3e4..9a7e88b8b25dcb795b7ea4171657ac2181de78b2 100644 |
--- a/update_attempter.cc |
+++ b/update_attempter.cc |
@@ -128,8 +128,11 @@ void UpdateAttempter::Update(const std::string& app_version, |
bool obey_proxies) { |
chrome_proxy_resolver_.Init(); |
if (status_ == UPDATE_STATUS_UPDATED_NEED_REBOOT) { |
+ // Although we have applied an update, we still want to ping Omaha |
+ // to ensure the number of active statistics is accurate. |
LOG(INFO) << "Not updating b/c we already updated and we're waiting for " |
- << "reboot"; |
+ << "reboot, we'll ping Omaha instead"; |
+ PingOmaha(); |
return; |
} |
if (status_ != UPDATE_STATUS_IDLE) { |
@@ -173,7 +176,8 @@ void UpdateAttempter::Update(const std::string& app_version, |
new OmahaRequestAction(prefs_, |
omaha_request_params_, |
NULL, |
- update_check_fetcher)); // passes ownership |
+ update_check_fetcher, // passes ownership |
+ false)); |
shared_ptr<OmahaResponseHandlerAction> response_handler_action( |
new OmahaResponseHandlerAction(prefs_)); |
shared_ptr<FilesystemCopierAction> filesystem_copier_action( |
@@ -185,7 +189,8 @@ void UpdateAttempter::Update(const std::string& app_version, |
omaha_request_params_, |
new OmahaEvent( |
OmahaEvent::kTypeUpdateDownloadStarted), |
- new LibcurlHttpFetcher(GetProxyResolver()))); |
+ new LibcurlHttpFetcher(GetProxyResolver()), |
+ false)); |
shared_ptr<DownloadAction> download_action( |
new DownloadAction(prefs_, new MultiRangeHTTPFetcher( |
new LibcurlHttpFetcher(GetProxyResolver())))); |
@@ -199,7 +204,8 @@ void UpdateAttempter::Update(const std::string& app_version, |
OmahaEvent::kTypeUpdateDownloadFinished, |
OmahaEvent::kResultError, |
kActionCodeDownloadPayloadPubKeyVerificationError), |
- new LibcurlHttpFetcher(GetProxyResolver()))); |
+ new LibcurlHttpFetcher(GetProxyResolver()), |
+ false)); |
download_action->set_skip_reporting_signature_fail( |
NewPermanentCallback(download_signature_warning.get(), |
&OmahaRequestAction::set_should_skip, |
@@ -209,7 +215,8 @@ void UpdateAttempter::Update(const std::string& app_version, |
omaha_request_params_, |
new OmahaEvent( |
OmahaEvent::kTypeUpdateDownloadFinished), |
- new LibcurlHttpFetcher(GetProxyResolver()))); |
+ new LibcurlHttpFetcher(GetProxyResolver()), |
+ false)); |
shared_ptr<FilesystemCopierAction> filesystem_verifier_action( |
new FilesystemCopierAction(false, true)); |
shared_ptr<FilesystemCopierAction> kernel_filesystem_verifier_action( |
@@ -220,7 +227,8 @@ void UpdateAttempter::Update(const std::string& app_version, |
new OmahaRequestAction(prefs_, |
omaha_request_params_, |
new OmahaEvent(OmahaEvent::kTypeUpdateComplete), |
- new LibcurlHttpFetcher(GetProxyResolver()))); |
+ new LibcurlHttpFetcher(GetProxyResolver()), |
+ false)); |
download_action->set_delegate(this); |
response_handler_action_ = response_handler_action; |
@@ -501,7 +509,8 @@ bool UpdateAttempter::ScheduleErrorEventAction() { |
new OmahaRequestAction(prefs_, |
omaha_request_params_, |
error_event_.release(), // Pass ownership. |
- new LibcurlHttpFetcher(GetProxyResolver()))); |
+ new LibcurlHttpFetcher(GetProxyResolver()), |
+ false)); |
actions_.push_back(shared_ptr<AbstractAction>(error_event_action)); |
processor_->EnqueueAction(error_event_action.get()); |
SetStatusAndNotify(UPDATE_STATUS_REPORTING_ERROR_EVENT); |
@@ -602,4 +611,19 @@ void UpdateAttempter::SetupDownload() { |
} |
} |
+void UpdateAttempter::PingOmaha() { |
+ shared_ptr<OmahaRequestAction> ping_action( |
+ new OmahaRequestAction(prefs_, |
+ omaha_request_params_, |
+ NULL, |
+ new LibcurlHttpFetcher(GetProxyResolver()), |
+ true)); |
+ actions_.push_back(shared_ptr<OmahaRequestAction>(ping_action)); |
+ CHECK(!processor_->IsRunning()); |
+ processor_->set_delegate(NULL); |
+ processor_->EnqueueAction(ping_action.get()); |
+ g_idle_add(&StaticStartProcessing, this); |
+ SetStatusAndNotify(UPDATE_STATUS_UPDATED_NEED_REBOOT); |
+} |
+ |
} // namespace chromeos_update_engine |