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

Unified Diff: dbus/bus.h

Issue 12211022: Call get_dispatch_status function to handle Disconnected signal. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
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') | dbus/bus.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 e6a9b20096a29e710e37dbeee82effe45d477a95..1bf07d9e05384ac3c57216cedc0ac73698f5c5cc 100644
--- a/dbus/bus.h
+++ b/dbus/bus.h
@@ -300,6 +300,9 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> {
// - Releases the service names
// - Closes the connection to dbus-daemon.
//
+ // This function can be called multiple times and it is no-op for the 2nd time
+ // calling.
+ //
// BLOCKING CALL.
virtual void ShutdownAndBlock();
@@ -534,6 +537,9 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> {
void OnDispatchStatusChanged(DBusConnection* connection,
DBusDispatchStatus status);
+ // Called when the connection is diconnected.
+ void OnConnectionDisconnected(DBusConnection* connection);
+
// Callback helper functions. Redirects to the corresponding member function.
static dbus_bool_t OnAddWatchThunk(DBusWatch* raw_watch, void* data);
static void OnRemoveWatchThunk(DBusWatch* raw_watch, void* data);
@@ -544,6 +550,13 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> {
static void OnDispatchStatusChangedThunk(DBusConnection* connection,
DBusDispatchStatus status,
void* data);
+
+ // Calls OnConnectionDisconnected if the Diconnected signal is received.
+ static DBusHandlerResult OnConnectionDisconnectedFilter(
+ DBusConnection *connection,
+ DBusMessage *message,
+ void *user_data);
+
const BusType bus_type_;
const ConnectionType connection_type_;
scoped_refptr<base::MessageLoopProxy> dbus_thread_message_loop_proxy_;
« no previous file with comments | « no previous file | dbus/bus.cc » ('j') | dbus/bus.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698