diff options
author | cmasone@chromium.org <cmasone@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-31 06:34:59 +0000 |
---|---|---|
committer | cmasone@chromium.org <cmasone@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-31 06:34:59 +0000 |
commit | e282490e359a536c91b15c9a9023cc798fab303b (patch) | |
tree | 1dfee9533ded06413b5b713f246a317a67c47ddd /dbus/test_service.h | |
parent | 6bedbeffa4fa25ba16d50253dcc7c1aec5ac4702 (diff) | |
download | chromium_src-e282490e359a536c91b15c9a9023cc798fab303b.zip chromium_src-e282490e359a536c91b15c9a9023cc798fab303b.tar.gz chromium_src-e282490e359a536c91b15c9a9023cc798fab303b.tar.bz2 |
Allow Chromium's DBus service ownership to be stealable
We've seen some cases in tests where a Chromium process winds up in a
temporarily unkillable state, causing the dbus-daemon to believe that
it still actively owns org.chromium.LibCrosService. This makes
attempts to restart the UI fail, as the browser dies when it cannot
take ownership of this service name. The reason it can't is because
Chromium currently doesn't allow other processes to steal ownership --
and the unkillable process is holding onto the token.
This can be remedied by providing certain options when ownership of
the service name is taken, options that allow other processes to seize
ownership if they so choose. The ramifications of this are discussed
further in the bug.
BUG=chromium:261381
TEST=new unit test in dbus_unittest
TEST=run the following as chronos on a device: "gdbus call --system --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.RequestName org.chromium.LibCrosService 7"
TEST=This should return (uint32 1,)
Review URL: https://chromiumcodereview.appspot.com/20555003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214589 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus/test_service.h')
-rw-r--r-- | dbus/test_service.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/dbus/test_service.h b/dbus/test_service.h index 765a630..7ddaf21 100644 --- a/dbus/test_service.h +++ b/dbus/test_service.h @@ -9,6 +9,7 @@ #include "base/memory/ref_counted.h" #include "base/threading/thread.h" #include "base/synchronization/waitable_event.h" +#include "dbus/bus.h" #include "dbus/exported_object.h" namespace base { @@ -17,7 +18,6 @@ class SequencedTaskRunner; namespace dbus { -class Bus; class MethodCall; class MessageWriter; class Response; @@ -37,6 +37,9 @@ class TestService : public base::Thread { // NULL by default (i.e. don't use the D-Bus thread). scoped_refptr<base::SequencedTaskRunner> dbus_task_runner; + + // Flags governing parameters of service ownership request. + Bus::ServiceOwnershipOptions request_ownership_options; }; // The number of methods we'll export. @@ -163,6 +166,9 @@ class TestService : public base::Thread { // Helper function for RequestOwnership(). void RequestOwnershipInternal(base::Callback<void(bool)> callback); + // Options to use when requesting service ownership. + Bus::ServiceOwnershipOptions request_ownership_options_; + scoped_refptr<base::SequencedTaskRunner> dbus_task_runner_; base::WaitableEvent on_all_methods_exported_; // The number of methods actually exported. |