Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(524)

Unified Diff: dbus/bus.h

Issue 12224139: Supporting callback for Disconnected signal. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dbus/bus.cc » ('j') | dbus/end_to_end_async_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/bus.h
diff --git a/dbus/bus.h b/dbus/bus.h
index 1bf07d9e05384ac3c57216cedc0ac73698f5c5cc..0f3e00968348721cb60ac925f407bba400c9279c 100644
--- a/dbus/bus.h
+++ b/dbus/bus.h
@@ -201,6 +201,13 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> {
// - the requested service name.
// - whether ownership has been obtained or not.
typedef base::Callback<void (const std::string&, bool)> OnOwnershipCallback;
+
+ // Called when the connection with dbus-daemon is closed. This function is
+ // also called when the connection is closed by ShutdownAndBlock. |callback|
+ // can be null callback.
+ typedef base::Callback<void ()> OnDisconnectedCallback;
satorux1 2013/02/13 08:06:53 I think you can just use base::Closure because thi
Seigo Nonaka 2013/02/13 09:45:29 Done.
+ void SetDisconnectedCallback(const OnDisconnectedCallback& callback);
+
// TODO(satorux): Remove the service name parameter as the caller of
// RequestOwnership() knows the service name.
@@ -491,6 +498,7 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> {
private:
friend class base::RefCountedThreadSafe<Bus>;
+ friend class DisconnectableBusForTesting;
satorux1 2013/02/13 08:06:53 This worries me because 1) 'friend' should be avo
Seigo Nonaka 2013/02/13 09:45:29 Sure, adding CloseConnection. Thanks.
// Helper function used for RemoveObjectProxy().
void RemoveObjectProxyInternal(scoped_refptr<dbus::ObjectProxy> object_proxy,
@@ -601,6 +609,7 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> {
int num_pending_timeouts_;
std::string address_;
+ OnDisconnectedCallback on_disconnected_callback_;
DISALLOW_COPY_AND_ASSIGN(Bus);
};
« no previous file with comments | « no previous file | dbus/bus.cc » ('j') | dbus/end_to_end_async_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698