Backed out changeset 2b53bdd61d64 (bug 1353629)

This commit is contained in:
Sebastian Hengst 2017-04-20 18:37:09 +02:00
Родитель 0f8dbe4f16
Коммит b4d6f20936
30 изменённых файлов: 0 добавлений и 653 удалений

Просмотреть файл

@ -6,7 +6,6 @@ include protocol PBackground;
include protocol PBlob;
include protocol PChildToParentStream;
include protocol PFileDescriptorSet;
include protocol PIPCBlobInputStream;
include protocol PParentToChildStream;
include DOMTypes;

Просмотреть файл

@ -1,98 +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 "IPCBlobInputStream.h"
#include "IPCBlobInputStreamChild.h"
namespace mozilla {
namespace dom {
NS_IMPL_ADDREF(IPCBlobInputStream);
NS_IMPL_RELEASE(IPCBlobInputStream);
NS_INTERFACE_MAP_BEGIN(IPCBlobInputStream)
NS_INTERFACE_MAP_ENTRY(nsIInputStream)
NS_INTERFACE_MAP_ENTRY(nsICloneableInputStream)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIInputStream)
NS_INTERFACE_MAP_END
IPCBlobInputStream::IPCBlobInputStream(IPCBlobInputStreamChild* aActor)
: mActor(aActor)
{
MOZ_ASSERT(aActor);
}
IPCBlobInputStream::~IPCBlobInputStream()
{
Close();
}
// nsIInputStream interface
NS_IMETHODIMP
IPCBlobInputStream::Available(uint64_t* aLength)
{
if (!mActor) {
return NS_BASE_STREAM_CLOSED;
}
*aLength = mActor->Size();
return NS_OK;
}
NS_IMETHODIMP
IPCBlobInputStream::Read(char* aBuffer, uint32_t aCount, uint32_t* aReadCount)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
IPCBlobInputStream::ReadSegments(nsWriteSegmentFun aWriter, void* aClosure,
uint32_t aCount, uint32_t *aResult)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
IPCBlobInputStream::IsNonBlocking(bool* aNonBlocking)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
IPCBlobInputStream::Close()
{
if (mActor) {
mActor->ForgetStream(this);
mActor = nullptr;
}
return NS_OK;
}
// nsICloneableInputStream interface
NS_IMETHODIMP
IPCBlobInputStream::GetCloneable(bool* aCloneable)
{
*aCloneable = !!mActor;
return NS_OK;
}
NS_IMETHODIMP
IPCBlobInputStream::Clone(nsIInputStream** aResult)
{
if (!mActor) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIInputStream> stream = mActor->CreateStream();
stream.forget(aResult);
return NS_OK;
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -1,37 +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_IPCBlobInputStream_h
#define mozilla_dom_ipc_IPCBlobInputStream_h
#include "nsIInputStream.h"
#include "nsICloneableInputStream.h"
namespace mozilla {
namespace dom {
class IPCBlobInputStreamChild;
class IPCBlobInputStream final : public nsIInputStream
, public nsICloneableInputStream
{
public:
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIINPUTSTREAM
NS_DECL_NSICLONEABLEINPUTSTREAM
explicit IPCBlobInputStream(IPCBlobInputStreamChild* aActor);
private:
~IPCBlobInputStream();
RefPtr<IPCBlobInputStreamChild> mActor;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_ipc_IPCBlobInputStream_h

Просмотреть файл

@ -1,90 +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 "IPCBlobInputStreamChild.h"
namespace mozilla {
namespace dom {
namespace {
// This runnable is used in case the last stream is forgotten on the 'wrong'
// thread.
class DeleteRunnable final : public Runnable
{
public:
explicit DeleteRunnable(IPCBlobInputStreamChild* aActor)
: mActor(aActor)
{}
NS_IMETHOD
Run() override
{
mActor->Send__delete__(mActor);
return NS_OK;
}
private:
RefPtr<IPCBlobInputStreamChild> mActor;
};
} // anonymous
IPCBlobInputStreamChild::IPCBlobInputStreamChild(const nsID& aID,
uint64_t aSize)
: mMutex("IPCBlobInputStreamChild::mMutex")
, mID(aID)
, mSize(aSize)
, mActorAlive(true)
, mOwningThread(NS_GetCurrentThread())
{}
IPCBlobInputStreamChild::~IPCBlobInputStreamChild()
{}
void
IPCBlobInputStreamChild::ActorDestroy(IProtocol::ActorDestroyReason aReason)
{
mActorAlive = false;
}
already_AddRefed<nsIInputStream>
IPCBlobInputStreamChild::CreateStream()
{
MutexAutoLock lock(mMutex);
RefPtr<IPCBlobInputStream> stream = new IPCBlobInputStream(this);
mStreams.AppendElement(stream);
return stream.forget();
}
void
IPCBlobInputStreamChild::ForgetStream(IPCBlobInputStream* aStream)
{
MOZ_ASSERT(aStream);
RefPtr<IPCBlobInputStreamChild> kungFoDeathGrip = this;
{
MutexAutoLock lock(mMutex);
mStreams.RemoveElement(aStream);
if (!mStreams.IsEmpty() || !mActorAlive) {
return;
}
}
if (mOwningThread == NS_GetCurrentThread()) {
Send__delete__(this);
return;
}
RefPtr<DeleteRunnable> runnable = new DeleteRunnable(this);
mOwningThread->Dispatch(runnable, NS_DISPATCH_NORMAL);
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -1,66 +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_IPCBlobInputStreamChild_h
#define mozilla_dom_ipc_IPCBlobInputStreamChild_h
#include "mozilla/ipc/PIPCBlobInputStreamChild.h"
#include "mozilla/Mutex.h"
#include "nsIThread.h"
#include "nsTArray.h"
namespace mozilla {
namespace dom {
class IPCBlobInputStream;
class IPCBlobInputStreamChild final
: public mozilla::ipc::PIPCBlobInputStreamChild
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(IPCBlobInputStreamChild)
IPCBlobInputStreamChild(const nsID& aID, uint64_t aSize);
void
ActorDestroy(IProtocol::ActorDestroyReason aReason) override;
already_AddRefed<nsIInputStream>
CreateStream();
void
ForgetStream(IPCBlobInputStream* aStream);
uint64_t
Size() const
{
return mSize;
}
private:
~IPCBlobInputStreamChild();
// Raw pointers because these streams keep this actor alive. When the last
// stream is unregister, the actor will be deleted. This list is protected by
// mutex.
nsTArray<IPCBlobInputStream*> mStreams;
// This mutex protects mStreams because that can be touched in any thread.
Mutex mMutex;
const nsID mID;
const uint64_t mSize;
// false when ActorDestroy() is called.
bool mActorAlive;
nsCOMPtr<nsIThread> mOwningThread;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_ipc_IPCBlobInputStreamChild_h

Просмотреть файл

@ -1,51 +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 "IPCBlobInputStreamParent.h"
#include "nsContentUtils.h"
namespace mozilla {
namespace dom {
/* static */ IPCBlobInputStreamParent*
IPCBlobInputStreamParent::Create(nsIInputStream* aInputStream, nsresult* aRv)
{
MOZ_ASSERT(aInputStream);
MOZ_ASSERT(aRv);
nsID id;
*aRv = nsContentUtils::GenerateUUIDInPlace(id);
if (NS_WARN_IF(NS_FAILED(*aRv))) {
return nullptr;
}
// We cannot fail because of the stream has a invalid size. This happens
// normally for nsFileStreams pointing to non-existing files.
uint64_t size;
*aRv = aInputStream->Available(&size);
if (NS_WARN_IF(NS_FAILED(*aRv))) {
size = 0;
}
// TODO: register to a service.
return new IPCBlobInputStreamParent(id, size);
}
IPCBlobInputStreamParent::IPCBlobInputStreamParent(const nsID& aID,
uint64_t aSize)
: mID(aID)
, mSize(aSize)
{}
void
IPCBlobInputStreamParent::ActorDestroy(IProtocol::ActorDestroyReason aReason)
{
// TODO: unregister
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -1,49 +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_IPCBlobInputStreamParent_h
#define mozilla_dom_ipc_IPCBlobInputStreamParent_h
#include "mozilla/ipc/PIPCBlobInputStreamParent.h"
class nsIInputStream;
namespace mozilla {
namespace dom {
class IPCBlobInputStreamParent final
: public mozilla::ipc::PIPCBlobInputStreamParent
{
public:
static IPCBlobInputStreamParent*
Create(nsIInputStream* aInputStream, nsresult* aRv);
void
ActorDestroy(IProtocol::ActorDestroyReason aReason) override;
const nsID&
ID() const
{
return mID;
}
uint64_t
Size() const
{
return mSize;
}
private:
IPCBlobInputStreamParent(const nsID& aID, uint64_t aSize);
const nsID mID;
const uint64_t mSize;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_ipc_IPCBlobInputStreamParent_h

Просмотреть файл

@ -1,22 +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 PIPCBlobInputStream
{
manager PBackground or PContent or PContentBridge;
parent:
async __delete__();
};
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -7,9 +7,6 @@
EXPORTS.mozilla.dom.ipc += [
'BlobChild.h',
'BlobParent.h',
'IPCBlobInputStream.h',
'IPCBlobInputStreamChild.h',
'IPCBlobInputStreamParent.h',
'MemoryStreamChild.h',
'MemoryStreamParent.h',
'nsIRemoteBlob.h',
@ -21,9 +18,6 @@ EXPORTS.mozilla.dom += [
UNIFIED_SOURCES += [
'Blob.cpp',
'IPCBlobInputStream.cpp',
'IPCBlobInputStreamChild.cpp',
'IPCBlobInputStreamParent.cpp',
'IPCBlobUtils.cpp',
'MemoryStreamParent.cpp',
]
@ -33,7 +27,6 @@ IPDL_SOURCES += [
'IPCBlob.ipdlh',
'PBlob.ipdl',
'PBlobStream.ipdl',
'PIPCBlobInputStream.ipdl',
'PMemoryStream.ipdl',
]

Просмотреть файл

@ -192,19 +192,6 @@ ContentBridgeChild::DeallocPMemoryStreamChild(PMemoryStreamChild* aActor)
return nsIContentChild::DeallocPMemoryStreamChild(aActor);
}
PIPCBlobInputStreamChild*
ContentBridgeChild::AllocPIPCBlobInputStreamChild(const nsID& aID,
const uint64_t& aSize)
{
return nsIContentChild::AllocPIPCBlobInputStreamChild(aID, aSize);
}
bool
ContentBridgeChild::DeallocPIPCBlobInputStreamChild(PIPCBlobInputStreamChild* aActor)
{
return nsIContentChild::DeallocPIPCBlobInputStreamChild(aActor);
}
PChildToParentStreamChild*
ContentBridgeChild::AllocPChildToParentStreamChild()
{

Просмотреть файл

@ -92,13 +92,6 @@ protected:
AllocPMemoryStreamChild(const uint64_t& aSize) override;
virtual bool DeallocPMemoryStreamChild(PMemoryStreamChild*) override;
virtual PIPCBlobInputStreamChild*
AllocPIPCBlobInputStreamChild(const nsID& aID,
const uint64_t& aSize) override;
virtual bool
DeallocPIPCBlobInputStreamChild(PIPCBlobInputStreamChild*) override;
virtual mozilla::ipc::PChildToParentStreamChild*
AllocPChildToParentStreamChild() override;

Просмотреть файл

@ -131,15 +131,6 @@ ContentBridgeParent::DeallocPBlobParent(PBlobParent* aActor)
return nsIContentParent::DeallocPBlobParent(aActor);
}
PIPCBlobInputStreamParent*
ContentBridgeParent::SendPIPCBlobInputStreamConstructor(PIPCBlobInputStreamParent* aActor,
const nsID& aID,
const uint64_t& aSize)
{
return
PContentBridgeParent::SendPIPCBlobInputStreamConstructor(aActor, aID, aSize);
}
PMemoryStreamParent*
ContentBridgeParent::AllocPMemoryStreamParent(const uint64_t& aSize)
{
@ -152,19 +143,6 @@ ContentBridgeParent::DeallocPMemoryStreamParent(PMemoryStreamParent* aActor)
return nsIContentParent::DeallocPMemoryStreamParent(aActor);
}
PIPCBlobInputStreamParent*
ContentBridgeParent::AllocPIPCBlobInputStreamParent(const nsID& aID,
const uint64_t& aSize)
{
return nsIContentParent::AllocPIPCBlobInputStreamParent(aID, aSize);
}
bool
ContentBridgeParent::DeallocPIPCBlobInputStreamParent(PIPCBlobInputStreamParent* aActor)
{
return nsIContentParent::DeallocPIPCBlobInputStreamParent(aActor);
}
mozilla::jsipc::PJavaScriptParent *
ContentBridgeParent::AllocPJavaScriptParent()
{

Просмотреть файл

@ -143,18 +143,6 @@ protected:
virtual bool DeallocPMemoryStreamParent(PMemoryStreamParent*) override;
virtual PIPCBlobInputStreamParent*
SendPIPCBlobInputStreamConstructor(PIPCBlobInputStreamParent* aActor,
const nsID& aID,
const uint64_t& aSize) override;
virtual PIPCBlobInputStreamParent*
AllocPIPCBlobInputStreamParent(const nsID& aID,
const uint64_t& aSize) override;
virtual bool
DeallocPIPCBlobInputStreamParent(PIPCBlobInputStreamParent*) override;
virtual PChildToParentStreamParent* AllocPChildToParentStreamParent() override;
virtual bool

Просмотреть файл

@ -1584,19 +1584,6 @@ ContentChild::DeallocPMemoryStreamChild(PMemoryStreamChild* aActor)
return nsIContentChild::DeallocPMemoryStreamChild(aActor);
}
PIPCBlobInputStreamChild*
ContentChild::AllocPIPCBlobInputStreamChild(const nsID& aID,
const uint64_t& aSize)
{
return nsIContentChild::AllocPIPCBlobInputStreamChild(aID, aSize);
}
bool
ContentChild::DeallocPIPCBlobInputStreamChild(PIPCBlobInputStreamChild* aActor)
{
return nsIContentChild::DeallocPIPCBlobInputStreamChild(aActor);
}
PBlobChild*
ContentChild::AllocPBlobChild(const BlobConstructorParams& aParams)
{

Просмотреть файл

@ -191,13 +191,6 @@ public:
virtual bool
DeallocPMemoryStreamChild(PMemoryStreamChild* aActor) override;
virtual PIPCBlobInputStreamChild*
AllocPIPCBlobInputStreamChild(const nsID& aID,
const uint64_t& aSize) override;
virtual bool
DeallocPIPCBlobInputStreamChild(PIPCBlobInputStreamChild* aActor) override;
virtual PHalChild* AllocPHalChild() override;
virtual bool DeallocPHalChild(PHalChild*) override;

Просмотреть файл

@ -2838,19 +2838,6 @@ ContentParent::DeallocPMemoryStreamParent(PMemoryStreamParent* aActor)
return nsIContentParent::DeallocPMemoryStreamParent(aActor);
}
PIPCBlobInputStreamParent*
ContentParent::AllocPIPCBlobInputStreamParent(const nsID& aID,
const uint64_t& aSize)
{
return nsIContentParent::AllocPIPCBlobInputStreamParent(aID, aSize);
}
bool
ContentParent::DeallocPIPCBlobInputStreamParent(PIPCBlobInputStreamParent* aActor)
{
return nsIContentParent::DeallocPIPCBlobInputStreamParent(aActor);
}
mozilla::ipc::IPCResult
ContentParent::RecvPBlobConstructor(PBlobParent* aActor,
const BlobConstructorParams& aParams)
@ -3848,14 +3835,6 @@ ContentParent::SendPBlobConstructor(PBlobParent* aActor,
return PContentParent::SendPBlobConstructor(aActor, aParams);
}
PIPCBlobInputStreamParent*
ContentParent::SendPIPCBlobInputStreamConstructor(PIPCBlobInputStreamParent* aActor,
const nsID& aID,
const uint64_t& aSize)
{
return PContentParent::SendPIPCBlobInputStreamConstructor(aActor, aID, aSize);
}
PBrowserParent*
ContentParent::SendPBrowserConstructor(PBrowserParent* aActor,
const TabId& aTabId,

Просмотреть файл

@ -851,18 +851,6 @@ private:
virtual bool DeallocPMemoryStreamParent(PMemoryStreamParent* aActor) override;
virtual PIPCBlobInputStreamParent*
SendPIPCBlobInputStreamConstructor(PIPCBlobInputStreamParent* aActor,
const nsID& aID,
const uint64_t& aSize) override;
virtual PIPCBlobInputStreamParent*
AllocPIPCBlobInputStreamParent(const nsID& aID,
const uint64_t& aSize) override;
virtual bool
DeallocPIPCBlobInputStreamParent(PIPCBlobInputStreamParent* aActor) override;
virtual mozilla::ipc::IPCResult
RecvPBlobConstructor(PBlobParent* aActor,
const BlobConstructorParams& params) override;

Просмотреть файл

@ -19,8 +19,6 @@ include protocol PRemotePrintJob;
include protocol PChildToParentStream;
include protocol PParentToChildStream;
include protocol PFileDescriptorSet;
include protocol PIPCBlobInputStream;
include DOMTypes;
include IPCBlob;
include IPCStream;

Просмотреть файл

@ -19,7 +19,6 @@ include protocol PHal;
include protocol PHeapSnapshotTempFileHelper;
include protocol PProcessHangMonitor;
include protocol PImageBridge;
include protocol PIPCBlobInputStream;
include protocol PMedia;
include protocol PMemoryStream;
include protocol PNecko;
@ -288,7 +287,6 @@ nested(upto inside_cpow) sync protocol PContent
manages PHal;
manages PHandlerService;
manages PHeapSnapshotTempFileHelper;
manages PIPCBlobInputStream;
manages PMedia;
manages PMemoryStream;
manages PNecko;
@ -611,8 +609,6 @@ child:
async RefreshScreens(ScreenDetails[] aScreens);
async PIPCBlobInputStream(nsID aID, uint64_t aSize);
parent:
async InitBackground(Endpoint<PBackgroundParent> aEndpoint);

Просмотреть файл

@ -12,11 +12,9 @@ include protocol PFileDescriptorSet;
include protocol PChildToParentStream;
include protocol PMemoryStream;
include protocol PParentToChildStream;
include protocol PIPCBlobInputStream;
include DOMTypes;
include JavaScriptTypes;
include ProtocolTypes;
include PTabContext;
using class IPC::Principal from "mozilla/dom/PermissionMessageUtils.h";
@ -45,7 +43,6 @@ nested(upto inside_cpow) sync protocol PContentBridge
manages PChildToParentStream;
manages PMemoryStream;
manages PParentToChildStream;
manages PIPCBlobInputStream;
child:
async PParentToChildStream();
@ -60,8 +57,6 @@ child:
async ParentActivated(PBrowser aTab, bool aActivated);
async PIPCBlobInputStream(nsID aID, uint64_t aSize);
parent:
sync SyncMessage(nsString aMessage, ClonedMessageData aData,
CpowEntry[] aCpows, Principal aPrincipal)

Просмотреть файл

@ -21,7 +21,6 @@
#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"
#include "xpcpublic.h"
@ -120,26 +119,6 @@ nsIContentChild::DeallocPMemoryStreamChild(PMemoryStreamChild* aActor)
return true;
}
PIPCBlobInputStreamChild*
nsIContentChild::AllocPIPCBlobInputStreamChild(const nsID& aID,
const uint64_t& aSize)
{
// IPCBlobInputStreamChild is refcounted. Here it's created and in
// DeallocPIPCBlobInputStreamChild is released.
RefPtr<IPCBlobInputStreamChild> actor =
new IPCBlobInputStreamChild(aID, aSize);
return actor.forget().take();
}
bool
nsIContentChild::DeallocPIPCBlobInputStreamChild(PIPCBlobInputStreamChild* aActor)
{
RefPtr<IPCBlobInputStreamChild> actor =
dont_AddRef(static_cast<IPCBlobInputStreamChild*>(aActor));
return true;
}
PBlobChild*
nsIContentChild::AllocPBlobChild(const BlobConstructorParams& aParams)
{

Просмотреть файл

@ -111,12 +111,6 @@ protected:
virtual bool DeallocPMemoryStreamChild(mozilla::ipc::PMemoryStreamChild* aActor);
virtual mozilla::ipc::PIPCBlobInputStreamChild*
AllocPIPCBlobInputStreamChild(const nsID& aID, const uint64_t& aSize);
virtual bool
DeallocPIPCBlobInputStreamChild(mozilla::ipc::PIPCBlobInputStreamChild* aActor);
virtual mozilla::ipc::PChildToParentStreamChild* AllocPChildToParentStreamChild();
virtual bool

Просмотреть файл

@ -14,7 +14,6 @@
#include "mozilla/dom/PermissionMessageUtils.h"
#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"
@ -205,21 +204,6 @@ nsIContentParent::DeallocPMemoryStreamParent(PMemoryStreamParent* aActor)
return true;
}
PIPCBlobInputStreamParent*
nsIContentParent::AllocPIPCBlobInputStreamParent(const nsID& aID,
const uint64_t& aSize)
{
MOZ_CRASH("PIPCBlobInputStreamParent actors should be manually constructed!");
return nullptr;
}
bool
nsIContentParent::DeallocPIPCBlobInputStreamParent(PIPCBlobInputStreamParent* aActor)
{
delete aActor;
return true;
}
BlobParent*
nsIContentParent::GetOrCreateActorForBlob(Blob* aBlob)
{

Просмотреть файл

@ -37,7 +37,6 @@ class PFileDescriptorSetParent;
class PChildToParentStreamParent;
class PParentToChildStreamParent;
class PMemoryStreamParent;
class PIPCBlobInputStreamParent;
}
namespace dom {
@ -72,11 +71,6 @@ public:
SendPBlobConstructor(PBlobParent* aActor,
const BlobConstructorParams& aParams) = 0;
virtual mozilla::ipc::PIPCBlobInputStreamParent*
SendPIPCBlobInputStreamConstructor(mozilla::ipc::PIPCBlobInputStreamParent* aActor,
const nsID& aID,
const uint64_t& aSize) = 0;
MOZ_MUST_USE virtual PBrowserParent*
SendPBrowserConstructor(PBrowserParent* actor,
const TabId& aTabId,
@ -135,12 +129,6 @@ protected: // IPDL methods
virtual bool DeallocPMemoryStreamParent(mozilla::ipc::PMemoryStreamParent* aActor);
virtual mozilla::ipc::PIPCBlobInputStreamParent*
AllocPIPCBlobInputStreamParent(const nsID& aID, const uint64_t& aSize);
virtual bool
DeallocPIPCBlobInputStreamParent(mozilla::ipc::PIPCBlobInputStreamParent* aActor);
virtual mozilla::ipc::PFileDescriptorSetParent*
AllocPFileDescriptorSetParent(const mozilla::ipc::FileDescriptor& aFD);

Просмотреть файл

@ -5,7 +5,6 @@
include protocol PBackground;
include protocol PChildToParentStream;
include protocol PFileDescriptorSet;
include protocol PIPCBlobInputStream;
include protocol PParentToChildStream;
include protocol PBlob;

Просмотреть файл

@ -23,7 +23,6 @@
#include "mozilla/dom/indexedDB/PBackgroundIDBFactoryChild.h"
#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/quota/PQuotaChild.h"
#include "mozilla/dom/GamepadEventChannelChild.h"
@ -230,26 +229,6 @@ BackgroundChildImpl::DeallocPMemoryStreamChild(PMemoryStreamChild* aActor)
return true;
}
PIPCBlobInputStreamChild*
BackgroundChildImpl::AllocPIPCBlobInputStreamChild(const nsID& aID,
const uint64_t& aSize)
{
// IPCBlobInputStreamChild is refcounted. Here it's created and in
// DeallocPIPCBlobInputStreamChild is released.
RefPtr<mozilla::dom::IPCBlobInputStreamChild> actor =
new mozilla::dom::IPCBlobInputStreamChild(aID, aSize);
return actor.forget().take();
}
bool
BackgroundChildImpl::DeallocPIPCBlobInputStreamChild(PIPCBlobInputStreamChild* aActor)
{
RefPtr<mozilla::dom::IPCBlobInputStreamChild> actor =
dont_AddRef(static_cast<mozilla::dom::IPCBlobInputStreamChild*>(aActor));
return true;
}
PFileDescriptorSetChild*
BackgroundChildImpl::AllocPFileDescriptorSetChild(
const FileDescriptor& aFileDescriptor)

Просмотреть файл

@ -82,13 +82,6 @@ protected:
virtual bool
DeallocPMemoryStreamChild(PMemoryStreamChild* aActor) override;
virtual PIPCBlobInputStreamChild*
AllocPIPCBlobInputStreamChild(const nsID& aID,
const uint64_t& aSize) override;
virtual bool
DeallocPIPCBlobInputStreamChild(PIPCBlobInputStreamChild* aActor) override;
virtual PFileDescriptorSetChild*
AllocPFileDescriptorSetChild(const FileDescriptor& aFileDescriptor)
override;

Просмотреть файл

@ -28,7 +28,6 @@
#include "mozilla/dom/cache/ActorUtils.h"
#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/quota/ActorsParent.h"
#include "mozilla/ipc/BackgroundParent.h"
@ -288,24 +287,6 @@ BackgroundParentImpl::DeallocPMemoryStreamParent(PMemoryStreamParent* aActor)
return true;
}
PIPCBlobInputStreamParent*
BackgroundParentImpl::AllocPIPCBlobInputStreamParent(const nsID& aID,
const uint64_t& aSize)
{
MOZ_CRASH("PIPCBlobInputStreamParent actors should be manually constructed!");
}
bool
BackgroundParentImpl::DeallocPIPCBlobInputStreamParent(PIPCBlobInputStreamParent* aActor)
{
AssertIsInMainProcess();
AssertIsOnBackgroundThread();
MOZ_ASSERT(aActor);
delete aActor;
return true;
}
mozilla::ipc::IPCResult
BackgroundParentImpl::RecvPBlobConstructor(PBlobParent* aActor,
const BlobConstructorParams& aParams)

Просмотреть файл

@ -75,13 +75,6 @@ protected:
virtual bool
DeallocPMemoryStreamParent(PMemoryStreamParent* aActor) override;
virtual PIPCBlobInputStreamParent*
AllocPIPCBlobInputStreamParent(const nsID& aID,
const uint64_t& aSize) override;
virtual bool
DeallocPIPCBlobInputStreamParent(PIPCBlobInputStreamParent* aActor) override;
virtual mozilla::ipc::IPCResult
RecvPBlobConstructor(PBlobParent* aActor,
const BlobConstructorParams& params) override;

Просмотреть файл

@ -15,7 +15,6 @@ include protocol PFileDescriptorSet;
include protocol PFileSystemRequest;
include protocol PGamepadEventChannel;
include protocol PGamepadTestChannel;
include protocol PIPCBlobInputStream;
include protocol PMemoryStream;
include protocol PMessagePort;
include protocol PCameras;
@ -61,7 +60,6 @@ sync protocol PBackground
manages PFileSystemRequest;
manages PGamepadEventChannel;
manages PGamepadTestChannel;
manages PIPCBlobInputStream;
manages PMemoryStream;
manages PMessagePort;
manages PCameras;
@ -122,8 +120,6 @@ child:
async PParentToChildStream();
async PIPCBlobInputStream(nsID aID, uint64_t aSize);
both:
async PBlob(BlobConstructorParams params);