summaryrefslogtreecommitdiffstats
path: root/dbus/object_proxy.cc
Commit message (Collapse)AuthorAgeFilesLines
* dbus: Always return "not yet handled" for signalshashimoto@chromium.org2013-12-171-1/+3
| | | | | | | | BUG=327172 Review URL: https://codereview.chromium.org/115173002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241222 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Add ObjectProxy::WaitForServiceToBeAvailable()hashimoto@chromium.org2013-10-021-14/+72
| | | | | | | | | | | | | | Split ConnectToNameOwnerChangedSignal() from ConnectToSignalInternal(). Add WaitForServiceToBeAvailable() Add test. BUG=141009 TEST=dbus_unittests R=satorux@chromium.org Review URL: https://codereview.chromium.org/25488002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226428 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Stop accessing ObjectProxy::name_owner_changed_callback_ on the D-Bus ↵hashimoto@chromium.org2013-09-271-19/+18
| | | | | | | | | | | | | | | thread Accessing the callback on the D-Bus thread while changing its value may result in a race condition. Change the type of SetNameOwnerChangedCallback's argument from Signal to strings to stop worrying about on which thread the Signal gets released. BUG=298747 TEST=dbus_unittests R=satorux@chromium.org Review URL: https://codereview.chromium.org/24673006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225675 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Rewrite ObjectProxy::ConnectToSignal with PostTaskAndReplyWithResulthashimoto@chromium.org2013-09-261-65/+48
| | | | | | | | | | BUG=None TEST=dbus_unittests R=satorux@chromium.org Review URL: https://codereview.chromium.org/24557002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225362 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Replace PostTaskTo*Thread methods with Get*TaskRunnerhashimoto@chromium.org2013-09-261-27/+29
| | | | | | | | | | | | | By exposing TaskRunners, we'll be able to use utility functions like base::PostTaskAndReplyWithResult BUG=None TEST=git cl try R=satorux@chromium.org Review URL: https://codereview.chromium.org/24554002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225324 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Suppress NameHasNoOwner errors when connecting to signalssatorux@chromium.org2013-08-161-1/+5
| | | | | | | | | | | | | | | | | The NameHasNoOwner errors are emitted as Chrome tries to get the identity of the service when connecting to signals for sender verification (crbug.com/140938), but the service may not yet be running, which is all right, hence the NameHasNoOwner errors here should be just supressed. BUG=273829 TEST=out/Debug/dbus_unittests --gtest_filter=SignalSenderVerificationTest.TestSignalAccepted; confirm that NameHasNoOwner is no longre emitted. Previously, an error message like below was emited: [12721:12722:0816/144031:3991948732792:ERROR:bus.cc(892)] Failed to get name owner. Got org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.chromium.TestService': no such name Review URL: https://chromiumcodereview.appspot.com/23143004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217980 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of the message_loop header in dbus/, device/, ↵avi@chromium.org2013-07-171-1/+1
| | | | | | | | | | | | extensions/, google_apis/, gpu/, ipc/, jingle/. BUG=260807 TEST=none TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/19607005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212157 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of strings headers in crypto/, dbus/, device/.avi@chromium.org2013-06-111-1/+1
| | | | | | | | | | BUG=247723 TEST=none TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/16123026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205457 0039d316-1c4b-4281-b951-d872f2087c98
* DBus: Reverse error suppression logic from r198328.thestig@chromium.org2013-05-081-1/+1
| | | | | | | | BUG=181064 Review URL: https://chromiumcodereview.appspot.com/14660017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198987 0039d316-1c4b-4281-b951-d872f2087c98
* Add a method to check if a D-Bus service has an owner. Use it for mtpd.thestig@chromium.org2013-05-041-52/+30
| | | | | | | | BUG=181064 Review URL: https://chromiumcodereview.appspot.com/14568005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198328 0039d316-1c4b-4281-b951-d872f2087c98
* D-Bus: allow multiple signal handlers for a signalkeybuk@chromium.org2013-04-241-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | For the org.freedesktop.DBus.Properties.PropertyChanged signal, all relevant clients will share a single ObjectProxy since they share the same path and interface; the actual destination client for the signal is determined by its arguments. This means that we must support multiple signal handlers for a single object proxy, the previous fix of replacing with the latest was not sufficient for this case. Due to issue 223483, this is not a complete fix. Property objects coming and going will leave signal handlers in the ObjectProxy with NULLd weak pointer references - they will be harmless, but use up memory. BUG=234380 TEST=dbus_unittests R=satorux@chromium.org Review URL: https://codereview.chromium.org/14333009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195953 0039d316-1c4b-4281-b951-d872f2087c98
* Update the remaining include paths of base/string_piece.h to its new location.tfarina@chromium.org2013-04-171-1/+1
| | | | | | | | | | | string_piece.h was moved into base/strings/ in r191206 - https://chromiumcodereview.appspot.com/12982018/ TBR=brettw@chromium.org Review URL: https://codereview.chromium.org/14272007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194693 0039d316-1c4b-4281-b951-d872f2087c98
* Code cleaning: Uses scoped_ptr<> to express ownership rather than writing ↵yuki@chromium.org2013-02-071-4/+4
| | | | | | | | | | | | | | 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
* Allow multiple object proxies to handle NameOwnerChangedkeybuk@chromium.org2012-11-271-2/+2
| | | | | | | | | | | | | | | | Multiple object proxies may be registered for any single D-Bus service, one per interface. Returning "handled" means only the first interface object proxy gets to handle the signal, others never see it. Change to always return "not yet handled", while this means D-Bus never knows we actually handled the NameOwnerChanged signal, that's quite ok and is actually what all other bindings do for all signals. Submitted as -r169164 but reverted in -r169170; resubmitted with change to run message loop three times if necessary. BUG=chromium-os:36486 TEST=dbus_unittests TBR=gauravsh@chromium.org Review URL: https://codereview.chromium.org/11280073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169538 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 169164 - Allow multiple object proxies to handle NameOwnerChangedlambroslambrou@google.com2012-11-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Failed on Linux ChromiumOS Tests: SignalSenderVerificationTest.TestMultipleObjects: [4218:4244:1121/160846:447516037:ERROR:object_proxy.cc(624)] Failed to get name owner. Got org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.chromium.TestService': no such name [4218:4244:1121/160846:447531010:ERROR:bus.cc(444)] Failed to get the ownership of org.chromium.TestService: [4218:4248:1121/160846:447531228:ERROR:test_service.cc(134)] Failed to own: org.chromium.TestService dbus/signal_sender_verification_unittest.cc:302: Failure Value of: on_name_owner_changed_called_ Actual: false Expected: true [4218:4244:1121/160846:447535382:ERROR:bus.cc(604)] Requested to remove an unknown match rule: type='signal',interface='org.freedesktop.DBus',member='NameOwnerChanged',path='/org/freedesktop/DBus',sender='org.freedesktop.DBus',arg0='org.chromium.TestService' http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%28dbg%29%281%29/builds/12886/steps/dbus_unittests/logs/TestMultipleObjects Multiple object proxies may be registered for any single D-Bus service, one per interface. Returning "handled" means only the first interface object proxy gets to handle the signal, others never see it. Change to always return "not yet handled", while this means D-Bus never knows we actually handled the NameOwnerChanged signal, that's quite ok and is actually what all other bindings do for all signals. BUG=chromium-os:36486 TEST=dbus_unittests Review URL: https://chromiumcodereview.appspot.com/11280073 TBR=keybuk@chromium.org Review URL: https://codereview.chromium.org/11299149 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169170 0039d316-1c4b-4281-b951-d872f2087c98
* Allow multiple object proxies to handle NameOwnerChangedkeybuk@chromium.org2012-11-211-2/+2
| | | | | | | | | | | | | Multiple object proxies may be registered for any single D-Bus service, one per interface. Returning "handled" means only the first interface object proxy gets to handle the signal, others never see it. Change to always return "not yet handled", while this means D-Bus never knows we actually handled the NameOwnerChanged signal, that's quite ok and is actually what all other bindings do for all signals. BUG=chromium-os:36486 TEST=dbus_unittests Review URL: https://chromiumcodereview.appspot.com/11280073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169164 0039d316-1c4b-4281-b951-d872f2087c98
* Add DBusStatistics and DBusLogSource to log and show dbus statsstevenjb@chromium.org2012-11-141-2/+12
| | | | | | | | | | | | | | | The intention of this is to provide low overhead detailed logging to ensure that dbus call counts remain reasonable as we migrate NetworkLibrary and other systtems from src/chrome to src/chromeos. We already have UMA stats which provide high level numbers that we can watch, but this will make detailed debugging available for advanced users and in feedback reports. BUG=159635 For chrome/chrome_browser_chromeos.gypi: TBR=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/11363173 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167742 0039d316-1c4b-4281-b951-d872f2087c98
* Make SignalSenderVerificationTest more robustharuki@chromium.org2012-11-141-3/+20
| | | | | | | | | | | | | | | Add more assertions and a callback to check the result of RequestOwnership. Original test can hang when test_service2_ tries to acquire the ownership before D-Bus recognizes test_service_'s disconnection. In that situation, test_service2_ cannot own the name and cannot send a message. BUG=158689 TEST=unittests Review URL: https://chromiumcodereview.appspot.com/11358111 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167649 0039d316-1c4b-4281-b951-d872f2087c98
* Add sender verification of D-Bus signals.haruki@chromium.org2012-10-291-17/+144
| | | | | | | | | | | | | | | | | | The CL does the following: - Add a match rule for NameOwnerChanged signal from org.freedesktop.DBus. - Update the owner of the well-known bus name when a NameOwnerChanged comes. - Call GetNameOwner method to update the latest if ObjectProxy instance does not know the owner. - Verify the sender of the signal and reject the unknown senders. - Add UMA_HISTOGRAM_COUNTS "DBus.RejectedSignalCount" for rejected signals. and a unittest. BUG=140938 TEST=manual, unittests Review URL: https://chromiumcodereview.appspot.com/11199007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164597 0039d316-1c4b-4281-b951-d872f2087c98
* Add a CONNECT_REQUESTED state to Network ConnectionState.stevenjb@google.com2012-06-191-0/+1
| | | | | | | | | | | | | | | | | | | | When a connection request is made, Chrome now sets the state to CONNECT_REQUESTED and ignores "Idle" state updates while in that state. This informs the UI to show "connecting" icons / text until the connection attempt succeeds or fails. Also: Don't update the network icon while scanning. Also: includes a bunch of logging changes for improved debugging. This alos fixes the mock expectations so that browser_tests should pass. Original CL: https://chromiumcodereview.appspot.com/10554013 BUG=125121 TEST=See issue, test connecting between networks, UI should behave correctly. For chrome/browser/chromeos/gdata: TBR=gspencer@chromium.org, tbarzic@chromium.org Review URL: https://chromiumcodereview.appspot.com/10579022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143072 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 142847 - Add a CONNECT_REQUESTED state to Network ConnectionState.kkania@chromium.org2012-06-191-1/+0
| | | | | | | | | | | | | | | | | | | When a connection request is made, Chrome now sets the state to CONNECT_REQUESTED and ignores "Idle" state updates while in that state. This informs the UI to show "connecting" icons / text until the connection attempt succeeds or fails. Also: Don't update the network icon while scanning. Also: includes a bunch of logging changes for improved debugging. BUG=125121 TEST=See issue, test connecting between networks, UI should behave correctly. For chrome/browser/chromeos/gdata: TBR=tbarzic@chromium.org Review URL: https://chromiumcodereview.appspot.com/10554013 TBR=stevenjb@google.com Review URL: https://chromiumcodereview.appspot.com/10536197 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142889 0039d316-1c4b-4281-b951-d872f2087c98
* Add a CONNECT_REQUESTED state to Network ConnectionState.stevenjb@google.com2012-06-181-0/+1
| | | | | | | | | | | | | | | | When a connection request is made, Chrome now sets the state to CONNECT_REQUESTED and ignores "Idle" state updates while in that state. This informs the UI to show "connecting" icons / text until the connection attempt succeeds or fails. Also: Don't update the network icon while scanning. Also: includes a bunch of logging changes for improved debugging. BUG=125121 TEST=See issue, test connecting between networks, UI should behave correctly. For chrome/browser/chromeos/gdata: TBR=tbarzic@chromium.org Review URL: https://chromiumcodereview.appspot.com/10554013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142847 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Fix a subtle butterfly-effect bug in handling incoming messagessatorux@chromium.org2012-06-021-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libdbus does bookkeeping of the number of bytes in the incoming message queue implicitly, and asks client code (chrome) to stop monitoring the underlying socket, as soon as it exceeds a certain number, which is set to 63MB as of now. This caused a DCHECK failure (and could break the D-Bus message dispatching with Release builds) because the bookkeeping happned on the UI thread via a seemingly harmless call to dbus_message_unref(), but we cannot stop monitoring from UI thread. This patch fixes (or works around) the problem by deleting incoming messages on D-Bus thread, so the bookkeeping is done on D-Bus thread. Note that we don't have to change exported_object.cc, as the method call message is deleted on the D-Bus thread in ExportedObject::OnMethodCompleted() The following is a stacktrace of the DCHECK failure. Here, dbus::Response (method reply) is deleted on UI thread, that results in a call to dbus::Bus::OnToggleWatch, which should only be called on the D-Bus thread, hence crashed as a DCHECK failure Backtrace: base::debug::StackTrace::StackTrace() [0x517972] logging::LogMessage::~LogMessage() [0x4b3a57] <- crashing because we are not base::ThreadRestrictions::AssertIOAllowed() [0x4f0b35] dbus::Bus::AssertOnDBusThread() [0x45ceb6] <- checking if we are on the right thread dbus::Bus::OnToggleWatch() [0x45d0c1] dbus::Bus::OnToggleWatchThunk() [0x45d45d] <-- the change is notified. _dbus_watch_list_toggle_watch [0x7f35e0a15245] protected_change_watch [0x7f35e09f2eef] _dbus_connection_toggle_watch_unlocked [0x7f35e09f302e] check_read_watch [0x7f35e0a1332d] <-- what? why checking socket status here?? socket_live_messages_changed [0x7f35e0a1436c] live_messages_size_notify [0x7f35e0a11996] _dbus_counter_adjust [0x7f35e0a0c098] free_size_counter [0x7f35e0a04423] _dbus_list_foreach [0x7f35e0a180d9] dbus_message_cache_or_finalize [0x7f35e0a0446b] dbus_message_unref [0x7f35e0a05e7e] <-- releasing a message dbus::Message::~Message() [0x46abbb] dbus::Response::~Response() [0x470478] scoped_ptr<>::~scoped_ptr() [0x41e99f] dbus::ObjectProxy::RunResponseCallback() [0x472095] BUG=126217 TEST=added unit tests Review URL: https://chromiumcodereview.appspot.com/10492005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140165 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Include method names in error messages for method call failuressatorux@chromium.org2012-05-311-5/+17
| | | | | | | | | | | | | | | | | | | To make it easier to investigate method call failures. BUG=126217 TEST=run EndToEndAsyncTest.Timeout and confirm the error message is changed ("org.chromium.TestInterface.SlowEcho" is now included): BEFORE [ RUN ] EndToEndAsyncTest.Timeout [24410:24410:0530/105557:701377078661:ERROR:object_proxy.cc(456)] Failed to call method: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. AFTER [ RUN ] EndToEndAsyncTest.Timeout [24959:24959:0530/110437:701896995336:ERROR:object_proxy.cc(462)] Failed to call method: org.chromium.TestInterface.SlowEcho: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. Review URL: https://chromiumcodereview.appspot.com/10456030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139745 0039d316-1c4b-4281-b951-d872f2087c98
* Change setters of dbus::Message to return false instead of aborting on errorshashimoto@chromium.org2012-05-231-6/+19
| | | | | | | | | | | | 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
* Add dbus::ObjectProxy::CallMethodWithErrorCallbackhashimoto@chromium.org2012-04-201-11/+38
| | | | | | | | | | | | | Add CallMethodWithErrorCallback Add EndToEndAsyncTest.BrokenBus Fix leak in StartAsyncMethodCall BUG=chromium-os:27899 TEST=dbus_unittests --gtest_filter="EndToEndAsyncTest.*" Review URL: https://chromiumcodereview.appspot.com/10121005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133140 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: don't fail when reconnecting object signalskeybuk@chromium.org2012-03-211-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Since dbus::ObjectProxy is silently cached, with no way to invalidate, it's possible that individual instances of objects will come and go using the same underlying object proxy. i.e. dbus::PropertySet These will need to change the signal callbacks to be bound to their own instance, so the current behaviour of failing in this case with a log message is pessimal. Change dbus::ObjectProxy to overwrite the existing signal callbacks with the new ones on repeated calls, rather than preserve the first. BUG=chromium-os:28064 TEST=unit test included, and we receive property notifications on devices after connection now Change-Id: Ic4ae092163a364c53bdfcf88f4ce8f74b110b5cb R=satorux@chromium.org Review URL: http://codereview.chromium.org/9808001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128100 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: verify object path of incoming signalskeybuk@chromium.org2012-03-011-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | The existing behavior, while convenient for debugging, is wrong. D-Bus will not call any further filter functions once one returns DBUS_HANDLER_RESULT_HANDLED, in order for the next to be called a filter must return DBUS_HANDLER_RESULT_NOT_YET_HANDLED if it does not handle the incoming signal. We also can't defer this to the signal function since we have to post that to a different thread, and return values get hard. Since object proxies are constructed per-path, and match common interfaces and members, this means signals must be matched on an object otherwise only the first registered object proxy for any client will be called, and will be called for all signals. BUG=chromium-os:27113 TEST=ran unit tests, and manually verified existing code that uses ConnectToSignal Change-Id: Ia4cbc064dff0421a37fe4c4b7c719acf25eb630c Review URL: http://codereview.chromium.org/9508005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124357 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: add ObjectPath typekeybuk@google.com2012-02-141-1/+2
| | | | | | | | | | | | | | | | | | 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-2/+1
| | | | | | | | | | | | | | | | | | | | 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-1/+2
| | | | | | | | | | | | | | | | | 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-7/+21
| | | | | | | | 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
* dbus: Fix a bug where we were emitting spurious error messages.satorux@chromium.org2011-11-231-10/+20
| | | | | | | | | | | | | | Error messages like "Requested to remove an unknown match rule: type='signal', interface='...'" were emitted at shutdown of Bus object if an object proxy was connected to more than one signal of the same interface. TEST=changed the end_to_end_async_unittest to reproduce this bug, and confirm that the error messages were gone after fixing object_proxy.{cc,h} BUG=chromium-os:23382 Review URL: http://codereview.chromium.org/8681002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111423 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Add ObjectProxy::EmptyResponseCallback().satorux@chromium.org2011-11-111-3/+12
| | | | | | | | | | | | | This can be used when the caller is not interested in the response from the D-bus method. BUG=none TEST=added a unit test Review URL: http://codereview.chromium.org/8536007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109598 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Silence VLOG(1) spam from ObjectProxy::HandleMessage().satorux@chromium.org2011-10-141-2/+1
| | | | | | | | | | | | Having VLOG(1) there resulted in log spam from all objectProxy objects that connected to some signal. BUG=none TEST=dbus_unittests Review URL: http://codereview.chromium.org/8296005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105597 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a bug in dbus::Bus::AddFilterFunction().satorux@chromium.org2011-10-061-4/+10
| | | | | | | | | | | 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
* Eliminate hacks needed to work around a limitation of base::Bind()satorux@chromium.org2011-10-041-16/+6
| | | | | | | | | | | | | base::Bind() used to be unable to handle opaque type pointers, but the limitation was fixed in crrev.com/103627. BUG=crosbug.com/21166 TEST=build and run dbus_unittests Review URL: http://codereview.chromium.org/8124002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103881 0039d316-1c4b-4281-b951-d872f2087c98
* Stop restricting the sender object path for incoming signals.satorux@chromium.org2011-09-141-6/+8
| | | | | | | | | | | | | | | | | | 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
* Add some histograms to the D-Bus library:satorux@chromium.org2011-09-061-14/+52
| | | | | | | | | | | | | | | | | | - 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
* 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-31/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | - 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-1/+176
| | | | | | | | | | | | | | | | 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/+197
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