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

Unified Diff: dbus/message.cc

Issue 2081153002: No dbus::FileDescriptor in DebugDaemonClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 4 months 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
« no previous file with comments | « dbus/message.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « dbus/message.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698