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

Unified Diff: dbus_service.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 | « dbus_service.h ('k') | update_attempter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus_service.cc
diff --git a/dbus_service.cc b/dbus_service.cc
index 54dde41e0de827c8a5cc29ccb21e43573cdef615..4a05160eb234bae50433a59eed2e2a6d988330f5 100644
--- a/dbus_service.cc
+++ b/dbus_service.cc
@@ -47,6 +47,24 @@ UpdateEngineService* update_engine_service_new(void) {
g_object_new(UPDATE_ENGINE_TYPE_SERVICE, NULL));
}
+gboolean update_engine_service_attempt_update(UpdateEngineService* self,
+ gchar* app_version,
+ gchar* omaha_url,
+ GError **error) {
+ const string update_app_version = app_version ? app_version : "";
+ const string update_omaha_url = omaha_url ? omaha_url : "";
+ LOG(INFO) << "Attempt update: app_version=\"" << update_app_version << "\" "
+ << "omaha_url=\"" << update_omaha_url << "\"";
+ self->update_attempter_->CheckForUpdate(app_version, omaha_url);
+ return TRUE;
+}
+
+gboolean update_engine_service_check_for_update(UpdateEngineService* self,
+ GError **error) {
+ self->update_attempter_->CheckForUpdate("", "");
+ return TRUE;
+}
+
gboolean update_engine_service_get_status(UpdateEngineService* self,
int64_t* last_checked_time,
double* progress,
@@ -68,21 +86,12 @@ gboolean update_engine_service_get_status(UpdateEngineService* self,
return TRUE;
}
-gboolean update_engine_service_attempt_update(UpdateEngineService* self,
- gchar* app_version,
- gchar* omaha_url,
- GError **error) {
- const string update_app_version = app_version ? app_version : "";
- const string update_omaha_url = omaha_url ? omaha_url : "";
- LOG(INFO) << "Attempt update: app_version=\"" << update_app_version << "\" "
- << "omaha_url=\"" << update_omaha_url << "\"";
- self->update_attempter_->CheckForUpdate(app_version, omaha_url);
- return TRUE;
-}
-
-gboolean update_engine_service_check_for_update(UpdateEngineService* self,
+gboolean update_engine_service_reboot_if_needed(UpdateEngineService* self,
GError **error) {
- self->update_attempter_->CheckForUpdate("", "");
+ if (!self->update_attempter_->RebootIfNeeded()) {
+ *error = NULL;
+ return FALSE;
+ }
return TRUE;
}
« no previous file with comments | « dbus_service.h ('k') | update_attempter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698