summaryrefslogtreecommitdiffstats
path: root/dbus
Commit message (Collapse)AuthorAgeFilesLines
* DBus: declare property specializationskeybuk@chromium.org2012-09-211-0/+60
| | | | | | | | | | | | | Without declaring the property specializations in the header file, the compiler can sometimes generate default constructors that don't initialize the variables correctly. BUG=none TEST=unit_tests pass Review URL: https://chromiumcodereview.appspot.com/10963037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158105 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Fix clang warnings about missing virtual and OVERRIDE annotations.tfarina@chromium.org2012-08-301-3/+3
| | | | | | | | | BUG=115047 TBR=satorux@chromium.org Review URL: https://chromiumcodereview.appspot.com/10900041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154116 0039d316-1c4b-4281-b951-d872f2087c98
* bluetooth: Create stub manager, adapter and device.keybuk@chromium.org2012-08-152-5/+20
| | | | | | | | | | | | | | | | | | | | These stub classes are used when building Chrome on Linux with chromeos=1. They allow sufficient UI to work to show a Bluetooth adapter, enable and disable it, and show an unconnected fake device associated with it. This can be trivially extended to provide all manner of fake Bluetooth information for UI development. BUG=chromium-os:28555 TEST=out/Debug/chrome Change-Id: I7af28be76355fad735389aaf2fa499d0a8dfd76b Review URL: https://chromiumcodereview.appspot.com/10823301 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151621 0039d316-1c4b-4281-b951-d872f2087c98
* Coverity: Initialize member variables.jhawkins@chromium.org2012-07-251-1/+1
| | | | | | | | | | | | | | CID_COUNT=12 CID=104349,104361,104373,104374,104399,104420,104421,104422,104466,104476, 104532,104538 BUG=none TEST=none R=groby TBR=brettw,satorux,mnissler Review URL: https://chromiumcodereview.appspot.com/10833006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148430 0039d316-1c4b-4281-b951-d872f2087c98
* Expose functionality to tests.davemoore@chromium.org2012-07-253-14/+22
| | | | | | | | | | | 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-252-19/+13
| | | | | | | | | | | | | | | 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-252-13/+19
| | | | | | | | | | | | 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
* Marking BusTest.UnregisterExportedObject as flakyjochen@chromium.org2012-07-181-1/+2
| | | | | | | | | | BUG=137846 TEST=none TBR=keybuk@chromium.org Review URL: https://chromiumcodereview.appspot.com/10797009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147234 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the rest of #pragma once in one big CL.ajwong@chromium.org2012-07-1114-14/+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
* Switch to TimeDelta interface for TestTimeouts in dbus code.tedvessenes@gmail.com2012-07-091-3/+1
| | | | | | | | | | R=keybuk@chromium.org BUG=108171 Review URL: https://chromiumcodereview.appspot.com/10735022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145714 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: move logic from Property<> to PropertySetkeybuk@chromium.org2012-06-282-149/+147
| | | | | | | | | | | | | | | | | | | | | | Rather than implement Get() and Set() in dbus::Property<> move the code into dbus::PropertySet and pass a pointer to the property to operate on from the wrapper call. The advange of this way of doing things is that it's much easier to make subclasses, since you only need to subclass dbus::PropertySet; and ths makes it possible to mock. BUG=chromium-os:28555 TEST=dbus_unittests Change-Id: I760ca608d1e0a17422c11e0115c053d98be33fe0 R=satorux@chromium.org Review URL: https://chromiumcodereview.appspot.com/10698027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144756 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: Add test_server.cc used for manual testing.satorux@chromium.org2012-06-072-0/+46
| | | | | | | | | | | | | | The server was used for investigating crbug.com/126217. end_to_end_async_unittest.cc runs both the server and the client in the same process. It's useful to have a server program that runs as a separate process. BUG=none TEST=out/Debug/dbus_test_server; (from another terminal) dbus-send --print-reply --type=method_call --dest=org.chromium.TestService /org/chromium/TestObject org.chromium.TestInterface.SlowEcho string:hello Review URL: https://chromiumcodereview.appspot.com/10540032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141023 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Truncate strings in dbus::Message::ToString() if too longsatorux@chromium.org2012-06-073-2/+28
| | | | | | | | | | | 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
* Explicitly CHECK arguments in dbus::MessageWriter::AppendString/ObjectPathhashimoto@chromium.org2012-06-057-0/+109
| | | | | | | | | | | | Add dbus::IsStringValidObjectPath() and dbus::ObjectPath::IsValid() BUG=129335 TEST=dbus_unittests Review URL: https://chromiumcodereview.appspot.com/10502011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140489 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Fix a subtle butterfly-effect bug in handling incoming messagessatorux@chromium.org2012-06-022-1/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Fix a crash in dbus_unittests that happens on Ubuntu 11.10satorux@chromium.org2012-06-011-1/+1
| | | | | | | | | | | AppendObjectPath() can crash on some systems if an invalid object path is given. TEST=run dbus_unittests on Ubuntu 11.10 BUG=none Review URL: https://chromiumcodereview.appspot.com/10440131 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139977 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Fix a bunch of memory leaks in dbus_unittestssatorux@chromium.org2012-05-312-27/+49
| | | | | | | | | BUG=none TEST=time tools/valgrind/valgrind.sh --leak-check=full out/Release/dbus_unittests Review URL: https://chromiumcodereview.appspot.com/10454083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139747 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Include method names in error messages for method call failuressatorux@chromium.org2012-05-312-7/+23
| | | | | | | | | | | | | | | | | | | 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-237-47/+148
| | | | | | | | | | | | 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
* RefCounted types should not have public destructors, Linux fixesrsleevi@chromium.org2012-05-183-3/+9
| | | | | | | | | | BUG=123295 TEST=none Review URL: https://chromiumcodereview.appspot.com/10392152 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137893 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: revamp fd passing support for i/o restrictionssleffler@chromium.org2012-05-104-20/+51
| | | | | | | | | | | | | | Encapsulate file descriptor validity checking and status in the companion FileDescriptor class so callers can do descriptor checking in a context where i/o is allowed. Update the debug daemon client support to validate the pipe descriptors in a worker thread so it is not done on the UI thread. BUG=126142 TEST=new unit tests + collect trace data on chrome os and verify no assert is triggered Review URL: https://chromiumcodereview.appspot.com/10382021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136331 0039d316-1c4b-4281-b951-d872f2087c98
* DBus: Remove 'return' from void methods.jhawkins@chromium.org2012-04-271-5/+5
| | | | | | | | | | | | BUG=none TEST=none R=groby TBR=keybuk Review URL: http://codereview.chromium.org/10241003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134332 0039d316-1c4b-4281-b951-d872f2087c98
* Add more allow-wait suppressions on cros.jam@chromium.org2012-04-261-0/+3
| | | | | | | TBR=brettw Review URL: https://chromiumcodereview.appspot.com/10198034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134132 0039d316-1c4b-4281-b951-d872f2087c98
* Add MockObjectProxy::CallMethodWithErrorCallbackhashimoto@chromium.org2012-04-241-0/+4
| | | | | | | | | BUG=chromium-os:27899 TEST=build success Review URL: https://chromiumcodereview.appspot.com/10168027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133608 0039d316-1c4b-4281-b951-d872f2087c98
* Add dbus::ObjectProxy::CallMethodWithErrorCallbackhashimoto@chromium.org2012-04-203-11/+227
| | | | | | | | | | | | | 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
* Extends dbus module to accept user specified addresses.nona@chromium.org2012-04-192-7/+38
| | | | | | | | | | | | | | To connect ibus-daemon, needs to extend dbus module to accept user specified addresses. The ibus provides text inputting features and it is already used in Chrome OS. The ibus uses dbus protocol but using the ibus-daemon instead of the dbus-daemon. BUG=chromium-os:26334 TEST=ran dbus_unittests Review URL: http://codereview.chromium.org/10021044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132933 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: add support for passing file descriptorssleffler@chromium.org2012-03-307-0/+171
| | | | | | | | | | | | | | 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
* chromeos: Fix memory leak in blocking Cryptohome method callhashimoto@chromium.org2012-03-291-0/+1
| | | | | | | | | BUG=None TEST=Can browse chromeos://cryptohome Review URL: https://chromiumcodereview.appspot.com/9891001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129565 0039d316-1c4b-4281-b951-d872f2087c98
* Checked the return values of function calls.khorimoto@chromium.org2012-03-281-4/+8
| | | | | | | | | | CID=103653,103654,103655 BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/9863050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129454 0039d316-1c4b-4281-b951-d872f2087c98
* Correcting the copy right message for this filerharrison@chromium.org2012-03-271-1/+1
| | | | | | | | | | | | | I used a ChromeOS protobuf definition as a template and I didn't update the copyright information. steveblock@ caught this and asked me to correct it. BUG=chromium:112127 TEST=None, this a comment change. It has no functional effect. Review URL: http://codereview.chromium.org/9834013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129250 0039d316-1c4b-4281-b951-d872f2087c98
* Add dbus::AppendBasicTypeValueDatahashimoto@chromium.org2012-03-243-24/+151
| | | | | | | | | | BUG=chromium-os:16557 TEST=dbus_unittests --gtest_filter="ValuesUtilTest.Append*" Review URL: http://codereview.chromium.org/9826044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128771 0039d316-1c4b-4281-b951-d872f2087c98
* READABILITY for Keybukkeybuk@chromium.org2012-03-223-34/+36
| | | | | | | | | | | | BUG=none TEST=dbus_unittests & emerge chromeos-chrome change-Id: I111b9e60a2c6c35edd9e0ea9f6976928c6c6474b Review URL: http://codereview.chromium.org/9407019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128286 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: clear array values before reading from variantkeybuk@google.com2012-03-214-11/+108
| | | | | | | | | | | | | | | | | | PopArrayFromVariant() appends values to the existing value, rather than clearing first like I expected, so using this without clear() first means the property value accumulates all values and never loses them. BUG=none TEST=unit test included Change-Id: Ie392a89190f4ad8570a905f24b2f446e1f2bed81 R=satorux@chromium.org Review URL: https://chromiumcodereview.appspot.com/9809001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128108 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: don't fail when reconnecting object signalskeybuk@chromium.org2012-03-213-8/+61
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add a new 'run_all_unittests' target in baseakalin@chromium.org2012-03-211-1/+1
| | | | | | | | | | | | | Make all the places that include run_all_unittests.cc manually depend on this target instead. BUG= TEST= Review URL: http://codereview.chromium.org/9691067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127911 0039d316-1c4b-4281-b951-d872f2087c98
* Fix dbus::PopDataAsValue's behavior when a dictionary's keys including dotshashimoto@chromium.org2012-03-202-2/+46
| | | | | | | | | | BUG=None TEST=dbus_unittests --gtest_filter="ValuesUtilTest.PopDictinoaryWithDottedStringKey" Review URL: http://codereview.chromium.org/9732029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127727 0039d316-1c4b-4281-b951-d872f2087c98
* Add dbus::PopDataAsValuehashimoto@chromium.org2012-03-164-0/+534
| | | | | | | | | | BUG=chromium-os:16557 TEST=dbus_unittests --gtest_filter="ValuesUtilTest.*" Review URL: http://codereview.chromium.org/9702094 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127287 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: allow unregistering of exported objectskeybuk@chromium.org2012-03-143-0/+73
| | | | | | | | | | | | | | | | Not all objects are permanent, some are transient and if we ever re-use the object path, we want a new instance of the exported object to be created rather than re-use an existing one. BUG=chromium-os:21320 TEST=dbus_unittests and included change to agent service provider Change-Id: I09882bbe2f70356182ac301c4260473051333424 Review URL: http://codereview.chromium.org/9691025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126527 0039d316-1c4b-4281-b951-d872f2087c98
* Convert uses of int ms to TimeDelta in dbus.tedvessenes@gmail.com2012-03-115-11/+12
| | | | | | | | | | R=satorux@chromium.org BUG=108171 Review URL: http://codereview.chromium.org/9582044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126055 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: fix base class of ErrorResponsekeybuk@chromium.org2012-03-112-3/+4
| | | | | | | | | | | | | | | 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: remove service name from ExportedObjectkeybuk@chromium.org2012-03-1010-37/+96
| | | | | | | | | | | | | | | | | | | | | | | | Well-known names in D-Bus are merely aliases to unique connection ids maintained by the bus, they have no purpose in qualifying object paths or interfaces and it's perfectly legimiate for a client to make requests to the unique connection id (e.g. in response to a signal, which does not reference the well-known name of the origin connection). Remove the service_name member from dbus::ExportedObject, from its constructor and from dbus::Bus::GetExportedObject and require code to call dbus::Bus::RequestOwnership if a well-known name is desired. This requires making that function callable from the origin thread with a callback for the return value. BUG=chromium-os:27101 TEST=dbus_unittests Change-Id: Ib91de8b68ad9c3b432e224a2c715f0c2ca1af463 Review URL: http://codereview.chromium.org/9668018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125970 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: verify object path of incoming signalskeybuk@chromium.org2012-03-012-12/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 keybuk to dbus OWNERS files.satorux@chromium.org2012-02-251-0/+1
| | | | | | | | | | BUG=none TEST=he's proven to be awesome Review URL: http://codereview.chromium.org/9459002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123618 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: slight cleanup to Property codekeybuk@chromium.org2012-02-172-18/+11
| | | | | | | | | | | | | | | | | | | | | Correct comments based on practice that worked best for the bluetooth adapter and device clients, in particular adding the virtual destructor to the struct and cleaning up the return values of GetObject() in the documentation. Drop VLOG() calls, there's no need to debug at this level, you can use dbus-monitor to see the incoming and outgoing calls to Chromium and can add logging in upper layers when there are real values to log. BUG=none TEST=built on try bots Change-Id: I2ac6b55e288626b5f9cd843935887e261d386dec Review URL: http://codereview.chromium.org/9418035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122522 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Property<>.value() should be constkeybuk@chromium.org2012-02-171-1/+1
| | | | | | | | | | | | | | | Constant references to PropertySets are a useful way to avoid someone calling Get() and Set(), but we should allow them to call value(). BUG=none TEST=built and tested Change-Id: Ic8e5449e87ba3cebbe6a3534596bb53016236333 Review URL: http://codereview.chromium.org/9414029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122467 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: ProperySet destructor must be virtualkeybuk@chromium.org2012-02-171-1/+1
| | | | | | | | | | | | | | | clang requires us to have a destructor for this "complex" class, but that destructor will need to be virtual later. BUG=none TEST=git try -b linux_chromeos_clang Change-Id: Ia0efd34f205ab090cd7f2092d47fc0288b1f4e0c Review URL: http://codereview.chromium.org/9420027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122417 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: add Property handling for clientskeybuk@chromium.org2012-02-156-3/+1253
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | D-Bus properties can be tricky to handle due to their reliance on variants, and since they use a common interface, result in a lot of copy and paste code to deal with. Add an API that simplifies matters somewhat; detailed documentation is in dbus/property.h, but fundamentally you add a struct Properties to the client implementation derived from dbus::PropertySet, and in it declare members of dbus::Property<property type> and connect them in the constructor with RegisterProperty(name, ptr). The API works on two levels, from a higher-level each member of the structure is a type-safe way to obtain the current value of the property, update the value, and set a new value. From the lower-level, it uses a generic reader/writer based interface so that the parent structure's GetAll and signal handling methods can update the values without requiring knowledge of the contained type. BUG=chromium:109194 TEST=unit tests included in CL change-Id: I111b9e60a2c6c35edd9e0ea9f6976928c6c6474b Review URL: http://codereview.chromium.org/9380053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122039 0039d316-1c4b-4281-b951-d872f2087c98