From f21f5cd47f4aa274e0944220eeedb10fdf664d21 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Thu, 30 Apr 2015 12:55:37 +0200 Subject: [PATCH] Bug 1159709: Integrate |ConnectionOrientedSocket| into socket I/O class hierarchy, r=kmachulis This patch integrates |ConnectionOrientedSocket| into the hierarchy of socket I/O classes. In future patches, the class can provide common interfaces and functionality for all connection-oriented sockets. --- ipc/bluetooth/BluetoothDaemonConnection.cpp | 6 +++--- ipc/bluetooth/BluetoothDaemonConnection.h | 5 +---- ipc/unixsocket/ConnectionOrientedSocket.h | 6 +++--- ipc/unixsocket/StreamSocket.cpp | 1 - ipc/unixsocket/StreamSocket.h | 4 +--- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/ipc/bluetooth/BluetoothDaemonConnection.cpp b/ipc/bluetooth/BluetoothDaemonConnection.cpp index 6e751248175..269be2e448c 100644 --- a/ipc/bluetooth/BluetoothDaemonConnection.cpp +++ b/ipc/bluetooth/BluetoothDaemonConnection.cpp @@ -199,9 +199,9 @@ BluetoothDaemonPDUConsumer::~BluetoothDaemonPDUConsumer() // BluetoothDaemonConnectionIO // -class BluetoothDaemonConnectionIO final : public UnixSocketWatcher - , public DataSocketIO - , public ConnectionOrientedSocketIO +class BluetoothDaemonConnectionIO final + : public UnixSocketWatcher + , public ConnectionOrientedSocketIO { public: BluetoothDaemonConnectionIO(MessageLoop* aIOLoop, int aFd, diff --git a/ipc/bluetooth/BluetoothDaemonConnection.h b/ipc/bluetooth/BluetoothDaemonConnection.h index 38b03fafe65..bfb26eefcb6 100644 --- a/ipc/bluetooth/BluetoothDaemonConnection.h +++ b/ipc/bluetooth/BluetoothDaemonConnection.h @@ -10,8 +10,6 @@ #include "mozilla/Attributes.h" #include "mozilla/FileUtils.h" #include "mozilla/ipc/ConnectionOrientedSocket.h" -#include "mozilla/ipc/DataSocket.h" -#include "nsError.h" #include "nsAutoPtr.h" namespace mozilla { @@ -112,8 +110,7 @@ protected: * Bluetooth daemon. It offers connection establishment and sending * PDUs. PDU receiving is performed by |BluetoothDaemonPDUConsumer|. */ -class BluetoothDaemonConnection : public DataSocket - , public ConnectionOrientedSocket +class BluetoothDaemonConnection : public ConnectionOrientedSocket { public: BluetoothDaemonConnection(); diff --git a/ipc/unixsocket/ConnectionOrientedSocket.h b/ipc/unixsocket/ConnectionOrientedSocket.h index c1df0232ae8..3bab6a270b3 100644 --- a/ipc/unixsocket/ConnectionOrientedSocket.h +++ b/ipc/unixsocket/ConnectionOrientedSocket.h @@ -8,7 +8,7 @@ #define mozilla_ipc_connectionorientedsocket_h #include -#include "nsError.h" +#include "DataSocket.h" namespace mozilla { namespace ipc { @@ -21,7 +21,7 @@ union sockaddr_any; * |ListenSocket| uses these classes to handle accepted sockets. */ -class ConnectionOrientedSocketIO +class ConnectionOrientedSocketIO : public DataSocketIO { public: virtual nsresult Accept(int aFd, @@ -32,7 +32,7 @@ protected: virtual ~ConnectionOrientedSocketIO(); }; -class ConnectionOrientedSocket +class ConnectionOrientedSocket : public DataSocket { public: virtual ConnectionOrientedSocketIO* GetIO() = 0; diff --git a/ipc/unixsocket/StreamSocket.cpp b/ipc/unixsocket/StreamSocket.cpp index 8cd6b975543..4267b7945c4 100644 --- a/ipc/unixsocket/StreamSocket.cpp +++ b/ipc/unixsocket/StreamSocket.cpp @@ -21,7 +21,6 @@ namespace ipc { class StreamSocketIO final : public UnixSocketWatcher - , public DataSocketIO , public ConnectionOrientedSocketIO { public: diff --git a/ipc/unixsocket/StreamSocket.h b/ipc/unixsocket/StreamSocket.h index a4e2c22dadb..a4c73e11a13 100644 --- a/ipc/unixsocket/StreamSocket.h +++ b/ipc/unixsocket/StreamSocket.h @@ -7,7 +7,6 @@ #ifndef mozilla_ipc_streamsocket_h #define mozilla_ipc_streamsocket_h -#include "mozilla/ipc/DataSocket.h" #include "ConnectionOrientedSocket.h" namespace mozilla { @@ -16,8 +15,7 @@ namespace ipc { class StreamSocketIO; class UnixSocketConnector; -class StreamSocket : public DataSocket - , public ConnectionOrientedSocket +class StreamSocket : public ConnectionOrientedSocket { public: StreamSocket();