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

Unified Diff: dbus/bus.h

Issue 12224139: Supporting callback for Disconnected signal. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing comments 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') | no next file with comments »
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..87df7c3e91602102618bca2f5a952f4a5198a488 100644
--- a/dbus/bus.h
+++ b/dbus/bus.h
@@ -190,6 +190,12 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> {
// // Do something.
//
std::string address;
+
+ // If the connection with dbus-daemon is closed, |disconnected_callback|
+ // will be called on the origin thread. This is also called when the
+ // disonnection by ShutdownAndBlock. |disconnected_callback| can be null
+ // callback
+ base::Closure disconnected_callback;
};
// Creates a Bus object. The actual connection will be established when
@@ -329,6 +335,13 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> {
// BLOCKING CALL.
virtual bool Connect();
+ // Disconnects the bus from the dbus-daemon.
+ // Safe to call multiple times and no operation after the first call.
+ // Do not call for shared connection it will be released by libdbus.
+ //
+ // BLOCKING CALL.
+ virtual void ClosePrivateConnection();
+
// Requests the ownership of the service name given by |service_name|.
// See also RequestOwnershipAndBlock().
//
@@ -601,6 +614,7 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> {
int num_pending_timeouts_;
std::string address_;
+ base::Closure on_disconnected_closure_;
DISALLOW_COPY_AND_ASSIGN(Bus);
};
« no previous file with comments | « no previous file | dbus/bus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698