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

Unified Diff: update_attempter.cc

Issue 3034026: AU: Provide a reboot_if_needed D-Bus API. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: reboot error code doesn't necessarily signal a problem. Created 10 years, 5 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 | « update_attempter.h ('k') | update_engine.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: update_attempter.cc
diff --git a/update_attempter.cc b/update_attempter.cc
index 014f82274729d874450b3a3366b3e0afd8d9dd2a..939e0745921abb2a14d60ab315565aa77e2a7354 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -221,6 +221,16 @@ void UpdateAttempter::CheckForUpdate(const std::string& app_version,
Update(app_version, omaha_url);
}
+bool UpdateAttempter::RebootIfNeeded() {
+ if (status_ != UPDATE_STATUS_UPDATED_NEED_REBOOT) {
+ LOG(INFO) << "Reboot requested, but status is "
+ << UpdateStatusToString(status_) << ", so not rebooting.";
+ return false;
+ }
+ TEST_AND_RETURN_FALSE(utils::Reboot());
+ return true;
+}
+
// Delegate methods:
void UpdateAttempter::ProcessingDone(const ActionProcessor* processor,
ActionExitCode code) {
« no previous file with comments | « update_attempter.h ('k') | update_engine.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698