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) { |