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

Unified Diff: update_attempter.cc

Issue 6836025: Add support to update_engine to poke Omaha after an update has been applied (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: Change to use <ping> element with active=1 Created 9 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
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

Powered by Google App Engine
This is Rietveld 408576698