summaryrefslogtreecommitdiff
path: root/ipc/dbus/RawDBusConnection.h
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-02-12 17:47:03 +0000
committerMatt A. Tobin <email@mattatobin.com>2022-02-12 14:23:18 -0600
commitf66babd8b8368ada3e5aa29cdef1c77291ee4ddd (patch)
treee3842e2a6bf19090185f9c475b3846e1bb79ac97 /ipc/dbus/RawDBusConnection.h
downloadGRE-f66babd8b8368ada3e5aa29cdef1c77291ee4ddd.tar.gz
Create the Goanna Runtime Environment
Diffstat (limited to 'ipc/dbus/RawDBusConnection.h')
-rw-r--r--ipc/dbus/RawDBusConnection.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/ipc/dbus/RawDBusConnection.h b/ipc/dbus/RawDBusConnection.h
new file mode 100644
index 000000000..49d4c582b
--- /dev/null
+++ b/ipc/dbus/RawDBusConnection.h
@@ -0,0 +1,53 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef mozilla_ipc_dbus_gonk_rawdbusconnection_h__
+#define mozilla_ipc_dbus_gonk_rawdbusconnection_h__
+
+#include <dbus/dbus.h>
+#include "mozilla/ipc/DBusConnectionRefPtr.h"
+
+namespace mozilla {
+namespace ipc {
+
+typedef void (*DBusReplyCallback)(DBusMessage*, void*);
+
+class RawDBusConnection
+{
+public:
+ RawDBusConnection();
+ virtual ~RawDBusConnection();
+
+ nsresult EstablishDBusConnection();
+
+ bool Watch();
+
+ DBusConnection* GetConnection()
+ {
+ return mConnection;
+ }
+
+ bool Send(DBusMessage* aMessage);
+
+ bool SendWithReply(DBusReplyCallback aCallback, void* aData,
+ int aTimeout, DBusMessage* aMessage);
+
+ bool SendWithReply(DBusReplyCallback aCallback, void* aData,
+ int aTimeout,
+ const char* aDestination,
+ const char* aPath, const char* aIntf,
+ const char *aFunc, int aFirstArgType, ...);
+
+protected:
+ RefPtr<DBusConnection> mConnection;
+
+private:
+ static bool sDBusIsInit;
+};
+
+}
+}
+
+#endif