fune/dom/file/ipc/PendingIPCBlobChild.cpp
Nicholas Nethercote e3c9cbb969 Bug 1401813 - Rename Null[C]String() as Void[C]String(). r=erahm.
XPCOM's string API doesn't have the notion of a "null string". But it does have
the notion of a "void string" (or "voided string"), and that's what these
functions are returning. So the names should reflect that.

--HG--
extra : rebase_source : 4e3f982e0873877174a08a25413595ff66f7d20e
2017-09-22 14:35:46 +10:00

55 lines
1.7 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
#include "PendingIPCBlobChild.h"
namespace mozilla {
namespace dom {
PendingIPCBlobChild::PendingIPCBlobChild(const IPCBlob& aBlob)
{
mBlobImpl = IPCBlobUtils::Deserialize(aBlob);
MOZ_ASSERT(mBlobImpl);
}
PendingIPCBlobChild::~PendingIPCBlobChild()
{}
already_AddRefed<BlobImpl>
PendingIPCBlobChild::SetPendingInfoAndDeleteActor(const nsString& aName,
const nsString& aContentType,
uint64_t aLength,
int64_t aLastModifiedDate)
{
RefPtr<BlobImpl> blobImpl;
blobImpl.swap(mBlobImpl);
blobImpl->SetLazyData(aName, aContentType, aLength, aLastModifiedDate);
PendingIPCFileData fileData(nsString(aName), aLastModifiedDate);
PendingIPCBlobData blobData(nsString(aContentType), aLength, fileData);
Unused << Send__delete__(this, blobData);
return blobImpl.forget();
}
already_AddRefed<BlobImpl>
PendingIPCBlobChild::SetPendingInfoAndDeleteActor(const nsString& aContentType,
uint64_t aLength)
{
RefPtr<BlobImpl> blobImpl;
blobImpl.swap(mBlobImpl);
blobImpl->SetLazyData(VoidString(), aContentType, aLength, INT64_MAX);
PendingIPCBlobData data(nsString(aContentType), aLength, void_t());
Unused << Send__delete__(this, data);
return blobImpl.forget();
}
} // namespace dom
} // namespace mozilla