summaryrefslogtreecommitdiffstats
path: root/dbus/message.h
Commit message (Collapse)AuthorAgeFilesLines
* Undo a rename of dbus::Message::GetSignature.benchan2014-08-251-1/+1
| | | | | | | | | | | | | dbus::Message::GetSignature() was incorrectly renamed to dbus::Message::GetDataSigature() in https://codereview.chromium.org/502793002. This CL undoes that. BUG=None TEST=dbus_unittests Review URL: https://codereview.chromium.org/494263003 Cr-Commit-Position: refs/heads/master@{#291660}
* Add a GetSignature() method to dbus::MessageReader.benchan2014-08-251-1/+6
| | | | | | | | | | | | | The new MessageReader::GetSignature() method returns the DBus signature of the value at the current iterator position, which is needed for implementing automatic de-serialization of complex DBus messages. BUG=None TEST=dbus_unittests Review URL: https://codereview.chromium.org/502793002 Cr-Commit-Position: refs/heads/master@{#291643}
* chromeos: Make dbus::MessageReader memory ownership explicitderat@chromium.org2014-02-241-7/+10
| | | | | | | | | | | | | | | | Make memory returned by MessageReader::PopArrayOfBytes() const to make it clearer that ownership remains with the MessageReader. Also update PopArrayOfStrings() and PopArrayOfObjectPaths() to clear the passed-in vectors before appending to them. BUG=none TBR=isherman@chromium.org,mvanouwerkerk@chromium.org Review URL: https://codereview.chromium.org/176693003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252922 0039d316-1c4b-4281-b951-d872f2087c98
* Code cleaning: Uses scoped_ptr<> to express ownership rather than writing ↵yuki@chromium.org2013-02-071-17/+17
| | | | | | | | | | | | | | ownership in comments. Replaces Response* with scoped_ptr<Response> in dbus code and its related code. BUG=163231 TEST=no regression / no behavior changes Review URL: https://chromiumcodereview.appspot.com/12092061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181266 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Make it possible to build as shared_library.tfarina@chromium.org2012-11-051-8/+9
| | | | | | | | | | BUG=158887 R=satorux@chromium.org NOTRY=true Review URL: https://chromiumcodereview.appspot.com/11364033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165893 0039d316-1c4b-4281-b951-d872f2087c98
* Expose functionality to tests.davemoore@chromium.org2012-07-251-4/+6
| | | | | | | | | | | Second try of https://chromiumcodereview.appspot.com/10815083 BUG=None TEST=None TBR=satorux Review URL: https://chromiumcodereview.appspot.com/10833011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148382 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 148351 - Make dbus file descriptor check dynamicdavemoore@chromium.org2012-07-251-1/+4
| | | | | | | | | | | | | | | Without this change cros builds from outside the chroot can't run tracing code. BUG=None TEST=None Review URL: https://chromiumcodereview.appspot.com/10815083 TBR=davemoore@chromium.org Review URL: https://chromiumcodereview.appspot.com/10822016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148353 0039d316-1c4b-4281-b951-d872f2087c98
* Make dbus file descriptor check dynamicdavemoore@chromium.org2012-07-251-4/+1
| | | | | | | | | | | | Without this change cros builds from outside the chroot can't run tracing code. BUG=None TEST=None Review URL: https://chromiumcodereview.appspot.com/10815083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148351 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the rest of #pragma once in one big CL.ajwong@chromium.org2012-07-111-1/+0
| | | | | | | | | For context see this thread: https://groups.google.com/a/chromium.org/forum/?fromgroups#!topic/chromium-dev/RMcVNGjB4II TBR=thakis,pkasting,jam git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146163 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Truncate strings in dbus::Message::ToString() if too longsatorux@chromium.org2012-06-071-1/+2
| | | | | | | | | | | To prevent long strings from polluting logs. BUG=131261 TEST=added a unit test Review URL: https://chromiumcodereview.appspot.com/10537033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141021 0039d316-1c4b-4281-b951-d872f2087c98
* Change setters of dbus::Message to return false instead of aborting on errorshashimoto@chromium.org2012-05-231-6/+6
| | | | | | | | | | | | With this change, we can safely return error for invalid object path and service name. It still crashes on invalid method name and interface name if we use MethodCall::MethodCall for setting those parameters. BUG=128967 TEST=dbus_unittests Review URL: https://chromiumcodereview.appspot.com/10409065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138441 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: add support for passing file descriptorssleffler@chromium.org2012-03-301-0/+12
| | | | | | | | | | | | | | Add support for passing file descriptors in messages. BUG=chromium-os:27809 TEST=run unit tests Change-Id: I48e52e52ea1e1a4b96bb0dbec7242337e5871510 Review URL: http://codereview.chromium.org/9700072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129801 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: fix base class of ErrorResponsekeybuk@chromium.org2012-03-111-2/+3
| | | | | | | | | | | | | | | dbus::ErrorResponse needs to be a subclass of dbus::Response otherwise you can't pass it to a dbus::ExportedObject::ResponseSender. BUG=none TEST=my code now compiles Change-Id: I1efba7c2cd9aaed937cac75133ab6b695aeac63b Review URL: http://codereview.chromium.org/9675002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126053 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: add ObjectPath typekeybuk@google.com2012-02-141-8/+9
| | | | | | | | | | | | | | | | | | Rather than use std::string for object paths, add a dbus::ObjectPath type that wraps one while allowing more type-safety. This solves all sorts of issues with confusing object paths for strings, and allows us to do Properties code using templates disambiguating them from strings. BUG=chromium:109194 TEST=built and run tests Change-Id: Icaf6f19daea4af23a9d2ec0ed76d2cbd379d680e Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=121920 Review URL: https://chromiumcodereview.appspot.com/9378039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121941 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 121920 - dbus: add ObjectPath typedpapad@chromium.org2012-02-141-9/+8
| | | | | | | | | | | | | | | | | | | | Rather than use std::string for object paths, add a dbus::ObjectPath type that wraps one while allowing more type-safety. This solves all sorts of issues with confusing object paths for strings, and allows us to do Properties code using templates disambiguating them from strings. BUG=chromium:109194 TEST=built and run tests Change-Id: Icaf6f19daea4af23a9d2ec0ed76d2cbd379d680e Review URL: http://codereview.chromium.org/9378039 TBR=keybuk@chromium.org Review URL: https://chromiumcodereview.appspot.com/9363045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121923 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: add ObjectPath typekeybuk@chromium.org2012-02-141-8/+9
| | | | | | | | | | | | | | | | | Rather than use std::string for object paths, add a dbus::ObjectPath type that wraps one while allowing more type-safety. This solves all sorts of issues with confusing object paths for strings, and allows us to do Properties code using templates disambiguating them from strings. BUG=chromium:109194 TEST=built and run tests Change-Id: Icaf6f19daea4af23a9d2ec0ed76d2cbd379d680e Review URL: http://codereview.chromium.org/9378039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121920 0039d316-1c4b-4281-b951-d872f2087c98
* Adding support for sending/receiving proto bufs to dbus library.rharrison@chromium.org2012-02-091-0/+25
| | | | | | | | | | | | | | | | | | | This CL add in support to dbus wrapping classes to send and receive protocol buffers. They take in a generic MessageLite, which all protocol buffers inherit from. It will then serialize the buffer and send it out as an array of bytes. On receiving the array of bytes will be parsed back into a protocol buffer. The operations for doing this are very canned and these methods are designed to allow devs to skip writing boilerplate. The methods are just wrappers around the appopriate byte array methods. BUG=chromium:112127 TEST=Ran new unittests Review URL: http://codereview.chromium.org/9315006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121248 0039d316-1c4b-4281-b951-d872f2087c98
* chrome: dbus: add default MessageReader constructorkeybuk@chromium.org2012-02-071-5/+7
| | | | | | | | | | | | | | | | | | | | | There's no need for a dbus::MessageReader to be initialized with a message, the underlying DBusMessageIter is fully initialized by dbus_message_iter_recurse() as called by PopArray, etc. This allows for: dbus::MessageReader reader; other_reader->PopArray(&reader); BUG=none TEST=verified with arrays, variants and dictionary types. Change-Id: Id4a9d2de2b28ec3a2da42f822934a39865d9e9ef Review URL: http://codereview.chromium.org/9342009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120864 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: add two new DBus client library utility functions, to be used by KWallet.mdm@chromium.org2011-09-191-1/+14
| | | | | | | | 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
* Linux: use MessageLoopProxy instead of base::Thread in our DBus client library. mdm@chromium.org2011-09-061-1/+1
| | | | | | | | | This allows us to use BrowserThread::GetMessageLoopProxyForThread() to specify the DBus thread. Also do a little bit of unrelated comment cleanup. BUG=90036 Review URL: http://codereview.chromium.org/7800023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99794 0039d316-1c4b-4281-b951-d872f2087c98
* Fix typos in the D-Bus library.satorux@chromium.org2011-08-311-1/+1
| | | | | | | | | | | | Just wanted to remove the blank line in bus.h, but fixed typos along the way. BUG=chromium:90036 TEST=dbus_unittests Review URL: http://codereview.chromium.org/7792049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99006 0039d316-1c4b-4281-b951-d872f2087c98
* Fix design shortcomings in Message classes.satorux@chromium.org2011-08-241-23/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | - 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/+23
| | | | | | | | | | | | | | | | 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/+5
| | | | | | | | | | | 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-10/+54
| | | | | | | | | | | | | 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
* Implement classes used for manipulating D-Bus messages.satorux@chromium.org2011-07-301-0/+333
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