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

Unified Diff: src/platform/update_engine/dbus_service.cc

Issue 1733013: AU: Beginnings of dbus support. (Closed)
Patch Set: fixes for wad's review Created 10 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
« no previous file with comments | « src/platform/update_engine/dbus_service.h ('k') | src/platform/update_engine/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/update_engine/dbus_service.cc
diff --git a/src/platform/update_engine/dbus_service.cc b/src/platform/update_engine/dbus_service.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8dc239f520ce17c69405d6164adf3bc7cc7586aa
--- /dev/null
+++ b/src/platform/update_engine/dbus_service.cc
@@ -0,0 +1,51 @@
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "update_engine/dbus_service.h"
+#include <string>
+#include "base/logging.h"
+
+using std::string;
+
+G_DEFINE_TYPE(UpdateEngineService, update_engine_service, G_TYPE_OBJECT)
+
+static void update_engine_service_finalize(GObject* object) {
+ G_OBJECT_CLASS(update_engine_service_parent_class)->finalize(object);
+}
+
+static void update_engine_service_class_init(UpdateEngineServiceClass* klass) {
+ GObjectClass *object_class;
+ object_class = G_OBJECT_CLASS(klass);
+ object_class->finalize = update_engine_service_finalize;
+}
+
+static void update_engine_service_init(UpdateEngineService* object) {
+}
+
+UpdateEngineService* update_engine_service_new(void) {
+ return reinterpret_cast<UpdateEngineService*>(
+ g_object_new(UPDATE_ENGINE_TYPE_SERVICE, NULL));
+}
+
+gboolean update_engine_service_get_status(UpdateEngineService* self,
+ int64_t* last_checked_time,
+ double* progress,
+ gchar** current_operation,
+ gchar** new_version,
+ int64_t* new_size,
+ GError **error) {
+ string current_op;
+ string new_version_str;
+
+ CHECK(self->update_attempter_->GetStatus(last_checked_time,
+ progress,
+ &current_op,
+ &new_version_str,
+ new_size));
+
+ *current_operation = strdup(current_op.c_str());
+ *new_version = strdup(new_version_str.c_str());
+ return TRUE;
+}
+
« no previous file with comments | « src/platform/update_engine/dbus_service.h ('k') | src/platform/update_engine/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698