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

Unified Diff: dbus_interface.h

Issue 6594025: AU: Full proxy support (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: fixes for review Created 9 years, 10 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_constants.h ('k') | main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus_interface.h
diff --git a/dbus_interface.h b/dbus_interface.h
index de09fffd8ff75d52f8482cc3d4835d142a24ae00..ec266b5d324848016d6dfd1a492da95216b9b8a2 100644
--- a/dbus_interface.h
+++ b/dbus_interface.h
@@ -9,6 +9,7 @@
#include <base/logging.h>
#include <dbus/dbus-glib.h>
+#include <dbus/dbus-glib-lowlevel.h>
namespace chromeos_update_engine {
@@ -25,7 +26,7 @@ class DbusGlibInterface {
virtual void ProxyUnref(DBusGProxy* proxy) = 0;
// wraps dbus_g_bus_get
- virtual DBusGConnection* BusGet(DBusBusType type, GError** error) = 0;
+ virtual DBusGConnection* BusGet(DBusBusType type, GError** error) = 0;
// wraps dbus_g_proxy_call
virtual gboolean ProxyCall(DBusGProxy* proxy,
@@ -44,6 +45,38 @@ class DbusGlibInterface {
GType var_arg4, gchar** var_arg5,
GType var_arg6, GArray** var_arg7,
GType var_arg8) = 0;
+
+ virtual gboolean ProxyCall(DBusGProxy* proxy,
+ const char* method,
+ GError** error,
+ GType var_arg1, const char* var_arg2,
+ GType var_arg3, const char* var_arg4,
+ GType var_arg5, const char* var_arg6,
+ GType var_arg7, GType var_arg8) = 0;
+
+ virtual DBusConnection* ConnectionGetConnection(DBusGConnection* gbus) = 0;
+
+ virtual void DbusBusAddMatch(DBusConnection* connection,
+ const char* rule,
+ DBusError* error) = 0;
+
+ virtual dbus_bool_t DbusConnectionAddFilter(
+ DBusConnection* connection,
+ DBusHandleMessageFunction function,
+ void* user_data,
+ DBusFreeFunction free_data_function) = 0;
+ virtual void DbusConnectionRemoveFilter(DBusConnection* connection,
+ DBusHandleMessageFunction function,
+ void* user_data) = 0;
+ virtual dbus_bool_t DbusMessageIsSignal(DBusMessage* message,
+ const char* interface,
+ const char* signal_name) = 0;
+ virtual dbus_bool_t DbusMessageGetArgs(DBusMessage* message,
+ DBusError* error,
+ GType var_arg1, char** var_arg2,
+ GType var_arg3, char** var_arg4,
+ GType var_arg5, char** var_arg6,
+ GType var_arg7) = 0;
};
class ConcreteDbusGlib : public DbusGlibInterface {
@@ -63,7 +96,7 @@ class ConcreteDbusGlib : public DbusGlibInterface {
g_object_unref(proxy);
}
- virtual DBusGConnection* BusGet(DBusBusType type, GError** error) {
+ virtual DBusGConnection* BusGet(DBusBusType type, GError** error) {
return dbus_g_bus_get(type, error);
}
@@ -90,6 +123,62 @@ class ConcreteDbusGlib : public DbusGlibInterface {
proxy, method, error, var_arg1, var_arg2, var_arg3,
var_arg4, var_arg5, var_arg6, var_arg7, var_arg8);
}
+
+ virtual gboolean ProxyCall(DBusGProxy* proxy,
+ const char* method,
+ GError** error,
+ GType var_arg1, const char* var_arg2,
+ GType var_arg3, const char* var_arg4,
+ GType var_arg5, const char* var_arg6,
+ GType var_arg7, GType var_arg8) {
+ return dbus_g_proxy_call(
+ proxy, method, error, var_arg1, var_arg2, var_arg3,
+ var_arg4, var_arg5, var_arg6, var_arg7, var_arg8);
+ }
+
+
+ virtual DBusConnection* ConnectionGetConnection(DBusGConnection* gbus) {
+ return dbus_g_connection_get_connection(gbus);
+ }
+
+ virtual void DbusBusAddMatch(DBusConnection* connection,
+ const char* rule,
+ DBusError* error) {
+ dbus_bus_add_match(connection, rule, error);
+ }
+
+ virtual dbus_bool_t DbusConnectionAddFilter(
+ DBusConnection* connection,
+ DBusHandleMessageFunction function,
+ void* user_data,
+ DBusFreeFunction free_data_function) {
+ return dbus_connection_add_filter(connection,
+ function,
+ user_data,
+ free_data_function);
+ }
+ virtual void DbusConnectionRemoveFilter(DBusConnection* connection,
+ DBusHandleMessageFunction function,
+ void* user_data) {
+ dbus_connection_remove_filter(connection, function, user_data);
+ }
+ dbus_bool_t DbusMessageIsSignal(DBusMessage* message,
+ const char* interface,
+ const char* signal_name) {
+ return dbus_message_is_signal(message, interface, signal_name);
+ }
+ virtual dbus_bool_t DbusMessageGetArgs(DBusMessage* message,
+ DBusError* error,
+ GType var_arg1, char** var_arg2,
+ GType var_arg3, char** var_arg4,
+ GType var_arg5, char** var_arg6,
+ GType var_arg7) {
+ return dbus_message_get_args(message, error,
+ var_arg1, var_arg2,
+ var_arg3, var_arg4,
+ var_arg5, var_arg6,
+ var_arg7);
+ }
};
} // namespace chromeos_update_engine
« no previous file with comments | « dbus_constants.h ('k') | main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698