diff options
author | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 16:26:30 +0000 |
---|---|---|
committer | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 16:26:30 +0000 |
commit | e184ccec44f19ae4f3beaef01d5e90753ff924e8 (patch) | |
tree | 3859e788740a9641c5fa7f511f8f9a91ecf0b30d /dbus/exported_object.h | |
parent | 18da0fd59dfacb8d00f803103fdbdc556d5d6fe3 (diff) | |
download | chromium_src-e184ccec44f19ae4f3beaef01d5e90753ff924e8.zip chromium_src-e184ccec44f19ae4f3beaef01d5e90753ff924e8.tar.gz chromium_src-e184ccec44f19ae4f3beaef01d5e90753ff924e8.tar.bz2 |
Eliminate a timed wait from ExportedObject::HandleMessage().
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
Diffstat (limited to 'dbus/exported_object.h')
-rw-r--r-- | dbus/exported_object.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/dbus/exported_object.h b/dbus/exported_object.h index a6edb97..24456f7 100644 --- a/dbus/exported_object.h +++ b/dbus/exported_object.h @@ -123,7 +123,14 @@ class ExportedObject : public base::RefCountedThreadSafe<ExportedObject> { // Runs the method. Helper function for HandleMessage(). void RunMethod(MethodCallCallback method_call_callback, - MethodCall* method_call); + MethodCall* method_call, + base::TimeTicks start_time); + + // Called on completion of the method run from RunMethod(). + // Takes ownership of |method_call| and |response|. + void OnMethodCompleted(MethodCall* method_call, + Response* response, + base::TimeTicks start_time); // Called when the object is unregistered. void OnUnregistered(DBusConnection* connection); @@ -141,8 +148,6 @@ class ExportedObject : public base::RefCountedThreadSafe<ExportedObject> { std::string service_name_; std::string object_path_; bool object_is_registered_; - dbus::Response* response_from_method_; - base::WaitableEvent on_method_is_called_; // The method table where keys are absolute method names (i.e. interface // name + method name), and values are the corresponding callbacks. |