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

Unified Diff: dbus/message.cc

Issue 10822016: Revert 148351 - Make dbus file descriptor check dynamic (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
===================================================================
--- dbus/message.cc (revision 148352)
+++ dbus/message.cc (working copy)
@@ -18,9 +18,9 @@
// Appends the header name and the value to |output|, if the value is
// not empty.
-void AppendStringHeader(const std::string& header_name,
- const std::string& header_value,
- std::string* output) {
+static void AppendStringHeader(const std::string& header_name,
+ const std::string& header_value,
+ std::string* output) {
if (!header_value.empty()) {
*output += header_name + ": " + header_value + "\n";
}
@@ -28,24 +28,15 @@
// Appends the header name and the value to |output|, if the value is
// nonzero.
-void AppendUint32Header(const std::string& header_name,
- uint32 header_value,
- std::string* output) {
+static void AppendUint32Header(const std::string& header_name,
+ uint32 header_value,
+ std::string* output) {
if (header_value != 0) {
*output += (header_name + ": " + base::StringPrintf("%u", header_value) +
"\n");
}
}
-// Returns true if Unix FD passing is supported in libdbus.
-// The check is done runtime rather than compile time as the libdbus
-// version used at runtime may be different from the one used at compile time.
-bool IsDBusTypeUnixFdSupported() {
- int major = 0, minor = 0, micro = 0;
- dbus_get_version(&major, &minor, &micro);
- return major >= 1 && minor >= 4;
-}
-
} // namespace
namespace dbus {
@@ -220,7 +211,7 @@
break;
}
case UNIX_FD: {
- CHECK(IsDBusTypeUnixFdSupported());
+ CHECK(kDBusTypeUnixFdIsSupported);
FileDescriptor file_descriptor;
if (!reader->PopFileDescriptor(&file_descriptor))
@@ -699,7 +690,7 @@
}
void MessageWriter::AppendFileDescriptor(const FileDescriptor& value) {
- CHECK(IsDBusTypeUnixFdSupported());
+ CHECK(kDBusTypeUnixFdIsSupported);
if (!value.is_valid()) {
// NB: sending a directory potentially enables sandbox escape
@@ -969,7 +960,7 @@
}
bool MessageReader::PopFileDescriptor(FileDescriptor* value) {
- CHECK(IsDBusTypeUnixFdSupported());
+ CHECK(kDBusTypeUnixFdIsSupported);
int fd = -1;
const bool success = PopBasic(DBUS_TYPE_UNIX_FD, &fd);
« 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