OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef DBUS_MESSAGE_H_ | 5 #ifndef DBUS_MESSAGE_H_ |
6 #define DBUS_MESSAGE_H_ | 6 #define DBUS_MESSAGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 #include <dbus/dbus.h> | 10 #include <dbus/dbus.h> |
(...skipping 10 matching lines...) Expand all Loading... |
21 } // namespace protobuf | 21 } // namespace protobuf |
22 } // namespace google | 22 } // namespace google |
23 | 23 |
24 | 24 |
25 namespace dbus { | 25 namespace dbus { |
26 | 26 |
27 class MessageWriter; | 27 class MessageWriter; |
28 class MessageReader; | 28 class MessageReader; |
29 | 29 |
30 // DBUS_TYPE_UNIX_FD was added in D-Bus version 1.4 | 30 // DBUS_TYPE_UNIX_FD was added in D-Bus version 1.4 |
31 #if defined(DBUS_TYPE_UNIX_FD) | 31 #if !defined(DBUS_TYPE_UNIX_FD) |
32 const bool kDBusTypeUnixFdIsSupported = true; | |
33 #else | |
34 const bool kDBusTypeUnixFdIsSupported = false; | |
35 #define DBUS_TYPE_UNIX_FD ((int) 'h') | 32 #define DBUS_TYPE_UNIX_FD ((int) 'h') |
36 #endif | 33 #endif |
37 | 34 |
| 35 // Returns true if Unix FD passing is supported in libdbus. |
| 36 // The check is done runtime rather than compile time as the libdbus |
| 37 // version used at runtime may be different from the one used at compile time. |
| 38 bool IsDBusTypeUnixFdSupported(); |
| 39 |
38 // Message is the base class of D-Bus message types. Client code must use | 40 // Message is the base class of D-Bus message types. Client code must use |
39 // sub classes such as MethodCall and Response instead. | 41 // sub classes such as MethodCall and Response instead. |
40 // | 42 // |
41 // The class name Message is very generic, but there should be no problem | 43 // The class name Message is very generic, but there should be no problem |
42 // as the class is inside 'dbus' namespace. We chose to name this way, as | 44 // as the class is inside 'dbus' namespace. We chose to name this way, as |
43 // libdbus defines lots of types starting with DBus, such as | 45 // libdbus defines lots of types starting with DBus, such as |
44 // DBusMessage. We should avoid confusion and conflict with these types. | 46 // DBusMessage. We should avoid confusion and conflict with these types. |
45 class Message { | 47 class Message { |
46 public: | 48 public: |
47 // The message type used in D-Bus. Redefined here so client code | 49 // The message type used in D-Bus. Redefined here so client code |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 | 475 |
474 Message* message_; | 476 Message* message_; |
475 DBusMessageIter raw_message_iter_; | 477 DBusMessageIter raw_message_iter_; |
476 | 478 |
477 DISALLOW_COPY_AND_ASSIGN(MessageReader); | 479 DISALLOW_COPY_AND_ASSIGN(MessageReader); |
478 }; | 480 }; |
479 | 481 |
480 } // namespace dbus | 482 } // namespace dbus |
481 | 483 |
482 #endif // DBUS_MESSAGE_H_ | 484 #endif // DBUS_MESSAGE_H_ |
OLD | NEW |