AU: Proxy Resolver classes
A collection of classes (abstract ProxyResolver interface and two
concrete implementations). The abstraction is one that should suit us
moving forward: a string URL is provided and a collection of proxy
servers is returned. One implementation always returns [no
proxy]. Another returns [manual settings from chrome, if applicable,
..., no proxy].
A future concrete implementation will consult Chrome via DBus with the
URL in question, however this is delayed until Chrome exposes such an
API.
As a result of this API missing from Chrome, this CL only resolves
proxies for a URL with manually input proxy settings.
Future CLs will integrate this into the rest of the update system.
BUG=3167
TEST=unit tests, (with future CLs) working proxy support on device
Review URL: http://codereview.chromium.org/5151005
Change-Id: If9dc6d09da681bca6f6ae74c896ba946ab81cb4d
diff --git a/dbus_interface.h b/dbus_interface.h
index 1b5c953..de09fff 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 {
@@ -25,7 +26,7 @@
// wraps dbus_g_bus_get
virtual DBusGConnection* BusGet(DBusBusType type, GError** error) = 0;
-
+
// wraps dbus_g_proxy_call
virtual gboolean ProxyCall(DBusGProxy* proxy,
const char* method,
@@ -34,6 +35,15 @@
GType var_arg1,
GHashTable** var_arg2,
GType var_arg3) = 0;
+
+ virtual gboolean ProxyCall(DBusGProxy* proxy,
+ 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) = 0;
};
class ConcreteDbusGlib : public DbusGlibInterface {
@@ -67,6 +77,19 @@
return dbus_g_proxy_call(
proxy, method, error, first_arg_type, var_arg1, var_arg2, var_arg3);
}
+
+ virtual gboolean ProxyCall(DBusGProxy* proxy,
+ 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(
+ proxy, method, error, var_arg1, var_arg2, var_arg3,
+ var_arg4, var_arg5, var_arg6, var_arg7, var_arg8);
+ }
};
} // namespace chromeos_update_engine