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

Unified Diff: update_engine_client.cc

Issue 2847054: AU: land http://codereview.chromium.org/2931008/show for tfarina (Closed) Base URL: ssh://git@chromiumos-git/update_engine.git
Patch Set: 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: update_engine_client.cc
diff --git a/update_engine_client.cc b/update_engine_client.cc
index cfdbc8ab87df72dc6dbbfd073033f6378e8548e1..e68a7aa6135c9d28561a2b0a6defc3aef1d161fd 100644
--- a/update_engine_client.cc
+++ b/update_engine_client.cc
@@ -68,7 +68,7 @@ static void StatusUpdateSignalHandler(DBusGProxy* proxy,
bool GetStatus() {
DBusGProxy* proxy;
GError* error = NULL;
-
+
CHECK(GetProxy(&proxy));
gint64 last_checked_time = 0;
@@ -101,9 +101,9 @@ bool GetStatus() {
// Should never return.
void WatchForUpdates() {
DBusGProxy* proxy;
-
+
CHECK(GetProxy(&proxy));
-
+
// Register marshaller
dbus_g_object_register_marshaller(
update_engine_VOID__INT64_DOUBLE_STRING_STRING_INT64,
@@ -114,10 +114,10 @@ void WatchForUpdates() {
G_TYPE_STRING,
G_TYPE_INT64,
G_TYPE_INVALID);
-
- // TODO(adlr): make StatusUpdate a const string
+
+ static const char kStatusUpdate[] = "StatusUpdate";
dbus_g_proxy_add_signal(proxy,
- "StatusUpdate",
+ kStatusUpdate,
G_TYPE_INT64,
G_TYPE_DOUBLE,
G_TYPE_STRING,
@@ -126,7 +126,7 @@ void WatchForUpdates() {
G_TYPE_INVALID);
GMainLoop* loop = g_main_loop_new (NULL, TRUE);
dbus_g_proxy_connect_signal(proxy,
- "StatusUpdate",
+ kStatusUpdate,
G_CALLBACK(StatusUpdateSignalHandler),
NULL,
NULL);
@@ -137,7 +137,7 @@ void WatchForUpdates() {
bool CheckForUpdates(bool force) {
DBusGProxy* proxy;
GError* error = NULL;
-
+
CHECK(GetProxy(&proxy));
gboolean rc =
@@ -156,7 +156,7 @@ int main(int argc, char** argv) {
dbus_g_thread_init();
chromeos_update_engine::Subprocess::Init();
google::ParseCommandLineFlags(&argc, &argv, true);
-
+
if (FLAGS_status) {
LOG(INFO) << "Querying Update Engine status...";
if (!GetStatus()) {
@@ -178,7 +178,7 @@ int main(int argc, char** argv) {
WatchForUpdates(); // Should never return.
return 1;
}
-
+
LOG(INFO) << "No flags specified. Exiting.";
return 0;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698