2016-05-28 00:54:31 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2013-11-27 11:59:41 +04:00
|
|
|
/* 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_ipc_backgroundparentimpl_h__
|
|
|
|
#define mozilla_ipc_backgroundparentimpl_h__
|
|
|
|
|
|
|
|
#include "mozilla/Attributes.h"
|
|
|
|
#include "mozilla/ipc/PBackgroundParent.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
2015-01-14 02:37:00 +03:00
|
|
|
|
|
|
|
namespace layout {
|
|
|
|
class VsyncParent;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace layout
|
2015-01-14 02:37:00 +03:00
|
|
|
|
2013-11-27 11:59:41 +04:00
|
|
|
namespace ipc {
|
|
|
|
|
|
|
|
// Instances of this class should never be created directly. This class is meant
|
|
|
|
// to be inherited in BackgroundImpl.
|
|
|
|
class BackgroundParentImpl : public PBackgroundParent
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
BackgroundParentImpl();
|
|
|
|
virtual ~BackgroundParentImpl();
|
|
|
|
|
|
|
|
virtual void
|
2015-03-21 19:28:04 +03:00
|
|
|
ActorDestroy(ActorDestroyReason aWhy) override;
|
2013-11-27 11:59:41 +04:00
|
|
|
|
|
|
|
virtual PBackgroundTestParent*
|
2015-03-21 19:28:04 +03:00
|
|
|
AllocPBackgroundTestParent(const nsCString& aTestArg) override;
|
2013-11-27 11:59:41 +04:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult
|
2013-11-27 11:59:41 +04:00
|
|
|
RecvPBackgroundTestConstructor(PBackgroundTestParent* aActor,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsCString& aTestArg) override;
|
2013-11-27 11:59:41 +04:00
|
|
|
|
|
|
|
virtual bool
|
2015-03-21 19:28:04 +03:00
|
|
|
DeallocPBackgroundTestParent(PBackgroundTestParent* aActor) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
virtual PBackgroundIDBFactoryParent*
|
2014-10-16 08:56:52 +04:00
|
|
|
AllocPBackgroundIDBFactoryParent(const LoggingInfo& aLoggingInfo)
|
2015-03-21 19:28:04 +03:00
|
|
|
override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult
|
2014-10-16 08:56:52 +04:00
|
|
|
RecvPBackgroundIDBFactoryConstructor(PBackgroundIDBFactoryParent* aActor,
|
|
|
|
const LoggingInfo& aLoggingInfo)
|
2015-03-21 19:28:04 +03:00
|
|
|
override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPBackgroundIDBFactoryParent(PBackgroundIDBFactoryParent* aActor)
|
2015-03-21 19:28:04 +03:00
|
|
|
override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2015-11-22 12:44:33 +03:00
|
|
|
virtual PBackgroundIndexedDBUtilsParent*
|
|
|
|
AllocPBackgroundIndexedDBUtilsParent() override;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPBackgroundIndexedDBUtilsParent(
|
|
|
|
PBackgroundIndexedDBUtilsParent* aActor)
|
|
|
|
override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult
|
2016-02-10 18:11:25 +03:00
|
|
|
RecvFlushPendingFileDeletions() override;
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
virtual PBlobParent*
|
2015-03-21 19:28:04 +03:00
|
|
|
AllocPBlobParent(const BlobConstructorParams& aParams) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
virtual bool
|
2015-03-21 19:28:04 +03:00
|
|
|
DeallocPBlobParent(PBlobParent* aActor) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2017-03-29 11:40:38 +03:00
|
|
|
virtual PMemoryStreamParent*
|
|
|
|
AllocPMemoryStreamParent(const uint64_t& aSize) override;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPMemoryStreamParent(PMemoryStreamParent* aActor) override;
|
|
|
|
|
Bug 1353629 - PBlob refactoring - part 4 - IPCBlobInputStream, r=smaug
IPCBlobInputStream is a new type of nsIInputStream that is used only in content
process when a Blob is sent from parent to child. This inputStream is for now,
just cloneable.
When the parent process sends a Blob to a content process, it has the Blob and
its inputStream. With its inputStream it creates a IPCBlobInputStreamParent
actor. This actor keeps the inputStream alive for following uses (not part of
this patch).
On the child side we will have, of course, a IPCBlobInputStreamChild actor.
This actor is able to create a IPCBlobInputStream when CreateStream() is
called. This means that 1 IPCBlobInputStreamChild can manage multiple
IPCBlobInputStreams each time one of them is cloned. When the last one of this
stream is released, the child actor sends a __delete__ request to the parent
side; the parent will be deleted, and the original inputStream, on the parent
side, will be released as well.
IPCBlobInputStream is a special inputStream because each method, except for
Available() fails. Basically, this inputStream cannot be used on the content
process for nothing else than knowing the size of the original stream.
In the following patches, I'll introduce an async way to use it.
2017-04-24 13:09:40 +03:00
|
|
|
virtual PIPCBlobInputStreamParent*
|
|
|
|
AllocPIPCBlobInputStreamParent(const nsID& aID,
|
|
|
|
const uint64_t& aSize) override;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPIPCBlobInputStreamParent(PIPCBlobInputStreamParent* aActor) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult
|
2015-11-28 13:48:28 +03:00
|
|
|
RecvPBlobConstructor(PBlobParent* aActor,
|
|
|
|
const BlobConstructorParams& params) override;
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
virtual PFileDescriptorSetParent*
|
|
|
|
AllocPFileDescriptorSetParent(const FileDescriptor& aFileDescriptor)
|
2015-03-21 19:28:04 +03:00
|
|
|
override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPFileDescriptorSetParent(PFileDescriptorSetParent* aActor)
|
2015-03-21 19:28:04 +03:00
|
|
|
override;
|
2015-01-14 02:37:00 +03:00
|
|
|
|
|
|
|
virtual PVsyncParent*
|
2015-03-21 19:28:04 +03:00
|
|
|
AllocPVsyncParent() override;
|
2015-01-14 02:37:00 +03:00
|
|
|
|
|
|
|
virtual bool
|
2015-03-21 19:28:04 +03:00
|
|
|
DeallocPVsyncParent(PVsyncParent* aActor) override;
|
2015-01-15 19:58:40 +03:00
|
|
|
|
|
|
|
virtual PBroadcastChannelParent*
|
|
|
|
AllocPBroadcastChannelParent(const PrincipalInfo& aPrincipalInfo,
|
2015-07-06 21:28:41 +03:00
|
|
|
const nsCString& aOrigin,
|
2016-06-07 14:50:00 +03:00
|
|
|
const nsString& aChannel) override;
|
2015-01-15 19:58:40 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult
|
2015-01-15 19:58:40 +03:00
|
|
|
RecvPBroadcastChannelConstructor(PBroadcastChannelParent* actor,
|
|
|
|
const PrincipalInfo& aPrincipalInfo,
|
2015-07-06 21:28:41 +03:00
|
|
|
const nsCString& origin,
|
2016-06-07 14:50:00 +03:00
|
|
|
const nsString& channel) override;
|
2015-01-15 19:58:40 +03:00
|
|
|
|
|
|
|
virtual bool
|
2015-03-21 19:28:04 +03:00
|
|
|
DeallocPBroadcastChannelParent(PBroadcastChannelParent* aActor) override;
|
2015-02-11 14:53:00 +03:00
|
|
|
|
2017-03-14 14:28:58 +03:00
|
|
|
virtual PChildToParentStreamParent*
|
|
|
|
AllocPChildToParentStreamParent() override;
|
2016-05-15 20:32:09 +03:00
|
|
|
|
|
|
|
virtual bool
|
2017-03-14 14:28:58 +03:00
|
|
|
DeallocPChildToParentStreamParent(PChildToParentStreamParent* aActor) override;
|
2016-05-15 20:32:09 +03:00
|
|
|
|
2017-03-14 14:29:43 +03:00
|
|
|
virtual PParentToChildStreamParent*
|
|
|
|
AllocPParentToChildStreamParent() override;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPParentToChildStreamParent(PParentToChildStreamParent* aActor) override;
|
|
|
|
|
2015-06-04 21:51:57 +03:00
|
|
|
virtual PServiceWorkerManagerParent*
|
|
|
|
AllocPServiceWorkerManagerParent() override;
|
2015-02-11 14:53:00 +03:00
|
|
|
|
|
|
|
virtual bool
|
2015-06-04 21:51:57 +03:00
|
|
|
DeallocPServiceWorkerManagerParent(PServiceWorkerManagerParent* aActor) override;
|
2015-02-11 14:53:00 +03:00
|
|
|
|
2015-08-31 15:51:29 +03:00
|
|
|
virtual PCamerasParent*
|
|
|
|
AllocPCamerasParent() override;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPCamerasParent(PCamerasParent* aActor) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult
|
2015-03-21 19:28:04 +03:00
|
|
|
RecvShutdownServiceWorkerRegistrar() override;
|
2015-03-02 16:20:00 +03:00
|
|
|
|
|
|
|
virtual dom::cache::PCacheStorageParent*
|
|
|
|
AllocPCacheStorageParent(const dom::cache::Namespace& aNamespace,
|
2015-03-21 19:28:04 +03:00
|
|
|
const PrincipalInfo& aPrincipalInfo) override;
|
2015-03-02 16:20:00 +03:00
|
|
|
|
|
|
|
virtual bool
|
2015-03-21 19:28:04 +03:00
|
|
|
DeallocPCacheStorageParent(dom::cache::PCacheStorageParent* aActor) override;
|
2015-03-02 16:20:00 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual dom::cache::PCacheParent* AllocPCacheParent() override;
|
2015-03-02 16:20:00 +03:00
|
|
|
|
|
|
|
virtual bool
|
2015-03-21 19:28:04 +03:00
|
|
|
DeallocPCacheParent(dom::cache::PCacheParent* aActor) override;
|
2015-03-02 16:20:00 +03:00
|
|
|
|
|
|
|
virtual dom::cache::PCacheStreamControlParent*
|
2015-03-21 19:28:04 +03:00
|
|
|
AllocPCacheStreamControlParent() override;
|
2015-03-02 16:20:00 +03:00
|
|
|
|
|
|
|
virtual bool
|
2015-05-29 17:14:14 +03:00
|
|
|
DeallocPCacheStreamControlParent(dom::cache::PCacheStreamControlParent* aActor)
|
|
|
|
override;
|
|
|
|
|
|
|
|
virtual PUDPSocketParent*
|
|
|
|
AllocPUDPSocketParent(const OptionalPrincipalInfo& pInfo,
|
|
|
|
const nsCString& aFilter) override;
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult
|
2015-05-29 17:14:14 +03:00
|
|
|
RecvPUDPSocketConstructor(PUDPSocketParent*,
|
|
|
|
const OptionalPrincipalInfo& aPrincipalInfo,
|
|
|
|
const nsCString& aFilter) override;
|
|
|
|
virtual bool
|
|
|
|
DeallocPUDPSocketParent(PUDPSocketParent*) override;
|
2015-06-17 13:44:27 +03:00
|
|
|
|
|
|
|
virtual PMessagePortParent*
|
|
|
|
AllocPMessagePortParent(const nsID& aUUID,
|
|
|
|
const nsID& aDestinationUUID,
|
|
|
|
const uint32_t& aSequenceID) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult
|
2015-06-17 13:44:27 +03:00
|
|
|
RecvPMessagePortConstructor(PMessagePortParent* aActor,
|
|
|
|
const nsID& aUUID,
|
|
|
|
const nsID& aDestinationUUID,
|
|
|
|
const uint32_t& aSequenceID) override;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPMessagePortParent(PMessagePortParent* aActor) override;
|
2015-06-24 01:50:00 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult
|
2015-06-24 01:50:00 +03:00
|
|
|
RecvMessagePortForceClose(const nsID& aUUID,
|
|
|
|
const nsID& aDestinationUUID,
|
|
|
|
const uint32_t& aSequenceID) override;
|
2015-08-29 08:45:04 +03:00
|
|
|
|
|
|
|
virtual PAsmJSCacheEntryParent*
|
|
|
|
AllocPAsmJSCacheEntryParent(const dom::asmjscache::OpenMode& aOpenMode,
|
|
|
|
const dom::asmjscache::WriteParams& aWriteParams,
|
|
|
|
const PrincipalInfo& aPrincipalInfo) override;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPAsmJSCacheEntryParent(PAsmJSCacheEntryParent* aActor) override;
|
2015-11-22 12:43:55 +03:00
|
|
|
|
|
|
|
virtual PQuotaParent*
|
|
|
|
AllocPQuotaParent() override;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPQuotaParent(PQuotaParent* aActor) override;
|
2016-04-09 21:17:02 +03:00
|
|
|
|
|
|
|
virtual PFileSystemRequestParent*
|
|
|
|
AllocPFileSystemRequestParent(const FileSystemParams&) override;
|
|
|
|
|
2017-03-16 10:53:49 +03:00
|
|
|
virtual mozilla::ipc::IPCResult
|
|
|
|
RecvPFileSystemRequestConstructor(PFileSystemRequestParent* actor,
|
|
|
|
const FileSystemParams& params) override;
|
|
|
|
|
2016-04-09 21:17:02 +03:00
|
|
|
virtual bool
|
|
|
|
DeallocPFileSystemRequestParent(PFileSystemRequestParent*) override;
|
|
|
|
|
2016-06-28 01:25:00 +03:00
|
|
|
// Gamepad API Background IPC
|
|
|
|
virtual PGamepadEventChannelParent*
|
|
|
|
AllocPGamepadEventChannelParent() override;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPGamepadEventChannelParent(PGamepadEventChannelParent *aActor) override;
|
2016-06-28 01:26:00 +03:00
|
|
|
|
|
|
|
virtual PGamepadTestChannelParent*
|
|
|
|
AllocPGamepadTestChannelParent() override;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPGamepadTestChannelParent(PGamepadTestChannelParent* aActor) override;
|
2013-11-27 11:59:41 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace ipc
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_ipc_backgroundparentimpl_h__
|