Index: dbus/message.cc |
diff --git a/dbus/message.cc b/dbus/message.cc |
index 43e88e2286ad498fb99fa54dc939c858e7a67c69..c8663f72ad682ce21c4339d09971a8869eed829b 100644 |
--- a/dbus/message.cc |
+++ b/dbus/message.cc |
@@ -222,11 +222,11 @@ std::string Message::ToStringInternal(const std::string& indent, |
case UNIX_FD: { |
CHECK(IsDBusTypeUnixFdSupported()); |
- FileDescriptor file_descriptor; |
+ base::ScopedFD file_descriptor; |
if (!reader->PopFileDescriptor(&file_descriptor)) |
return kBrokenMessage; |
output += indent + "fd#" + |
- base::IntToString(file_descriptor.value()) + "\n"; |
+ base::IntToString(file_descriptor.get()) + "\n"; |
break; |
} |
default: |
@@ -719,17 +719,6 @@ void MessageWriter::AppendFileDescriptor(int value) { |
AppendBasic(DBUS_TYPE_UNIX_FD, &value); // This duplicates the FD. |
} |
-void MessageWriter::AppendFileDescriptor(const FileDescriptor& value) { |
- CHECK(IsDBusTypeUnixFdSupported()); |
- |
- if (!value.is_valid()) { |
- // NB: sending a directory potentially enables sandbox escape |
- LOG(FATAL) << "Attempt to pass invalid file descriptor"; |
- } |
- int fd = value.value(); |
- AppendBasic(DBUS_TYPE_UNIX_FD, &fd); |
-} |
- |
// |
// MessageReader implementation. |
// |
@@ -1033,17 +1022,4 @@ bool MessageReader::PopFileDescriptor(base::ScopedFD* value) { |
return true; |
} |
-bool MessageReader::PopFileDescriptor(FileDescriptor* value) { |
- CHECK(IsDBusTypeUnixFdSupported()); |
- |
- int fd = -1; |
- const bool success = PopBasic(DBUS_TYPE_UNIX_FD, &fd); |
- if (!success) |
- return false; |
- |
- value->PutValue(fd); |
- // NB: the caller must check validity before using the value |
- return true; |
-} |
- |
} // namespace dbus |