| Index: dbus/message.cc
|
| diff --git a/dbus/message.cc b/dbus/message.cc
|
| index 4a84756c41fcb65a79a245af71e8254875375201..43e88e2286ad498fb99fa54dc939c858e7a67c69 100644
|
| --- a/dbus/message.cc
|
| +++ b/dbus/message.cc
|
| @@ -714,6 +714,11 @@ void MessageWriter::AppendVariantOfBasic(int dbus_type, const void* value) {
|
| CloseContainer(&variant_writer);
|
| }
|
|
|
| +void MessageWriter::AppendFileDescriptor(int value) {
|
| + CHECK(IsDBusTypeUnixFdSupported());
|
| + AppendBasic(DBUS_TYPE_UNIX_FD, &value); // This duplicates the FD.
|
| +}
|
| +
|
| void MessageWriter::AppendFileDescriptor(const FileDescriptor& value) {
|
| CHECK(IsDBusTypeUnixFdSupported());
|
|
|
| @@ -1016,6 +1021,18 @@ bool MessageReader::PopVariantOfBasic(int dbus_type, void* value) {
|
| return variant_reader.PopBasic(dbus_type, value);
|
| }
|
|
|
| +bool MessageReader::PopFileDescriptor(base::ScopedFD* value) {
|
| + CHECK(IsDBusTypeUnixFdSupported());
|
| +
|
| + int fd = -1;
|
| + const bool success = PopBasic(DBUS_TYPE_UNIX_FD, &fd);
|
| + if (!success)
|
| + return false;
|
| +
|
| + *value = base::ScopedFD(fd);
|
| + return true;
|
| +}
|
| +
|
| bool MessageReader::PopFileDescriptor(FileDescriptor* value) {
|
| CHECK(IsDBusTypeUnixFdSupported());
|
|
|
|
|