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

Side by Side Diff: src/platform/update_engine/dbus_service.cc

Issue 2037002: AU: DBus support. (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: fixes for 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
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "update_engine/dbus_service.h" 5 #include "update_engine/dbus_service.h"
6 #include <string> 6 #include <string>
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "update_engine/marshal.glibmarshal.h"
8 9
9 using std::string; 10 using std::string;
10 11
11 G_DEFINE_TYPE(UpdateEngineService, update_engine_service, G_TYPE_OBJECT) 12 G_DEFINE_TYPE(UpdateEngineService, update_engine_service, G_TYPE_OBJECT)
12 13
13 static void update_engine_service_finalize(GObject* object) { 14 static void update_engine_service_finalize(GObject* object) {
14 G_OBJECT_CLASS(update_engine_service_parent_class)->finalize(object); 15 G_OBJECT_CLASS(update_engine_service_parent_class)->finalize(object);
15 } 16 }
16 17
18 static guint status_update_signal = 0;
19
17 static void update_engine_service_class_init(UpdateEngineServiceClass* klass) { 20 static void update_engine_service_class_init(UpdateEngineServiceClass* klass) {
18 GObjectClass *object_class; 21 GObjectClass *object_class;
19 object_class = G_OBJECT_CLASS(klass); 22 object_class = G_OBJECT_CLASS(klass);
20 object_class->finalize = update_engine_service_finalize; 23 object_class->finalize = update_engine_service_finalize;
24
25 status_update_signal = g_signal_new(
26 "status_update",
27 G_OBJECT_CLASS_TYPE(klass),
28 G_SIGNAL_RUN_LAST,
29 0, // 0 == no class method associated
30 NULL, // Accumulator
31 NULL, // Accumulator data
32 update_engine_VOID__INT64_DOUBLE_STRING_STRING_INT64,
33 G_TYPE_NONE, // Return type
34 5, // param count:
35 G_TYPE_INT64,
36 G_TYPE_DOUBLE,
37 G_TYPE_STRING,
38 G_TYPE_STRING,
39 G_TYPE_INT64);
21 } 40 }
22 41
23 static void update_engine_service_init(UpdateEngineService* object) { 42 static void update_engine_service_init(UpdateEngineService* object) {
24 } 43 }
25 44
26 UpdateEngineService* update_engine_service_new(void) { 45 UpdateEngineService* update_engine_service_new(void) {
27 return reinterpret_cast<UpdateEngineService*>( 46 return reinterpret_cast<UpdateEngineService*>(
28 g_object_new(UPDATE_ENGINE_TYPE_SERVICE, NULL)); 47 g_object_new(UPDATE_ENGINE_TYPE_SERVICE, NULL));
29 } 48 }
30 49
(...skipping 11 matching lines...) Expand all
42 progress, 61 progress,
43 &current_op, 62 &current_op,
44 &new_version_str, 63 &new_version_str,
45 new_size)); 64 new_size));
46 65
47 *current_operation = strdup(current_op.c_str()); 66 *current_operation = strdup(current_op.c_str());
48 *new_version = strdup(new_version_str.c_str()); 67 *new_version = strdup(new_version_str.c_str());
49 return TRUE; 68 return TRUE;
50 } 69 }
51 70
71 gboolean update_engine_service_check_for_update(UpdateEngineService* self,
72 GError **error) {
73 self->update_attempter_->CheckForUpdate();
74 return TRUE;
75 }
76
77 gboolean update_engine_service_emit_status_update(
78 UpdateEngineService* self,
79 gint64 last_checked_time,
80 gdouble progress,
81 const gchar* current_operation,
82 const gchar* new_version,
83 gint64 new_size) {
84 g_signal_emit(self,
85 status_update_signal,
86 0,
87 last_checked_time,
88 progress,
89 current_operation,
90 new_version,
91 new_size);
92 return TRUE;
93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698