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

Side by Side 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, 7 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "update_engine/dbus_service.h"
6 #include <string>
7 #include "base/logging.h"
8
9 using std::string;
10
11 G_DEFINE_TYPE(UpdateEngineService, update_engine_service, G_TYPE_OBJECT)
12
13 static void update_engine_service_finalize(GObject* object) {
14 G_OBJECT_CLASS(update_engine_service_parent_class)->finalize(object);
15 }
16
17 static void update_engine_service_class_init(UpdateEngineServiceClass* klass) {
18 GObjectClass *object_class;
19 object_class = G_OBJECT_CLASS(klass);
20 object_class->finalize = update_engine_service_finalize;
21 }
22
23 static void update_engine_service_init(UpdateEngineService* object) {
24 }
25
26 UpdateEngineService* update_engine_service_new(void) {
27 return reinterpret_cast<UpdateEngineService*>(
28 g_object_new(UPDATE_ENGINE_TYPE_SERVICE, NULL));
29 }
30
31 gboolean update_engine_service_get_status(UpdateEngineService* self,
32 int64_t* last_checked_time,
33 double* progress,
34 gchar** current_operation,
35 gchar** new_version,
36 int64_t* new_size,
37 GError **error) {
38 string current_op;
39 string new_version_str;
40
41 CHECK(self->update_attempter_->GetStatus(last_checked_time,
42 progress,
43 &current_op,
44 &new_version_str,
45 new_size));
46
47 *current_operation = strdup(current_op.c_str());
48 *new_version = strdup(new_version_str.c_str());
49 return TRUE;
50 }
51
OLDNEW
« 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