зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1359718 - Get rid of PBlob - part 0 - remove PMemoryStream, r=smaug
This commit is contained in:
Родитель
cb6dbbfeac
Коммит
af2f7fcbf5
|
@ -25,8 +25,6 @@
|
|||
#include "mozilla/dom/PBlobStreamChild.h"
|
||||
#include "mozilla/dom/PBlobStreamParent.h"
|
||||
#include "mozilla/dom/indexedDB/FileSnapshot.h"
|
||||
#include "mozilla/dom/ipc/MemoryStreamChild.h"
|
||||
#include "mozilla/dom/ipc/MemoryStreamParent.h"
|
||||
#include "mozilla/dom/IndexedDatabaseManager.h"
|
||||
#include "mozilla/ipc/InputStreamUtils.h"
|
||||
#include "mozilla/ipc/IPCStreamUtils.h"
|
||||
|
@ -620,115 +618,6 @@ struct MOZ_STACK_CLASS CreateBlobImplMetadata final
|
|||
}
|
||||
};
|
||||
|
||||
template<class M>
|
||||
PMemoryStreamChild*
|
||||
SerializeInputStreamInChunks(nsIInputStream* aInputStream, uint64_t aLength,
|
||||
M* aManager)
|
||||
{
|
||||
MOZ_ASSERT(aInputStream);
|
||||
|
||||
PMemoryStreamChild* child = aManager->SendPMemoryStreamConstructor(aLength);
|
||||
if (NS_WARN_IF(!child)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const uint64_t kMaxChunk = 1024 * 1024;
|
||||
|
||||
while (aLength) {
|
||||
FallibleTArray<uint8_t> buffer;
|
||||
|
||||
uint64_t size = XPCOM_MIN(aLength, kMaxChunk);
|
||||
if (NS_WARN_IF(!buffer.SetLength(size, fallible))) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t read;
|
||||
nsresult rv = aInputStream->Read(reinterpret_cast<char*>(buffer.Elements()),
|
||||
size, &read);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (NS_WARN_IF(read == 0)) {
|
||||
// We were not expecting a read==0 here.
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(read <= size);
|
||||
aLength -= read;
|
||||
|
||||
if (NS_WARN_IF(!buffer.SetLength(read, fallible))) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (NS_WARN_IF(!child->SendAddChunk(buffer))) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
return child;
|
||||
}
|
||||
|
||||
void
|
||||
DeleteStreamMemoryFromBlobDataStream(BlobDataStream& aStream)
|
||||
{
|
||||
if (aStream.type() == BlobDataStream::TMemoryBlobDataStream) {
|
||||
PMemoryStreamChild* actor =
|
||||
aStream.get_MemoryBlobDataStream().streamChild();
|
||||
if (actor) {
|
||||
actor->Send__delete__(actor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
DeleteStreamMemoryFromBlobData(BlobData& aBlobData)
|
||||
{
|
||||
switch (aBlobData.type()) {
|
||||
case BlobData::TBlobDataStream:
|
||||
DeleteStreamMemoryFromBlobDataStream(aBlobData.get_BlobDataStream());
|
||||
return;
|
||||
|
||||
case BlobData::TArrayOfBlobData: {
|
||||
nsTArray<BlobData>& arrayBlobData = aBlobData.get_ArrayOfBlobData();
|
||||
for (uint32_t i = 0; i < arrayBlobData.Length(); ++i) {
|
||||
DeleteStreamMemoryFromBlobData(arrayBlobData[i]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
default:
|
||||
// Nothing to do here.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
DeleteStreamMemoryFromOptionalBlobData(OptionalBlobData& aParams)
|
||||
{
|
||||
if (aParams.type() == OptionalBlobData::Tvoid_t) {
|
||||
return;
|
||||
}
|
||||
|
||||
DeleteStreamMemoryFromBlobData(aParams.get_BlobData());
|
||||
}
|
||||
|
||||
void
|
||||
DeleteStreamMemory(AnyBlobConstructorParams& aParams)
|
||||
{
|
||||
if (aParams.type() == AnyBlobConstructorParams::TFileBlobConstructorParams) {
|
||||
FileBlobConstructorParams& fileParams = aParams.get_FileBlobConstructorParams();
|
||||
DeleteStreamMemoryFromOptionalBlobData(fileParams.optionalBlobData());
|
||||
return;
|
||||
}
|
||||
|
||||
if (aParams.type() == AnyBlobConstructorParams::TNormalBlobConstructorParams) {
|
||||
NormalBlobConstructorParams& normalParams = aParams.get_NormalBlobConstructorParams();
|
||||
DeleteStreamMemoryFromOptionalBlobData(normalParams.optionalBlobData());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
already_AddRefed<BlobImpl>
|
||||
|
@ -760,32 +649,16 @@ CreateBlobImpl(const BlobDataStream& aStream,
|
|||
nsCOMPtr<nsIInputStream> inputStream;
|
||||
uint64_t length;
|
||||
|
||||
if (aStream.type() == BlobDataStream::TMemoryBlobDataStream) {
|
||||
const MemoryBlobDataStream& memoryBlobDataStream =
|
||||
aStream.get_MemoryBlobDataStream();
|
||||
MOZ_ASSERT(aStream.type() == BlobDataStream::TIPCStream);
|
||||
inputStream = DeserializeIPCStream(aStream.get_IPCStream());
|
||||
if (!inputStream) {
|
||||
ASSERT_UNLESS_FUZZING();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MemoryStreamParent* actor =
|
||||
static_cast<MemoryStreamParent*>(memoryBlobDataStream.streamParent());
|
||||
|
||||
actor->GetStream(getter_AddRefs(inputStream));
|
||||
if (!inputStream) {
|
||||
ASSERT_UNLESS_FUZZING();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
length = memoryBlobDataStream.length();
|
||||
} else {
|
||||
MOZ_ASSERT(aStream.type() == BlobDataStream::TIPCStream);
|
||||
inputStream = DeserializeIPCStream(aStream.get_IPCStream());
|
||||
if (!inputStream) {
|
||||
ASSERT_UNLESS_FUZZING();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsresult rv = inputStream->Available(&length);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return nullptr;
|
||||
}
|
||||
nsresult rv = inputStream->Available(&length);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<BlobImpl> blobImpl;
|
||||
|
@ -1039,14 +912,7 @@ BlobDataFromBlobImpl(ChildManagerType* aManager, BlobImpl* aBlobImpl,
|
|||
return true;
|
||||
}
|
||||
|
||||
PMemoryStreamChild* streamActor =
|
||||
SerializeInputStreamInChunks(inputStream, length, aManager);
|
||||
if (!streamActor) {
|
||||
return false;
|
||||
}
|
||||
|
||||
aBlobData = MemoryBlobDataStream(nullptr, streamActor, length);
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
RemoteInputStream::RemoteInputStream(BlobImpl* aBlobImpl,
|
||||
|
@ -3704,8 +3570,6 @@ BlobChild::GetOrCreateFromImpl(ChildManagerType* aManager,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
DeleteStreamMemory(params.blobParams());
|
||||
|
||||
autoIPCStreams.Clear();
|
||||
return actor;
|
||||
}
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
/* -*- 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/. */
|
||||
|
||||
#ifndef mozilla_dom_ipc_MemoryStreamChild_h
|
||||
#define mozilla_dom_ipc_MemoryStreamChild_h
|
||||
|
||||
#include "mozilla/ipc/PMemoryStreamChild.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class MemoryStreamChild final : public mozilla::ipc::PMemoryStreamChild
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_dom_ipc_MemoryStreamChild_h
|
|
@ -1,78 +0,0 @@
|
|||
/* -*- 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 "MemoryStreamParent.h"
|
||||
#include "nsIInputStream.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
MemoryStreamParent::MemoryStreamParent(uint64_t aSize)
|
||||
: mSize(aSize)
|
||||
, mCurSize(0)
|
||||
{}
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
MemoryStreamParent::RecvAddChunk(nsTArray<unsigned char>&& aData)
|
||||
{
|
||||
MOZ_ASSERT(mSize);
|
||||
|
||||
uint64_t dataLength = aData.Length();
|
||||
|
||||
if (!dataLength || mSize < (mCurSize + dataLength)) {
|
||||
return IPC_FAIL_NO_REASON(this);
|
||||
}
|
||||
|
||||
void* buffer = malloc(dataLength);
|
||||
if (NS_WARN_IF(!buffer)) {
|
||||
return IPC_FAIL_NO_REASON(this);
|
||||
}
|
||||
|
||||
memcpy(buffer, aData.Elements(), dataLength);
|
||||
mData.AppendElement(new MemoryBlobImpl::DataOwner(buffer, dataLength));
|
||||
|
||||
mCurSize += dataLength;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
void
|
||||
MemoryStreamParent::ActorDestroy(IProtocol::ActorDestroyReason)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
MemoryStreamParent::GetStream(nsIInputStream** aInputStream)
|
||||
{
|
||||
if (mCurSize != mSize) {
|
||||
*aInputStream = nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIMultiplexInputStream> stream =
|
||||
do_CreateInstance("@mozilla.org/io/multiplex-input-stream;1");
|
||||
if (NS_WARN_IF(!stream)) {
|
||||
*aInputStream = nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < mData.Length(); ++i) {
|
||||
nsCOMPtr<nsIInputStream> dataStream;
|
||||
nsresult rv =
|
||||
MemoryBlobImpl::DataOwnerAdapter::Create(mData[i], 0, mData[i]->mLength,
|
||||
getter_AddRefs(dataStream));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
*aInputStream = nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
stream->AppendStream(dataStream);
|
||||
}
|
||||
|
||||
stream.forget(aInputStream);
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
|
@ -1,40 +0,0 @@
|
|||
/* -*- 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/. */
|
||||
|
||||
#ifndef mozilla_dom_ipc_MemoryStreamParent_h
|
||||
#define mozilla_dom_ipc_MemoryStreamParent_h
|
||||
|
||||
#include "mozilla/ipc/PMemoryStreamParent.h"
|
||||
#include "mozilla/dom/MemoryBlobImpl.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class MemoryStreamParent final : public mozilla::ipc::PMemoryStreamParent
|
||||
{
|
||||
public:
|
||||
explicit MemoryStreamParent(uint64_t aSize);
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
RecvAddChunk(nsTArray<unsigned char>&& aData) override;
|
||||
|
||||
void
|
||||
ActorDestroy(IProtocol::ActorDestroyReason) override;
|
||||
|
||||
void
|
||||
GetStream(nsIInputStream** aInputStream);
|
||||
|
||||
private:
|
||||
uint64_t mSize;
|
||||
uint64_t mCurSize;
|
||||
|
||||
nsTArray<RefPtr<MemoryBlobImpl::DataOwner>> mData;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_dom_ipc_MemoryStreamParent_h
|
|
@ -9,7 +9,6 @@ include protocol PContentBridge;
|
|||
include protocol PFileDescriptorSet;
|
||||
include protocol PChildToParentStream;
|
||||
include protocol PParentToChildStream;
|
||||
include protocol PMemoryStream;
|
||||
|
||||
include BlobTypes;
|
||||
include DOMTypes;
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
/* 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 protocol PBackground;
|
||||
include protocol PContent;
|
||||
include protocol PContentBridge;
|
||||
|
||||
namespace mozilla {
|
||||
namespace ipc {
|
||||
|
||||
protocol PMemoryStream
|
||||
{
|
||||
manager PBackground or PContent or PContentBridge;
|
||||
|
||||
parent:
|
||||
async AddChunk(uint8_t[] data);
|
||||
|
||||
async __delete__();
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
|
@ -11,8 +11,6 @@ EXPORTS.mozilla.dom.ipc += [
|
|||
'IPCBlobInputStreamChild.h',
|
||||
'IPCBlobInputStreamParent.h',
|
||||
'IPCBlobInputStreamStorage.h',
|
||||
'MemoryStreamChild.h',
|
||||
'MemoryStreamParent.h',
|
||||
'nsIRemoteBlob.h',
|
||||
'PendingIPCBlobChild.h',
|
||||
'PendingIPCBlobParent.h',
|
||||
|
@ -29,7 +27,6 @@ UNIFIED_SOURCES += [
|
|||
'IPCBlobInputStreamParent.cpp',
|
||||
'IPCBlobInputStreamStorage.cpp',
|
||||
'IPCBlobUtils.cpp',
|
||||
'MemoryStreamParent.cpp',
|
||||
'PendingIPCBlobChild.cpp',
|
||||
'PendingIPCBlobParent.cpp',
|
||||
]
|
||||
|
@ -40,7 +37,6 @@ IPDL_SOURCES += [
|
|||
'PBlob.ipdl',
|
||||
'PBlobStream.ipdl',
|
||||
'PIPCBlobInputStream.ipdl',
|
||||
'PMemoryStream.ipdl',
|
||||
'PPendingIPCBlob.ipdl',
|
||||
]
|
||||
|
||||
|
|
|
@ -68,12 +68,6 @@ ContentBridgeChild::SendPBlobConstructor(PBlobChild* actor,
|
|||
return PContentBridgeChild::SendPBlobConstructor(actor, params);
|
||||
}
|
||||
|
||||
PMemoryStreamChild*
|
||||
ContentBridgeChild::SendPMemoryStreamConstructor(const uint64_t& aSize)
|
||||
{
|
||||
return PContentBridgeChild::SendPMemoryStreamConstructor(aSize);
|
||||
}
|
||||
|
||||
bool
|
||||
ContentBridgeChild::SendPBrowserConstructor(PBrowserChild* aActor,
|
||||
const TabId& aTabId,
|
||||
|
@ -180,18 +174,6 @@ ContentBridgeChild::DeallocPBlobChild(PBlobChild* aActor)
|
|||
return nsIContentChild::DeallocPBlobChild(aActor);
|
||||
}
|
||||
|
||||
PMemoryStreamChild*
|
||||
ContentBridgeChild::AllocPMemoryStreamChild(const uint64_t& aSize)
|
||||
{
|
||||
return nsIContentChild::AllocPMemoryStreamChild(aSize);
|
||||
}
|
||||
|
||||
bool
|
||||
ContentBridgeChild::DeallocPMemoryStreamChild(PMemoryStreamChild* aActor)
|
||||
{
|
||||
return nsIContentChild::DeallocPMemoryStreamChild(aActor);
|
||||
}
|
||||
|
||||
PIPCBlobInputStreamChild*
|
||||
ContentBridgeChild::AllocPIPCBlobInputStreamChild(const nsID& aID,
|
||||
const uint64_t& aSize)
|
||||
|
|
|
@ -36,9 +36,6 @@ public:
|
|||
SendPBlobConstructor(PBlobChild* actor,
|
||||
const BlobConstructorParams& aParams) override;
|
||||
|
||||
virtual PMemoryStreamChild*
|
||||
SendPMemoryStreamConstructor(const uint64_t& aSize) override;
|
||||
|
||||
jsipc::CPOWManager* GetCPOWManager() override;
|
||||
|
||||
virtual bool SendPBrowserConstructor(PBrowserChild* aActor,
|
||||
|
@ -88,10 +85,6 @@ protected:
|
|||
virtual PBlobChild* AllocPBlobChild(const BlobConstructorParams& aParams) override;
|
||||
virtual bool DeallocPBlobChild(PBlobChild*) override;
|
||||
|
||||
virtual PMemoryStreamChild*
|
||||
AllocPMemoryStreamChild(const uint64_t& aSize) override;
|
||||
virtual bool DeallocPMemoryStreamChild(PMemoryStreamChild*) override;
|
||||
|
||||
virtual PIPCBlobInputStreamChild*
|
||||
AllocPIPCBlobInputStreamChild(const nsID& aID,
|
||||
const uint64_t& aSize) override;
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include "mozilla/dom/ContentBridgeParent.h"
|
||||
#include "mozilla/dom/TabParent.h"
|
||||
#include "mozilla/jsipc/CrossProcessObjectWrappers.h"
|
||||
#include "mozilla/dom/ipc/MemoryStreamParent.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "base/task.h"
|
||||
|
@ -140,18 +139,6 @@ ContentBridgeParent::SendPIPCBlobInputStreamConstructor(PIPCBlobInputStreamParen
|
|||
PContentBridgeParent::SendPIPCBlobInputStreamConstructor(aActor, aID, aSize);
|
||||
}
|
||||
|
||||
PMemoryStreamParent*
|
||||
ContentBridgeParent::AllocPMemoryStreamParent(const uint64_t& aSize)
|
||||
{
|
||||
return nsIContentParent::AllocPMemoryStreamParent(aSize);
|
||||
}
|
||||
|
||||
bool
|
||||
ContentBridgeParent::DeallocPMemoryStreamParent(PMemoryStreamParent* aActor)
|
||||
{
|
||||
return nsIContentParent::DeallocPMemoryStreamParent(aActor);
|
||||
}
|
||||
|
||||
PIPCBlobInputStreamParent*
|
||||
ContentBridgeParent::AllocPIPCBlobInputStreamParent(const nsID& aID,
|
||||
const uint64_t& aSize)
|
||||
|
|
|
@ -138,11 +138,6 @@ protected:
|
|||
|
||||
virtual bool DeallocPBlobParent(PBlobParent*) override;
|
||||
|
||||
virtual PMemoryStreamParent*
|
||||
AllocPMemoryStreamParent(const uint64_t& aSize) override;
|
||||
|
||||
virtual bool DeallocPMemoryStreamParent(PMemoryStreamParent*) override;
|
||||
|
||||
virtual PIPCBlobInputStreamParent*
|
||||
SendPIPCBlobInputStreamConstructor(PIPCBlobInputStreamParent* aActor,
|
||||
const nsID& aID,
|
||||
|
|
|
@ -1633,18 +1633,6 @@ ContentChild::DeallocPBrowserChild(PBrowserChild* aIframe)
|
|||
return nsIContentChild::DeallocPBrowserChild(aIframe);
|
||||
}
|
||||
|
||||
PMemoryStreamChild*
|
||||
ContentChild::AllocPMemoryStreamChild(const uint64_t& aSize)
|
||||
{
|
||||
return nsIContentChild::AllocPMemoryStreamChild(aSize);
|
||||
}
|
||||
|
||||
bool
|
||||
ContentChild::DeallocPMemoryStreamChild(PMemoryStreamChild* aActor)
|
||||
{
|
||||
return nsIContentChild::DeallocPMemoryStreamChild(aActor);
|
||||
}
|
||||
|
||||
PIPCBlobInputStreamChild*
|
||||
ContentChild::AllocPIPCBlobInputStreamChild(const nsID& aID,
|
||||
const uint64_t& aSize)
|
||||
|
@ -1695,16 +1683,6 @@ ContentChild::SendPBlobConstructor(PBlobChild* aActor,
|
|||
return PContentChild::SendPBlobConstructor(aActor, aParams);
|
||||
}
|
||||
|
||||
PMemoryStreamChild*
|
||||
ContentChild::SendPMemoryStreamConstructor(const uint64_t& aSize)
|
||||
{
|
||||
if (IsShuttingDown()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return PContentChild::SendPMemoryStreamConstructor(aSize);
|
||||
}
|
||||
|
||||
PPresentationChild*
|
||||
ContentChild::AllocPPresentationChild()
|
||||
{
|
||||
|
|
|
@ -189,12 +189,6 @@ public:
|
|||
|
||||
virtual bool DeallocPBlobChild(PBlobChild* aActor) override;
|
||||
|
||||
virtual PMemoryStreamChild*
|
||||
AllocPMemoryStreamChild(const uint64_t& aSize) override;
|
||||
|
||||
virtual bool
|
||||
DeallocPMemoryStreamChild(PMemoryStreamChild* aActor) override;
|
||||
|
||||
virtual PIPCBlobInputStreamChild*
|
||||
AllocPIPCBlobInputStreamChild(const nsID& aID,
|
||||
const uint64_t& aSize) override;
|
||||
|
@ -523,9 +517,6 @@ public:
|
|||
SendPBlobConstructor(PBlobChild* actor,
|
||||
const BlobConstructorParams& params) override;
|
||||
|
||||
virtual PMemoryStreamChild*
|
||||
SendPMemoryStreamConstructor(const uint64_t& aSize) override;
|
||||
|
||||
virtual PFileDescriptorSetChild*
|
||||
SendPFileDescriptorSetConstructor(const FileDescriptor&) override;
|
||||
|
||||
|
|
|
@ -2850,18 +2850,6 @@ ContentParent::DeallocPBlobParent(PBlobParent* aActor)
|
|||
return nsIContentParent::DeallocPBlobParent(aActor);
|
||||
}
|
||||
|
||||
PMemoryStreamParent*
|
||||
ContentParent::AllocPMemoryStreamParent(const uint64_t& aSize)
|
||||
{
|
||||
return nsIContentParent::AllocPMemoryStreamParent(aSize);
|
||||
}
|
||||
|
||||
bool
|
||||
ContentParent::DeallocPMemoryStreamParent(PMemoryStreamParent* aActor)
|
||||
{
|
||||
return nsIContentParent::DeallocPMemoryStreamParent(aActor);
|
||||
}
|
||||
|
||||
PIPCBlobInputStreamParent*
|
||||
ContentParent::AllocPIPCBlobInputStreamParent(const nsID& aID,
|
||||
const uint64_t& aSize)
|
||||
|
|
|
@ -849,11 +849,6 @@ private:
|
|||
|
||||
virtual bool DeallocPBlobParent(PBlobParent* aActor) override;
|
||||
|
||||
virtual PMemoryStreamParent*
|
||||
AllocPMemoryStreamParent(const uint64_t& aSize) override;
|
||||
|
||||
virtual bool DeallocPMemoryStreamParent(PMemoryStreamParent* aActor) override;
|
||||
|
||||
virtual PIPCBlobInputStreamParent*
|
||||
SendPIPCBlobInputStreamConstructor(PIPCBlobInputStreamParent* aActor,
|
||||
const nsID& aID,
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
include protocol PBlob;
|
||||
include protocol PMemoryStream;
|
||||
|
||||
include IPCBlob;
|
||||
include IPCStream;
|
||||
|
@ -47,18 +46,9 @@ struct ClonedMessageData
|
|||
MessagePortIdentifier[] identfiers;
|
||||
};
|
||||
|
||||
struct MemoryBlobDataStream
|
||||
{
|
||||
PMemoryStream stream;
|
||||
uint64_t length;
|
||||
};
|
||||
|
||||
// I could remove this completely, but this will be gone in the following patch.
|
||||
union BlobDataStream
|
||||
{
|
||||
MemoryBlobDataStream;
|
||||
|
||||
// InputStreamParams is used only when we are _sure_ that the serialized size
|
||||
// is lower than 1 Mb. Otherwise we use MemoryBlobDataStream.
|
||||
IPCStream;
|
||||
};
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ include protocol PProcessHangMonitor;
|
|||
include protocol PImageBridge;
|
||||
include protocol PIPCBlobInputStream;
|
||||
include protocol PMedia;
|
||||
include protocol PMemoryStream;
|
||||
include protocol PNecko;
|
||||
include protocol PGMPContent;
|
||||
include protocol PGMPService;
|
||||
|
@ -295,7 +294,6 @@ nested(upto inside_cpow) sync protocol PContent
|
|||
manages PHeapSnapshotTempFileHelper;
|
||||
manages PIPCBlobInputStream;
|
||||
manages PMedia;
|
||||
manages PMemoryStream;
|
||||
manages PNecko;
|
||||
manages POfflineCacheUpdate;
|
||||
manages PPrinting;
|
||||
|
@ -680,8 +678,6 @@ parent:
|
|||
|
||||
async PRemoteSpellcheckEngine();
|
||||
|
||||
async PMemoryStream(uint64_t aSize);
|
||||
|
||||
async InitCrashReporter(Shmem shmem, NativeThreadId tid);
|
||||
|
||||
/**
|
||||
|
|
|
@ -10,7 +10,6 @@ include protocol PContent;
|
|||
include protocol PJavaScript;
|
||||
include protocol PFileDescriptorSet;
|
||||
include protocol PChildToParentStream;
|
||||
include protocol PMemoryStream;
|
||||
include protocol PParentToChildStream;
|
||||
include protocol PIPCBlobInputStream;
|
||||
|
||||
|
@ -43,7 +42,6 @@ nested(upto inside_cpow) sync protocol PContentBridge
|
|||
manages PFileDescriptorSet;
|
||||
manages PJavaScript;
|
||||
manages PChildToParentStream;
|
||||
manages PMemoryStream;
|
||||
manages PParentToChildStream;
|
||||
manages PIPCBlobInputStream;
|
||||
|
||||
|
@ -71,8 +69,6 @@ parent:
|
|||
|
||||
async PChildToParentStream();
|
||||
|
||||
async PMemoryStream(uint64_t aSize);
|
||||
|
||||
both:
|
||||
// Both the parent and the child can construct the PBrowser.
|
||||
// See the comment in PContent::PBrowser().
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "mozilla/ipc/IPCStreamSource.h"
|
||||
#include "mozilla/ipc/PChildToParentStreamChild.h"
|
||||
#include "mozilla/ipc/PParentToChildStreamChild.h"
|
||||
#include "mozilla/dom/ipc/MemoryStreamChild.h"
|
||||
#include "mozilla/dom/ipc/IPCBlobInputStreamChild.h"
|
||||
|
||||
#include "nsPrintfCString.h"
|
||||
|
@ -107,19 +106,6 @@ nsIContentChild::RecvPBrowserConstructor(PBrowserChild* aActor,
|
|||
return IPC_OK();
|
||||
}
|
||||
|
||||
PMemoryStreamChild*
|
||||
nsIContentChild::AllocPMemoryStreamChild(const uint64_t& aSize)
|
||||
{
|
||||
return new MemoryStreamChild();
|
||||
}
|
||||
|
||||
bool
|
||||
nsIContentChild::DeallocPMemoryStreamChild(PMemoryStreamChild* aActor)
|
||||
{
|
||||
delete aActor;
|
||||
return true;
|
||||
}
|
||||
|
||||
PIPCBlobInputStreamChild*
|
||||
nsIContentChild::AllocPIPCBlobInputStreamChild(const nsID& aID,
|
||||
const uint64_t& aSize)
|
||||
|
|
|
@ -64,9 +64,6 @@ public:
|
|||
SendPBlobConstructor(PBlobChild* aActor,
|
||||
const BlobConstructorParams& aParams) = 0;
|
||||
|
||||
virtual mozilla::ipc::PMemoryStreamChild*
|
||||
SendPMemoryStreamConstructor(const uint64_t& aSize) = 0;
|
||||
|
||||
virtual bool
|
||||
SendPBrowserConstructor(PBrowserChild* aActor,
|
||||
const TabId& aTabId,
|
||||
|
@ -106,11 +103,6 @@ protected:
|
|||
|
||||
virtual bool DeallocPBlobChild(PBlobChild* aActor);
|
||||
|
||||
virtual mozilla::ipc::PMemoryStreamChild*
|
||||
AllocPMemoryStreamChild(const uint64_t& aSize);
|
||||
|
||||
virtual bool DeallocPMemoryStreamChild(mozilla::ipc::PMemoryStreamChild* aActor);
|
||||
|
||||
virtual mozilla::ipc::PIPCBlobInputStreamChild*
|
||||
AllocPIPCBlobInputStreamChild(const nsID& aID, const uint64_t& aSize);
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include "mozilla/dom/TabParent.h"
|
||||
#include "mozilla/dom/ipc/BlobParent.h"
|
||||
#include "mozilla/dom/ipc/IPCBlobInputStreamParent.h"
|
||||
#include "mozilla/dom/ipc/MemoryStreamParent.h"
|
||||
#include "mozilla/dom/ipc/StructuredCloneData.h"
|
||||
#include "mozilla/jsipc/CrossProcessObjectWrappers.h"
|
||||
#include "mozilla/ipc/FileDescriptorSetParent.h"
|
||||
|
@ -219,19 +218,6 @@ nsIContentParent::DeallocPBlobParent(PBlobParent* aActor)
|
|||
return true;
|
||||
}
|
||||
|
||||
PMemoryStreamParent*
|
||||
nsIContentParent::AllocPMemoryStreamParent(const uint64_t& aSize)
|
||||
{
|
||||
return new MemoryStreamParent(aSize);
|
||||
}
|
||||
|
||||
bool
|
||||
nsIContentParent::DeallocPMemoryStreamParent(PMemoryStreamParent* aActor)
|
||||
{
|
||||
delete aActor;
|
||||
return true;
|
||||
}
|
||||
|
||||
PIPCBlobInputStreamParent*
|
||||
nsIContentParent::AllocPIPCBlobInputStreamParent(const nsID& aID,
|
||||
const uint64_t& aSize)
|
||||
|
|
|
@ -36,7 +36,6 @@ namespace ipc {
|
|||
class PFileDescriptorSetParent;
|
||||
class PChildToParentStreamParent;
|
||||
class PParentToChildStreamParent;
|
||||
class PMemoryStreamParent;
|
||||
class PIPCBlobInputStreamParent;
|
||||
}
|
||||
|
||||
|
@ -130,11 +129,6 @@ protected: // IPDL methods
|
|||
|
||||
virtual bool DeallocPBlobParent(PBlobParent* aActor);
|
||||
|
||||
virtual mozilla::ipc::PMemoryStreamParent*
|
||||
AllocPMemoryStreamParent(const uint64_t& aSize);
|
||||
|
||||
virtual bool DeallocPMemoryStreamParent(mozilla::ipc::PMemoryStreamParent* aActor);
|
||||
|
||||
virtual mozilla::ipc::PIPCBlobInputStreamParent*
|
||||
AllocPIPCBlobInputStreamParent(const nsID& aID, const uint64_t& aSize);
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "mozilla/dom/indexedDB/PBackgroundIndexedDBUtilsChild.h"
|
||||
#include "mozilla/dom/ipc/BlobChild.h"
|
||||
#include "mozilla/dom/ipc/IPCBlobInputStreamChild.h"
|
||||
#include "mozilla/dom/ipc/MemoryStreamChild.h"
|
||||
#include "mozilla/dom/ipc/PendingIPCBlobChild.h"
|
||||
#include "mozilla/dom/quota/PQuotaChild.h"
|
||||
#include "mozilla/dom/GamepadEventChannelChild.h"
|
||||
|
@ -222,19 +221,6 @@ BackgroundChildImpl::DeallocPBlobChild(PBlobChild* aActor)
|
|||
return true;
|
||||
}
|
||||
|
||||
PMemoryStreamChild*
|
||||
BackgroundChildImpl::AllocPMemoryStreamChild(const uint64_t& aSize)
|
||||
{
|
||||
return new mozilla::dom::MemoryStreamChild();
|
||||
}
|
||||
|
||||
bool
|
||||
BackgroundChildImpl::DeallocPMemoryStreamChild(PMemoryStreamChild* aActor)
|
||||
{
|
||||
delete aActor;
|
||||
return true;
|
||||
}
|
||||
|
||||
PPendingIPCBlobChild*
|
||||
BackgroundChildImpl::AllocPPendingIPCBlobChild(const IPCBlob& aBlob)
|
||||
{
|
||||
|
|
|
@ -76,12 +76,6 @@ protected:
|
|||
virtual bool
|
||||
DeallocPBlobChild(PBlobChild* aActor) override;
|
||||
|
||||
virtual PMemoryStreamChild*
|
||||
AllocPMemoryStreamChild(const uint64_t& aSize) override;
|
||||
|
||||
virtual bool
|
||||
DeallocPMemoryStreamChild(PMemoryStreamChild* aActor) override;
|
||||
|
||||
virtual PPendingIPCBlobChild*
|
||||
AllocPPendingIPCBlobChild(const IPCBlob& aBlob) override;
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include "mozilla/dom/indexedDB/ActorsParent.h"
|
||||
#include "mozilla/dom/ipc/BlobParent.h"
|
||||
#include "mozilla/dom/ipc/IPCBlobInputStreamParent.h"
|
||||
#include "mozilla/dom/ipc/MemoryStreamParent.h"
|
||||
#include "mozilla/dom/ipc/PendingIPCBlobParent.h"
|
||||
#include "mozilla/dom/quota/ActorsParent.h"
|
||||
#include "mozilla/ipc/BackgroundParent.h"
|
||||
|
@ -271,26 +270,6 @@ BackgroundParentImpl::DeallocPBlobParent(PBlobParent* aActor)
|
|||
return true;
|
||||
}
|
||||
|
||||
PMemoryStreamParent*
|
||||
BackgroundParentImpl::AllocPMemoryStreamParent(const uint64_t& aSize)
|
||||
{
|
||||
AssertIsInMainProcess();
|
||||
AssertIsOnBackgroundThread();
|
||||
|
||||
return new mozilla::dom::MemoryStreamParent(aSize);
|
||||
}
|
||||
|
||||
bool
|
||||
BackgroundParentImpl::DeallocPMemoryStreamParent(PMemoryStreamParent* aActor)
|
||||
{
|
||||
AssertIsInMainProcess();
|
||||
AssertIsOnBackgroundThread();
|
||||
MOZ_ASSERT(aActor);
|
||||
|
||||
delete aActor;
|
||||
return true;
|
||||
}
|
||||
|
||||
PPendingIPCBlobParent*
|
||||
BackgroundParentImpl::AllocPPendingIPCBlobParent(const IPCBlob& aBlob)
|
||||
{
|
||||
|
|
|
@ -69,12 +69,6 @@ protected:
|
|||
virtual bool
|
||||
DeallocPBlobParent(PBlobParent* aActor) override;
|
||||
|
||||
virtual PMemoryStreamParent*
|
||||
AllocPMemoryStreamParent(const uint64_t& aSize) override;
|
||||
|
||||
virtual bool
|
||||
DeallocPMemoryStreamParent(PMemoryStreamParent* aActor) override;
|
||||
|
||||
virtual PPendingIPCBlobParent*
|
||||
AllocPPendingIPCBlobParent(const IPCBlob& aBlob) override;
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ include protocol PGamepadEventChannel;
|
|||
include protocol PGamepadTestChannel;
|
||||
include protocol PIPCBlobInputStream;
|
||||
include protocol PPendingIPCBlob;
|
||||
include protocol PMemoryStream;
|
||||
include protocol PMessagePort;
|
||||
include protocol PCameras;
|
||||
include protocol PQuota;
|
||||
|
@ -65,7 +64,6 @@ sync protocol PBackground
|
|||
manages PGamepadEventChannel;
|
||||
manages PGamepadTestChannel;
|
||||
manages PIPCBlobInputStream;
|
||||
manages PMemoryStream;
|
||||
manages PPendingIPCBlob;
|
||||
manages PMessagePort;
|
||||
manages PCameras;
|
||||
|
@ -119,8 +117,6 @@ parent:
|
|||
|
||||
async PGamepadTestChannel();
|
||||
|
||||
async PMemoryStream(uint64_t aSize);
|
||||
|
||||
async PWebAuthnTransaction();
|
||||
|
||||
child:
|
||||
|
|
Загрузка…
Ссылка в новой задаче