mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1252841: Convert HAL daemon socket to |UniquePtr<>|, r=brsun
This commit is contained in:
parent
7674573171
commit
142791f0a8
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user