Bug 1252841: Convert HAL daemon socket to |UniquePtr<>|, r=brsun

This commit is contained in:
Thomas Zimmermann 2016-03-22 11:26:45 +01:00
parent 7674573171
commit 142791f0a8

View File

@ -7,6 +7,7 @@
#include "DaemonSocket.h"
#include "mozilla/ipc/DaemonSocketConsumer.h"
#include "mozilla/ipc/DaemonSocketPDU.h"
#include "mozilla/UniquePtr.h"
#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, MOZ_COUNT_DTOR
#ifdef CHROMIUM_LOG
@ -62,7 +63,7 @@ public:
private:
DaemonSocket* mConnection;
DaemonSocketIOConsumer* mConsumer;
nsAutoPtr<DaemonSocketPDU> mPDU;
UniquePtr<DaemonSocketPDU> mPDU;
bool mShuttingDownOnIOThread;
};
@ -103,7 +104,7 @@ DaemonSocketIO::QueryReceiveBuffer(UnixSocketIOBuffer** aBuffer)
if (!mPDU) {
/* There's only one PDU for receiving. We reuse it every time. */
mPDU = new DaemonSocketPDU(DaemonSocketPDU::PDU_MAX_PAYLOAD_LENGTH);
mPDU = MakeUnique<DaemonSocketPDU>(DaemonSocketPDU::PDU_MAX_PAYLOAD_LENGTH);
}
*aBuffer = mPDU.get();