summaryrefslogtreecommitdiffstats
path: root/dbus/bus.cc
Commit message (Collapse)AuthorAgeFilesLines
* dbus: add ObjectPath typekeybuk@google.com2012-02-141-11/+13
| | | | | | | | | | | | | | | | | | 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-13/+11
| | | | | | | | | | | | | | | | | | | | 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-11/+13
| | | | | | | | | | | | | | | | | 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
* Allow dbus clients to silence logging when a service is unavailable.adamk@chromium.org2012-02-101-3/+10
| | | | | | | | BUG=109696 Review URL: https://chromiumcodereview.appspot.com/9373039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121544 0039d316-1c4b-4281-b951-d872f2087c98
* CrOS: Remove a DCHECK causing test failures in DBus on Aurajamescook@chromium.org2011-11-241-1/+4
| | | | | | | | | | | | The tests run fine without this check, and we've filed a bug to investigate further. BUG=chromium-os:23416 TEST=browser_tests Review URL: http://codereview.chromium.org/8682028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111498 0039d316-1c4b-4281-b951-d872f2087c98
* Make ExportedObject and ObjectProxy own Bus as scoped_refptr.satorux@chromium.org2011-10-131-0/+6
| | | | | | | | | | | | | | | | They should own Bus as scoped_refptr, rather than raw pointer. Otherwise, they may reference |bus_| after Bus is deleted. I know this is convoluted. I'm planning to minimize use of scoped_refptr from dbus/* but this change is necessary until then. TEST=run dbus_unittest under valgrind and confirm no memory leaks BUG=chromium-os:21379 Review URL: http://codereview.chromium.org/8201023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105222 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Eliminate an irrelevant LOG(ERROR) from Bus::AddMatch().satorux@chromium.org2011-10-121-1/+1
| | | | | | | | | | | | | | Clients of the library cannot tell if a match rule has been already added or not (we could expose such a function but not so useful). Hence LOG(ERROR) is irrelevant here. Also update the comment in bus.h. TEST=dbus_unittests BUG=none Review URL: http://codereview.chromium.org/8223021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105205 0039d316-1c4b-4281-b951-d872f2087c98
* Eliminate a timed wait from ExportedObject::HandleMessage().satorux@chromium.org2011-10-071-1/+0
| | | | | | | | | | | | | | | | | Previouslly, we blocked in D-Bus thread until the method call is handled in the UI thread. Turned out this was a bad idea, and caused a crash when the UI thread is hanging (crosbug.com/21341). This patch will eliminate the timed wait and incoming methods will be handled completely asynchronously. BUG=chromium-os:21341 TEST=run dbus_unittests under valgrind Review URL: http://codereview.chromium.org/8175009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104497 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a bug in dbus::Bus::AddFilterFunction().satorux@chromium.org2011-10-061-11/+19
| | | | | | | | | | | We should not reject the same function if it's associated with different data. BUG=99258 TEST=adde a unit test and confirmed it passed. Review URL: http://codereview.chromium.org/8161005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104208 0039d316-1c4b-4281-b951-d872f2087c98
* Use MessageLoopProxy for the origin message loop as well.satorux@chromium.org2011-09-081-10/+30
| | | | | | | | | | | | | 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-061-1/+0
| | | | | | | | | | | | | | | | | | - 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-061-21/+11
| | | | | | | | | 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-021-10/+23
| | | | | | | | | | | | | | | | 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-311-3/+3
| | | | | | | | | | | | 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-271-9/+14
| | | | | | | | | | | | | | | | | - 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
* Reuse existing object proxies and exported objects, if these exist.satorux@chromium.org2011-08-231-8/+24
| | | | | | | | | | | | 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-231-3/+88
| | | | | | | | | | | | | | | | 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
* Implement Bus and ObjectProxy classes for our D-Bus library.satorux@chromium.org2011-08-171-0/+613
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