summaryrefslogtreecommitdiffstats
path: root/dbus
Commit message (Collapse)AuthorAgeFilesLines
* Linux: add two new DBus client library utility functions, to be used by KWallet.mdm@chromium.org2011-09-193-7/+66
| | | | | | | | 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
* Stop restricting the sender object path for incoming signals.satorux@chromium.org2011-09-144-6/+46
| | | | | | | | | | | | | | | | | | Restricting the sender path makes it impossible to test signal handling with dbus-send --type=signal, as it uses "/" as the sender object path. For now, let's remove the restriction. We can make this restriction customizable when it becomes necessary. This is for http://codereview.chromium.org/7862020/ TEST=dbus_unittests BUG=none Review URL: http://codereview.chromium.org/7845029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101171 0039d316-1c4b-4281-b951-d872f2087c98
* Use MessageLoopProxy for the origin message loop as well.satorux@chromium.org2011-09-082-11/+31
| | | | | | | | | | | | | Inspired by mdm's patch to use the message loop proxy for the D-Bus thread. Using MessageLoopProxy is a great way to make shutdown safer. We should use this for the origin message loop as well. BUG=chromium:90036 TEST=dbus_unittests Review URL: http://codereview.chromium.org/7847013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100279 0039d316-1c4b-4281-b951-d872f2087c98
* Add some histograms to the D-Bus library:satorux@chromium.org2011-09-065-21/+90
| | | | | | | | | | | | | | | | | | - DBus.SyncMethodCallTime: time spent to perform synchronos method calls - DBus.AsyncMethodCallTime: time spent to perform asynchronos method calls - DBus.SyncMethodCallSuccess: success ratio of synchronous method calls - DBus.AsyncMethodCallSuccess: success ratio of asynchronous method calls - DBus.ExportedMethodHandleTime: time spent to handle calls to export methods - DBus.ExportedMethodHandleSuccess: success ratio of the exported method calls - DBus.SignalHandleTime: time spent to handle signals - DBus.SignalSendTime: time spent to send signals BUG=chromium:90036 TEST=dbus_unittests Review URL: http://codereview.chromium.org/7824054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99811 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: use MessageLoopProxy instead of base::Thread in our DBus client library. mdm@chromium.org2011-09-067-45/+40
| | | | | | | | | 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
* Add Bus::ShutdownOnDBusThreadAndBlock() and remove bus::Shutdown()satorux@chromium.org2011-09-028-70/+92
| | | | | | | | | | | | | | | | This function is intended to use at the the very end of the browser shutdown, where it it makes more sense to shut down the bus synchronously, than trying to make it asynchronous. Remove Bus::Shutdown() as we are unlikely to need it for the production code. BUG=chromium:90036 TEST=dbus_unittests Review URL: http://codereview.chromium.org/7830009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99331 0039d316-1c4b-4281-b951-d872f2087c98
* Fix typos in the D-Bus library.satorux@chromium.org2011-08-317-17/+17
| | | | | | | | | | | | 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
* Minor cleanups and improvements for the D-Bus library.satorux@chromium.org2011-08-276-15/+35
| | | | | | | | | | | | | | | | | - Add mock_export_object.{cc,h} to dbus.gyp, which were missing. - Add a comment about shutdown of Bus in bus.h. - Update mock_unittest.cc to call ShutdownAndBlock(). - Replace DCHECKs with LOG(ERROR)s followed by early exit. - Add virtual to SetUp() and TearDown() in tests. - Renamed a member variable to make it clearer. BUG=chromium:90036 TEST=dbus_unittests Review URL: http://codereview.chromium.org/7745044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98560 0039d316-1c4b-4281-b951-d872f2087c98
* Add mock classes for Bus, ObjectProxy, and ExportedObject.satorux@chromium.org2011-08-2511-7/+411
| | | | | | | | | | | | Also add mock_unittest.cc that demonstrates how to mock synchronos and asynchronos D-Bus method calls. BUG=90036 TEST=dbus_unittests Review URL: http://codereview.chromium.org/7714030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98188 0039d316-1c4b-4281-b951-d872f2087c98
* Fix design shortcomings in Message classes.satorux@chromium.org2011-08-246-202/+225
| | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Reuse existing object proxies and exported objects, if these exist.satorux@chromium.org2011-08-234-16/+118
| | | | | | | | | | | | The Bus object shouldn't return new objects if the bus object already owns the requested object proxies, or the exported objects. BUG=90036 TEST=dbus_unittests Review URL: http://codereview.chromium.org/7702001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97898 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for sending and receiving D-Bus signals.satorux@chromium.org2011-08-2312-18/+599
| | | | | | | | | | | | | | | | 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-223-0/+36
| | | | | | | | | | | 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
* Rework TestService using asynchronos API of ExportedObject.satorux@chromium.org2011-08-206-75/+168
| | | | | | | | | | | | | | | | | This change is to to exercise asynchronos API of ExportedObject. The asynchronos API is implemented on top the synchronos API, hence the synchronos API code is also covered. Along the way, change EndToEndAsyncTest to use the D-Bus thread. Simplified the test code per phajdan.jr's comments as well. TEST=dbus_unittests BUG=90036 Review URL: http://codereview.chromium.org/7671028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97540 0039d316-1c4b-4281-b951-d872f2087c98
* Implement Bus and ObjectProxy classes for our D-Bus library.satorux@chromium.org2011-08-1712-0/+2211
| | | | | | | | | | | | | ObjectProxy is used to access remote objects. ExportedObject is used to export objects to other D-Bus BUG=90036 TEST=run unit tests. The code is not yet used in Chrome. Review URL: http://codereview.chromium.org/7491029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97204 0039d316-1c4b-4281-b951-d872f2087c98
* Fix typos in the message test.satorux@chromium.org2011-08-161-3/+3
| | | | | | | | | TEST=run dbus_unittests BUG=none Review URL: http://codereview.chromium.org/7669006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97055 0039d316-1c4b-4281-b951-d872f2087c98
* Add utility functions to Message classes.satorux@chromium.org2011-08-103-47/+298
| | | | | | | | | | | | | 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
* Fix linux build breakrsleevi@chromium.org2011-07-301-3/+5
| | | | | | | | | | TBR=satorux@chromium.org BUG=none TEST=none Review URL: http://codereview.chromium.org/7453041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94846 0039d316-1c4b-4281-b951-d872f2087c98
* Implement classes used for manipulating D-Bus messages.satorux@chromium.org2011-07-304-0/+1388
| | | | | | | | | | | | | | | 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
* Add libdbus dependency for Linux.satorux@chromium.org2011-07-221-0/+21
This is the first patch for our own D-Bus client library. The D-Bus client code will be placed under 'dbus' on the top level directory More patches will follow. BUG=90036 TEST=try bot to make sure this won't break builds. Review URL: http://codereview.chromium.org/7467031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93658 0039d316-1c4b-4281-b951-d872f2087c98