Chromium Code Reviews| Index: update_attempter.cc |
| diff --git a/update_attempter.cc b/update_attempter.cc |
| index f56c0d1275ffd3dca0aeb1e720b5ac59e342a3e4..9b89ba009acbed6e0879800843fdea63d5a35e23 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) { |
| @@ -602,4 +605,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()); |
| + processor_->StartProcessing(); |
|
adlr
2011/04/15 22:04:51
the other thing that starts processing uses g_idle
thieule
2011/04/15 23:32:57
Done.
|
| + SetStatusAndNotify(UPDATE_STATUS_UPDATED_NEED_REBOOT); |
| +} |
| + |
| } // namespace chromeos_update_engine |