diff options
author | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-02 06:56:23 +0000 |
---|---|---|
committer | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-02 06:56:23 +0000 |
commit | e20d39fe8164f6633d8224030133a1c6ad18a289 (patch) | |
tree | d5cd7f78a9307a6eba086c5eedc7dd7fdcea4e82 /dbus/test_service.h | |
parent | 769b082f1fac6e60249c2e6f45bd2432390d7c5a (diff) | |
download | chromium_src-e20d39fe8164f6633d8224030133a1c6ad18a289.zip chromium_src-e20d39fe8164f6633d8224030133a1c6ad18a289.tar.gz chromium_src-e20d39fe8164f6633d8224030133a1c6ad18a289.tar.bz2 |
Add Bus::ShutdownOnDBusThreadAndBlock() and remove bus::Shutdown()
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
Diffstat (limited to 'dbus/test_service.h')
-rw-r--r-- | dbus/test_service.h | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/dbus/test_service.h b/dbus/test_service.h index 0ed8462..348aa73 100644 --- a/dbus/test_service.h +++ b/dbus/test_service.h @@ -49,12 +49,8 @@ class TestService : public base::Thread { // Returns true on success. bool WaitUntilServiceIsStarted() WARN_UNUSED_RESULT; - // Shuts down the service. - void Shutdown(); - - // Waits until the service is shut down. - // Returns true on success. - bool WaitUntilServiceIsShutdown() WARN_UNUSED_RESULT; + // Shuts down the service and blocks until it's done. + void ShutdownAndBlock(); // Returns true if the bus has the D-Bus thread. bool HasDBusThread(); @@ -66,17 +62,14 @@ class TestService : public base::Thread { // Helper function for SendTestSignal(). void SendTestSignalInternal(const std::string& message); - // Helper function for Shutdown(). - void ShutdownInternal(); + // Helper function for ShutdownAndBlock(). + void ShutdownAndBlockInternal(); // Called when a method is exported. void OnExported(const std::string& interface_name, const std::string& method_name, bool success); - // Called when the bus is shut down. - void OnShutdown(); - // base::Thread override. virtual void Run(MessageLoop* message_loop); @@ -95,7 +88,6 @@ class TestService : public base::Thread { Response* BrokenMethod(MethodCall* method_call); base::Thread* dbus_thread_; - base::WaitableEvent on_shutdown_; base::WaitableEvent on_all_methods_exported_; // The number of methods actually exported. int num_exported_methods_; |