diff options
author | sleffler@chromium.org <sleffler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-30 06:46:20 +0000 |
---|---|---|
committer | sleffler@chromium.org <sleffler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-30 06:46:20 +0000 |
commit | e146bfcf4924815ea32b0e135d720eed26d5bade (patch) | |
tree | 2f6f69341aca38b5f2eb5ec5b0725651f4ea3c3b /dbus/message.h | |
parent | 9129b4fc22326a23a141c668e936e650801521e0 (diff) | |
download | chromium_src-e146bfcf4924815ea32b0e135d720eed26d5bade.zip chromium_src-e146bfcf4924815ea32b0e135d720eed26d5bade.tar.gz chromium_src-e146bfcf4924815ea32b0e135d720eed26d5bade.tar.bz2 |
dbus: add support for passing file descriptors
Add support for passing file descriptors in messages.
BUG=chromium-os:27809
TEST=run unit tests
Change-Id: I48e52e52ea1e1a4b96bb0dbec7242337e5871510
Review URL: http://codereview.chromium.org/9700072
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129801 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus/message.h')
-rw-r--r-- | dbus/message.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dbus/message.h b/dbus/message.h index 3a28fb0..75e4045 100644 --- a/dbus/message.h +++ b/dbus/message.h @@ -11,6 +11,7 @@ #include <dbus/dbus.h> #include "base/basictypes.h" +#include "dbus/file_descriptor.h" #include "dbus/object_path.h" namespace google { @@ -27,6 +28,14 @@ namespace dbus { class MessageWriter; class MessageReader; +// DBUS_TYPE_UNIX_FD was added in D-Bus version 1.4 +#if defined(DBUS_TYPE_UNIX_FD) +const bool kDBusTypeUnixFdIsSupported = true; +#else +const bool kDBusTypeUnixFdIsSupported = false; +#define DBUS_TYPE_UNIX_FD ((int) 'h') +#endif + // Message is the base class of D-Bus message types. Client code must use // sub classes such as MethodCall and Response instead. // @@ -67,6 +76,7 @@ class Message { STRUCT = DBUS_TYPE_STRUCT, DICT_ENTRY = DBUS_TYPE_DICT_ENTRY, VARIANT = DBUS_TYPE_VARIANT, + UNIX_FD = DBUS_TYPE_UNIX_FD, }; // Returns the type of the message. Returns MESSAGE_INVALID if @@ -268,6 +278,7 @@ class MessageWriter { void AppendDouble(double value); void AppendString(const std::string& value); void AppendObjectPath(const ObjectPath& value); + void AppendFileDescriptor(const FileDescriptor& value); // Opens an array. The array contents can be added to the array with // |sub_writer|. The client code must close the array with @@ -377,6 +388,7 @@ class MessageReader { bool PopDouble(double* value); bool PopString(std::string* value); bool PopObjectPath(ObjectPath* value); + bool PopFileDescriptor(FileDescriptor* value); // Sets up the given message reader to read an array at the current // iterator position. |