From f66babd8b8368ada3e5aa29cdef1c77291ee4ddd Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sat, 12 Feb 2022 17:47:03 +0000 Subject: Create the Goanna Runtime Environment --- ipc/dbus/RawDBusConnection.h | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 ipc/dbus/RawDBusConnection.h (limited to 'ipc/dbus/RawDBusConnection.h') 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 +#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 mConnection; + +private: + static bool sDBusIsInit; +}; + +} +} + +#endif -- cgit v1.2.3