mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1221547 - part 1 - enable UnixSocketRawData to take ownership of a passed-in-buffer; r=tzimmerman
This commit is contained in:
parent
9d28d00120
commit
2dbc1d274a
@ -125,6 +125,15 @@ UnixSocketRawData::UnixSocketRawData(const void* aData, size_t aSize)
|
||||
0, aSize, aSize);
|
||||
}
|
||||
|
||||
UnixSocketRawData::UnixSocketRawData(UniquePtr<uint8_t[]> aData, size_t aSize)
|
||||
{
|
||||
MOZ_ASSERT(aData || !aSize);
|
||||
|
||||
MOZ_COUNT_CTOR_INHERITED(UnixSocketRawData, UnixSocketIOBuffer);
|
||||
|
||||
ResetBuffer(aData.release(), 0, aSize, aSize);
|
||||
}
|
||||
|
||||
UnixSocketRawData::UnixSocketRawData(size_t aSize)
|
||||
{
|
||||
MOZ_COUNT_CTOR_INHERITED(UnixSocketRawData, UnixSocketIOBuffer);
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#include "base/message_loop.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace ipc {
|
||||
@ -230,6 +231,15 @@ public:
|
||||
*/
|
||||
UnixSocketRawData(const void* aData, size_t aSize);
|
||||
|
||||
/**
|
||||
* This constructor takes ownership of the data in aData. The
|
||||
* data is assumed to be aSize bytes in length.
|
||||
*
|
||||
* @param aData The buffer to take ownership of.
|
||||
* @param aSize The number of bytes in |aData|.
|
||||
*/
|
||||
UnixSocketRawData(UniquePtr<uint8_t[]> aData, size_t aSize);
|
||||
|
||||
/**
|
||||
* This constructor reserves aSize bytes of space. Currently
|
||||
* it's only possible to fill this buffer by calling |Receive|.
|
||||
|
Loading…
Reference in New Issue
Block a user