summaryrefslogtreecommitdiffstats
path: root/dbus/message.cc
Commit message (Collapse)AuthorAgeFilesLines
* dbus: Fix a bug where we rejected an empty array in PopArrayOfBytes()satorux@chromium.org2011-11-111-1/+7
| | | | | | | | | | | | | An empty array should be allowed. Sometimes, you need to send an empty array from methods and signals. BUG=103793 TEST=added a test in dbus_unittests Review URL: http://codereview.chromium.org/8525012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109561 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: add two new DBus client library utility functions, to be used by KWallet.mdm@chromium.org2011-09-191-0/+25
| | | | | | | | The new functions are AppendArrayOfStrings and PopArrayOfStrings, which have self-explanatory names. Currently the KWallet code does this looping itself. Review URL: http://codereview.chromium.org/7941009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101781 0039d316-1c4b-4281-b951-d872f2087c98
* Fix design shortcomings in Message classes.satorux@chromium.org2011-08-241-26/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Prohibit to instantiate Message class. Rationale: this is not corresponding to any D-Bus message types. - Get rid of Message::reset_raw_message() Rationale: this was breaking encapsulation. For instance, It was possible to inject a DBUS_MESSAGE_TYPE_ERROR raw message to a MethodCall message, which should not be allowed. - Prohibit to instantiate Response/ErrorResponse with NULL raw message. Rationale: Message objects should be backed up by valid raw messages. - Change Object::CallMethodAndBlock() to return Response*. Rationale: the original API requred a Response object with raw_message_ set to NULL, which we no longer allow. - Add message_type header to ToString(). BUG=90036 TEST=dbus_unittests Review URL: http://codereview.chromium.org/7709009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97983 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for sending and receiving D-Bus signals.satorux@chromium.org2011-08-231-0/+25
| | | | | | | | | | | | | | | | ObjectProxy is used to receive signals from the remote object. ExportedObject is used to send signals from the exported object. Note that signals are asynchronos so we don't have a test in end_to_end_sync_unittest.cc BUG=90036 TEST=run unit tests Review URL: http://codereview.chromium.org/7655033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97831 0039d316-1c4b-4281-b951-d872f2087c98
* Add AppendArrayOfObjectPaths, which was missing.satorux@chromium.org2011-08-221-0/+11
| | | | | | | | | | | It was an oversight not to have this function. BUG=90036 TEST=dbus_unittests Review URL: http://codereview.chromium.org/7686013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97689 0039d316-1c4b-4281-b951-d872f2087c98
* Add utility functions to Message classes.satorux@chromium.org2011-08-101-35/+156
| | | | | | | | | | | | | The new functions will be used to implement other classes that will be added in a separate patch. BUG=90036 TEST=run unit tests Review URL: http://codereview.chromium.org/7569020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96231 0039d316-1c4b-4281-b951-d872f2087c98
* Fix subtle memory issues detected by valgrind.satorux@chromium.org2011-08-041-4/+22
| | | | | | | | | | | | | | | | | | The size of dbus_bool_t and the size of bool are different. The former is always 4, whereas the latter is usually 1. The misuse of these types causes subtle memory issues where some D-Bus functions read 4 bytes from a bool pointer, or write 4 bytes to it. These functions take void* so type checking didn't help. TEST=tools/valgrind/valgrind.sh ninja/dbus_unittests BUG=none Review URL: http://codereview.chromium.org/7573001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95512 0039d316-1c4b-4281-b951-d872f2087c98
* Implement classes used for manipulating D-Bus messages.satorux@chromium.org2011-07-301-0/+664
Message/MethodCall/Response classes wrap around DBusMessage. MessageReader and Message Writer provide API to read and write D-Bus messages in a type safe fashion. BUG=90036 TEST=The code is not yet used in Chrome. Run unit tests. Review URL: http://codereview.chromium.org/7492029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94845 0039d316-1c4b-4281-b951-d872f2087c98