summaryrefslogtreecommitdiffstats
path: root/dbus/bus.h
diff options
context:
space:
mode:
authornona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-19 03:20:03 +0000
committernona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-19 03:20:03 +0000
commit7e1942af8a3fd104735e9c3b7b8800772b8c13b6 (patch)
tree30363ea070da75f795988eeb5eb277c782ff7266 /dbus/bus.h
parent9a5e6aeed9bf7bf92dc2d5a8fb7e92f26a9b9116 (diff)
downloadchromium_src-7e1942af8a3fd104735e9c3b7b8800772b8c13b6.zip
chromium_src-7e1942af8a3fd104735e9c3b7b8800772b8c13b6.tar.gz
chromium_src-7e1942af8a3fd104735e9c3b7b8800772b8c13b6.tar.bz2
Extends dbus module to accept user specified addresses.
To connect ibus-daemon, needs to extend dbus module to accept user specified addresses. The ibus provides text inputting features and it is already used in Chrome OS. The ibus uses dbus protocol but using the ibus-daemon instead of the dbus-daemon. BUG=chromium-os:26334 TEST=ran dbus_unittests Review URL: http://codereview.chromium.org/10021044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132933 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus/bus.h')
-rw-r--r--dbus/bus.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/dbus/bus.h b/dbus/bus.h
index 8e3ceea..b015eb9 100644
--- a/dbus/bus.h
+++ b/dbus/bus.h
@@ -135,10 +135,12 @@ class Bus : public base::RefCountedThreadSafe<Bus> {
public:
// Specifies the bus type. SESSION is used to communicate with per-user
// services like GNOME applications. SYSTEM is used to communicate with
- // system-wide services like NetworkManager.
+ // system-wide services like NetworkManager. CUSTOM_ADDRESS is used to
+ // communicate with an user specified address.
enum BusType {
SESSION = DBUS_BUS_SESSION,
- SYSTEM = DBUS_BUS_SYSTEM,
+ SYSTEM = DBUS_BUS_SYSTEM,
+ CUSTOM_ADDRESS,
};
// Specifies the connection type. PRIVATE should usually be used unless
@@ -170,6 +172,24 @@ class Bus : public base::RefCountedThreadSafe<Bus> {
// 1) Already running.
// 2) Has a MessageLoopForIO.
scoped_refptr<base::MessageLoopProxy> dbus_thread_message_loop_proxy;
+
+ // Specifies the server addresses to be connected. If you want to
+ // communicate with non dbus-daemon such as ibus-daemon, set |bus_type| to
+ // CUSTOM_ADDRESS, and |address| to the D-Bus server address you want to
+ // connect to. The format of this address value is the dbus address style
+ // which is described in
+ // http://dbus.freedesktop.org/doc/dbus-specification.html#addresses
+ //
+ // EXAMPLE USAGE:
+ // dbus::Bus::Options options;
+ // options.bus_type = CUSTOM_ADDRESS;
+ // options.address.assign("unix:path=/tmp/dbus-XXXXXXX");
+ // // Set up other options
+ // dbus::Bus bus(options);
+ //
+ // // Do something.
+ //
+ std::string address;
};
// Creates a Bus object. The actual connection will be established when
@@ -526,6 +546,8 @@ class Bus : public base::RefCountedThreadSafe<Bus> {
int num_pending_watches_;
int num_pending_timeouts_;
+ std::string address_;
+
DISALLOW_COPY_AND_ASSIGN(Bus);
};