diff --git a/ipc/dbus/DBusWatcher.cpp b/ipc/dbus/DBusWatcher.cpp index 3dfc8bb9a65f..d31724e84255 100644 --- a/ipc/dbus/DBusWatcher.cpp +++ b/ipc/dbus/DBusWatcher.cpp @@ -7,12 +7,11 @@ #include "DBusWatcher.h" #include "mozilla/unused.h" #include "nsThreadUtils.h" -#include "RawDBusConnection.h" namespace mozilla { namespace ipc { -DBusWatcher::DBusWatcher(RawDBusConnection* aConnection, DBusWatch* aWatch) +DBusWatcher::DBusWatcher(DBusConnection* aConnection, DBusWatch* aWatch) : mConnection(aConnection) , mWatch(aWatch) { @@ -23,7 +22,7 @@ DBusWatcher::DBusWatcher(RawDBusConnection* aConnection, DBusWatch* aWatch) DBusWatcher::~DBusWatcher() { } -RawDBusConnection* +DBusConnection* DBusWatcher::GetConnection() { return mConnection; @@ -82,7 +81,7 @@ DBusWatcher::AddWatchFunction(DBusWatch* aWatch, void* aData) { MOZ_ASSERT(!NS_IsMainThread()); - auto connection = static_cast(aData); + auto connection = static_cast(aData); UniquePtr dbusWatcher = MakeUnique(connection, aWatch); @@ -134,8 +133,7 @@ DBusWatcher::OnFileCanReadWithoutBlocking(int aFd) DBusDispatchStatus dbusDispatchStatus; do { - dbusDispatchStatus = - dbus_connection_dispatch(mConnection->GetConnection()); + dbusDispatchStatus = dbus_connection_dispatch(mConnection); } while (dbusDispatchStatus == DBUS_DISPATCH_DATA_REMAINS); } diff --git a/ipc/dbus/DBusWatcher.h b/ipc/dbus/DBusWatcher.h index dbf6daf29042..d866e6158340 100644 --- a/ipc/dbus/DBusWatcher.h +++ b/ipc/dbus/DBusWatcher.h @@ -13,12 +13,10 @@ namespace mozilla { namespace ipc { -class RawDBusConnection; - class DBusWatcher : public MessageLoopForIO::Watcher { public: - DBusWatcher(RawDBusConnection* aConnection, DBusWatch* aWatch); + DBusWatcher(DBusConnection* aConnection, DBusWatch* aWatch); ~DBusWatcher(); void StartWatching(); @@ -29,7 +27,7 @@ public: static void RemoveWatchFunction(DBusWatch* aWatch, void* aData); static void ToggleWatchFunction(DBusWatch* aWatch, void* aData); - RawDBusConnection* GetConnection(); + DBusConnection* GetConnection(); private: void OnFileCanReadWithoutBlocking(int aFd); @@ -42,7 +40,7 @@ private: MessageLoopForIO::FileDescriptorWatcher mWriteWatcher; // DBus structures - RawDBusConnection* mConnection; + DBusConnection* mConnection; DBusWatch* mWatch; }; diff --git a/ipc/dbus/RawDBusConnection.cpp b/ipc/dbus/RawDBusConnection.cpp index 271522b1e50e..efc0d267e2e6 100644 --- a/ipc/dbus/RawDBusConnection.cpp +++ b/ipc/dbus/RawDBusConnection.cpp @@ -110,7 +110,7 @@ bool RawDBusConnection::Watch() DBusWatcher::AddWatchFunction, DBusWatcher::RemoveWatchFunction, DBusWatcher::ToggleWatchFunction, - this, nullptr); + this->GetConnection(), nullptr); NS_ENSURE_TRUE(success == TRUE, false); return true;