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

Unified Diff: dbus_interface.h

Issue 5151005: AU: Proxy Resolver classes (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: tests Created 10 years, 1 month 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
Index: dbus_interface.h
diff --git a/dbus_interface.h b/dbus_interface.h
index 1b5c9536ce25a9580ada598745f2a34b8a6d2680..be4c778e578f781f763cd753b85e36c6a8d82620 100644
--- a/dbus_interface.h
+++ b/dbus_interface.h
@@ -7,6 +7,7 @@
// This class interfaces with DBus. The interface allows it to be mocked.
+#include <base/logging.h>
#include <dbus/dbus-glib.h>
namespace chromeos_update_engine {
@@ -34,6 +35,19 @@ class DbusGlibInterface {
GType var_arg1,
GHashTable** var_arg2,
GType var_arg3) = 0;
+ // Mock calls only go up to 10 args, so this is not required to be
petkov 2010/11/18 23:26:46 add an empty line before.
adlr 2010/11/19 00:41:06 this comment was outdated and has been removed. al
+ // implemented in the mock.
+ virtual gboolean ProxyCall(DBusGProxy* proxy,
+ const char* method,
+ GError** error,
+ GType, const char*,
petkov 2010/11/18 23:26:46 per style, you have to name the parameters, right?
adlr 2010/11/19 00:41:06 Done.
+ GType,
+ GType, gchar**,
+ GType, GArray**,
+ GType) {
petkov 2010/11/18 23:26:46 The last argument is always INVALID, right? So you
adlr 2010/11/19 00:41:06 i got the mock to implement this, so the impl here
petkov 2010/11/19 01:09:19 OK, although the last argument is still unnecessar
adlr 2010/11/19 02:00:52 It's true that it's not necessary since in practic
+ NOTREACHED();
+ return false; // appease gcc
+ };
};
class ConcreteDbusGlib : public DbusGlibInterface {
@@ -67,6 +81,18 @@ class ConcreteDbusGlib : public DbusGlibInterface {
return dbus_g_proxy_call(
proxy, method, error, first_arg_type, var_arg1, var_arg2, var_arg3);
}
+ virtual gboolean ProxyCall(DBusGProxy* proxy,
petkov 2010/11/18 23:26:46 add an empty line before.
adlr 2010/11/19 00:41:06 Done.
+ const char* method,
+ GError** error,
+ GType var_arg1, const char* var_arg2,
+ GType var_arg3,
+ GType var_arg4, gchar** var_arg5,
+ GType var_arg6, GArray** var_arg7,
+ GType var_arg8) {
+ return dbus_g_proxy_call(
petkov 2010/11/18 23:26:46 Do you want to use a dbus_g_proxy_call with a time
adlr 2010/11/19 00:41:06 I think there's a default timeout of 30s, which th
+ proxy, method, error, var_arg1, var_arg2, var_arg3,
+ var_arg4, var_arg5, var_arg6, var_arg7, var_arg8);
+ }
};
} // namespace chromeos_update_engine

Powered by Google App Engine
This is Rietveld 408576698