2014-06-11 09:44:06 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2015-05-03 22:32:37 +03:00
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2014-06-11 09:44:06 +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_dom_nsIContentChild_h
|
|
|
|
#define mozilla_dom_nsIContentChild_h
|
|
|
|
|
2014-10-24 04:28:00 +04:00
|
|
|
#include "mozilla/dom/ipc/IdType.h"
|
|
|
|
|
2014-06-11 09:44:06 +04:00
|
|
|
#include "nsISupports.h"
|
2014-09-27 03:21:57 +04:00
|
|
|
#include "nsTArrayForwardDeclare.h"
|
2014-10-07 02:45:42 +04:00
|
|
|
#include "mozilla/dom/CPOWManagerGetter.h"
|
2016-06-15 19:57:46 +03:00
|
|
|
#include "mozilla/ipc/Shmem.h"
|
2015-07-31 10:25:14 +03:00
|
|
|
#include "mozilla/jsipc/CrossProcessObjectWrappers.h"
|
2014-06-11 09:44:06 +04:00
|
|
|
|
|
|
|
#define NS_ICONTENTCHILD_IID \
|
|
|
|
{ 0x4eed2e73, 0x94ba, 0x48a8, \
|
|
|
|
{ 0xa2, 0xd1, 0xa5, 0xed, 0x86, 0xd7, 0xbb, 0xe4 } }
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
class nsString;
|
2014-06-11 09:44:06 +04:00
|
|
|
|
|
|
|
namespace IPC {
|
|
|
|
class Principal;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace IPC
|
2014-06-11 09:44:06 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
2016-06-15 19:57:46 +03:00
|
|
|
namespace ipc {
|
2016-09-21 13:27:26 +03:00
|
|
|
class FileDescriptor;
|
|
|
|
class PFileDescriptorSetChild;
|
2017-03-14 14:28:58 +03:00
|
|
|
class PChildToParentStreamChild;
|
2017-03-14 14:29:43 +03:00
|
|
|
class PParentToChildStreamChild;
|
2016-06-15 19:57:46 +03:00
|
|
|
class Shmem;
|
|
|
|
} // namespace ipc
|
2014-06-11 09:44:06 +04:00
|
|
|
|
|
|
|
namespace jsipc {
|
|
|
|
class PJavaScriptChild;
|
|
|
|
class CpowEntry;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace jsipc
|
2014-06-11 09:44:06 +04:00
|
|
|
|
|
|
|
namespace dom {
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2015-05-12 15:09:51 +03:00
|
|
|
class Blob;
|
2015-05-12 15:11:03 +03:00
|
|
|
class BlobImpl;
|
2014-09-27 03:21:57 +04:00
|
|
|
class BlobConstructorParams;
|
|
|
|
class ClonedMessageData;
|
2014-06-19 04:57:51 +04:00
|
|
|
class IPCTabContext;
|
2014-09-27 03:21:57 +04:00
|
|
|
class PBrowserChild;
|
2014-06-11 09:44:06 +04:00
|
|
|
|
|
|
|
class nsIContentChild : public nsISupports
|
2014-10-07 02:45:42 +04:00
|
|
|
, public CPOWManagerGetter
|
2016-06-15 19:57:46 +03:00
|
|
|
, public mozilla::ipc::IShmemAllocator
|
2014-06-11 09:44:06 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTCHILD_IID)
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
SendPBrowserConstructor(PBrowserChild* aActor,
|
2014-10-29 21:11:00 +03:00
|
|
|
const TabId& aTabId,
|
2017-04-07 02:46:18 +03:00
|
|
|
const TabId& aSameTabGroupAs,
|
2014-06-11 09:44:06 +04:00
|
|
|
const IPCTabContext& aContext,
|
|
|
|
const uint32_t& aChromeFlags,
|
2014-10-24 04:28:00 +04:00
|
|
|
const ContentParentId& aCpID,
|
2014-06-11 09:44:06 +04:00
|
|
|
const bool& aIsForBrowser) = 0;
|
2016-06-15 19:57:46 +03:00
|
|
|
|
2016-09-21 13:27:26 +03:00
|
|
|
virtual mozilla::ipc::PFileDescriptorSetChild*
|
|
|
|
SendPFileDescriptorSetConstructor(const mozilla::ipc::FileDescriptor&) = 0;
|
|
|
|
|
2017-03-14 14:28:58 +03:00
|
|
|
virtual mozilla::ipc::PChildToParentStreamChild*
|
|
|
|
SendPChildToParentStreamConstructor(mozilla::ipc::PChildToParentStreamChild*) = 0;
|
2016-09-21 13:27:26 +03:00
|
|
|
|
2017-05-02 12:57:51 +03:00
|
|
|
virtual already_AddRefed<nsIEventTarget>
|
|
|
|
GetEventTargetFor(TabChild* aTabChild) = 0;
|
|
|
|
|
2014-06-11 09:44:06 +04:00
|
|
|
protected:
|
|
|
|
virtual jsipc::PJavaScriptChild* AllocPJavaScriptChild();
|
|
|
|
virtual bool DeallocPJavaScriptChild(jsipc::PJavaScriptChild*);
|
|
|
|
|
2014-10-29 21:11:00 +03:00
|
|
|
virtual PBrowserChild* AllocPBrowserChild(const TabId& aTabId,
|
2017-04-07 02:46:18 +03:00
|
|
|
const TabId& aSameTabGroupAs,
|
2014-10-29 21:11:00 +03:00
|
|
|
const IPCTabContext& aContext,
|
2014-06-11 09:44:06 +04:00
|
|
|
const uint32_t& aChromeFlags,
|
2014-10-24 04:28:00 +04:00
|
|
|
const ContentParentId& aCpId,
|
2014-06-11 09:44:06 +04:00
|
|
|
const bool& aIsForBrowser);
|
|
|
|
virtual bool DeallocPBrowserChild(PBrowserChild*);
|
|
|
|
|
2016-12-01 06:16:28 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvPBrowserConstructor(PBrowserChild* aActor,
|
|
|
|
const TabId& aTabId,
|
2017-04-07 02:46:18 +03:00
|
|
|
const TabId& aSameTabGroupAs,
|
2016-12-01 06:16:28 +03:00
|
|
|
const IPCTabContext& aContext,
|
|
|
|
const uint32_t& aChromeFlags,
|
|
|
|
const ContentParentId& aCpID,
|
|
|
|
const bool& aIsForBrowse);
|
|
|
|
|
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 mozilla::ipc::PIPCBlobInputStreamChild*
|
|
|
|
AllocPIPCBlobInputStreamChild(const nsID& aID, const uint64_t& aSize);
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPIPCBlobInputStreamChild(mozilla::ipc::PIPCBlobInputStreamChild* aActor);
|
|
|
|
|
2017-03-14 14:28:58 +03:00
|
|
|
virtual mozilla::ipc::PChildToParentStreamChild* AllocPChildToParentStreamChild();
|
2016-09-21 13:27:26 +03:00
|
|
|
|
2017-03-14 14:28:58 +03:00
|
|
|
virtual bool
|
|
|
|
DeallocPChildToParentStreamChild(mozilla::ipc::PChildToParentStreamChild* aActor);
|
2016-09-21 13:27:26 +03:00
|
|
|
|
2017-03-14 14:29:43 +03:00
|
|
|
virtual mozilla::ipc::PParentToChildStreamChild* AllocPParentToChildStreamChild();
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPParentToChildStreamChild(mozilla::ipc::PParentToChildStreamChild* aActor);
|
|
|
|
|
2016-09-21 13:27:26 +03:00
|
|
|
virtual mozilla::ipc::PFileDescriptorSetChild*
|
|
|
|
AllocPFileDescriptorSetChild(const mozilla::ipc::FileDescriptor& aFD);
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPFileDescriptorSetChild(mozilla::ipc::PFileDescriptorSetChild* aActor);
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvAsyncMessage(const nsString& aMsg,
|
|
|
|
InfallibleTArray<jsipc::CpowEntry>&& aCpows,
|
|
|
|
const IPC::Principal& aPrincipal,
|
|
|
|
const ClonedMessageData& aData);
|
2017-05-02 12:57:51 +03:00
|
|
|
|
|
|
|
static already_AddRefed<nsIEventTarget> GetConstructedEventTarget(const IPC::Message& aMsg);
|
2014-06-11 09:44:06 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentChild, NS_ICONTENTCHILD_IID)
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2014-06-11 09:44:06 +04:00
|
|
|
#endif /* mozilla_dom_nsIContentChild_h */
|