2014-06-11 09:44:03 +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:03 +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_nsIContentParent_h
|
|
|
|
#define mozilla_dom_nsIContentParent_h
|
|
|
|
|
2015-03-19 10:46:40 +03:00
|
|
|
#include "mozilla/Attributes.h"
|
2014-10-24 04:28:00 +04:00
|
|
|
#include "mozilla/dom/ipc/IdType.h"
|
|
|
|
|
2014-06-11 09:44:03 +04:00
|
|
|
#include "nsFrameMessageManager.h"
|
|
|
|
#include "nsISupports.h"
|
2014-10-07 02:45:42 +04:00
|
|
|
#include "mozilla/dom/CPOWManagerGetter.h"
|
2014-06-11 09:44:03 +04:00
|
|
|
|
|
|
|
#define NS_ICONTENTPARENT_IID \
|
|
|
|
{ 0xeeec9ebf, 0x8ecf, 0x4e38, \
|
|
|
|
{ 0x81, 0xda, 0xb7, 0x34, 0x13, 0x7e, 0xac, 0xf3 } }
|
|
|
|
|
|
|
|
class nsFrameMessageManager;
|
|
|
|
|
|
|
|
namespace IPC {
|
|
|
|
class Principal;
|
|
|
|
} // namespace IPC
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
namespace jsipc {
|
|
|
|
class PJavaScriptParent;
|
|
|
|
class CpowEntry;
|
|
|
|
} // namespace jsipc
|
|
|
|
|
|
|
|
namespace dom {
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2015-05-12 15:09:51 +03:00
|
|
|
class Blob;
|
2014-09-27 03:21:57 +04:00
|
|
|
class BlobConstructorParams;
|
2015-05-12 15:11:03 +03:00
|
|
|
class BlobImpl;
|
2014-09-27 03:21:57 +04:00
|
|
|
class BlobParent;
|
2014-09-18 03:36:01 +04:00
|
|
|
class ContentParent;
|
2015-08-31 08:53:00 +03:00
|
|
|
class ContentBridgeParent;
|
2014-09-27 03:21:57 +04:00
|
|
|
class IPCTabContext;
|
|
|
|
class PBlobParent;
|
|
|
|
class PBrowserParent;
|
2014-06-11 09:44:03 +04:00
|
|
|
|
|
|
|
class nsIContentParent : public nsISupports
|
|
|
|
, public mozilla::dom::ipc::MessageManagerCallback
|
2014-10-07 02:45:42 +04:00
|
|
|
, public CPOWManagerGetter
|
2014-06-11 09:44:03 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTPARENT_IID)
|
|
|
|
|
|
|
|
nsIContentParent();
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2015-05-12 15:09:51 +03:00
|
|
|
BlobParent* GetOrCreateActorForBlob(Blob* aBlob);
|
2015-05-12 15:11:03 +03:00
|
|
|
BlobParent* GetOrCreateActorForBlobImpl(BlobImpl* aImpl);
|
2014-06-11 09:44:03 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual ContentParentId ChildID() const = 0;
|
|
|
|
virtual bool IsForApp() const = 0;
|
|
|
|
virtual bool IsForBrowser() const = 0;
|
|
|
|
|
|
|
|
MOZ_WARN_UNUSED_RESULT virtual PBlobParent*
|
|
|
|
SendPBlobConstructor(PBlobParent* aActor,
|
|
|
|
const BlobConstructorParams& aParams) = 0;
|
|
|
|
|
|
|
|
MOZ_WARN_UNUSED_RESULT virtual PBrowserParent*
|
|
|
|
SendPBrowserConstructor(PBrowserParent* actor,
|
|
|
|
const TabId& aTabId,
|
|
|
|
const IPCTabContext& context,
|
|
|
|
const uint32_t& chromeFlags,
|
|
|
|
const ContentParentId& aCpId,
|
|
|
|
const bool& aIsForApp,
|
|
|
|
const bool& aIsForBrowser) = 0;
|
|
|
|
|
|
|
|
virtual bool IsContentParent() const { return false; }
|
|
|
|
|
2014-06-11 09:44:03 +04:00
|
|
|
ContentParent* AsContentParent();
|
2016-01-05 12:59:30 +03:00
|
|
|
|
|
|
|
virtual bool IsContentBridgeParent() const { return false; }
|
|
|
|
|
2015-08-31 08:53:00 +03:00
|
|
|
ContentBridgeParent* AsContentBridgeParent();
|
2014-06-11 09:44:03 +04:00
|
|
|
|
2014-06-11 09:44:13 +04:00
|
|
|
protected: // methods
|
|
|
|
bool CanOpenBrowser(const IPCTabContext& aContext);
|
|
|
|
|
2014-06-11 09:44:03 +04:00
|
|
|
protected: // IPDL methods
|
|
|
|
virtual mozilla::jsipc::PJavaScriptParent* AllocPJavaScriptParent();
|
|
|
|
virtual bool DeallocPJavaScriptParent(mozilla::jsipc::PJavaScriptParent*);
|
|
|
|
|
2014-10-29 21:11:00 +03:00
|
|
|
virtual PBrowserParent* AllocPBrowserParent(const TabId& aTabId,
|
|
|
|
const IPCTabContext& aContext,
|
2014-06-11 09:44:03 +04:00
|
|
|
const uint32_t& aChromeFlags,
|
2014-10-24 04:28:00 +04:00
|
|
|
const ContentParentId& aCpId,
|
2014-06-11 09:44:03 +04:00
|
|
|
const bool& aIsForApp,
|
|
|
|
const bool& aIsForBrowser);
|
|
|
|
virtual bool DeallocPBrowserParent(PBrowserParent* frame);
|
|
|
|
|
|
|
|
virtual PBlobParent* AllocPBlobParent(const BlobConstructorParams& aParams);
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
virtual bool DeallocPBlobParent(PBlobParent* aActor);
|
2014-06-11 09:44:03 +04:00
|
|
|
|
|
|
|
virtual bool RecvSyncMessage(const nsString& aMsg,
|
|
|
|
const ClonedMessageData& aData,
|
2015-01-16 22:58:52 +03:00
|
|
|
InfallibleTArray<jsipc::CpowEntry>&& aCpows,
|
2014-06-11 09:44:03 +04:00
|
|
|
const IPC::Principal& aPrincipal,
|
2015-09-10 23:50:58 +03:00
|
|
|
nsTArray<ipc::StructuredCloneData>* aRetvals);
|
2014-10-08 08:32:45 +04:00
|
|
|
virtual bool RecvRpcMessage(const nsString& aMsg,
|
|
|
|
const ClonedMessageData& aData,
|
2015-01-16 22:58:52 +03:00
|
|
|
InfallibleTArray<jsipc::CpowEntry>&& aCpows,
|
2014-10-08 08:32:45 +04:00
|
|
|
const IPC::Principal& aPrincipal,
|
2015-09-10 23:50:58 +03:00
|
|
|
nsTArray<ipc::StructuredCloneData>* aRetvals);
|
2014-06-11 09:44:03 +04:00
|
|
|
virtual bool RecvAsyncMessage(const nsString& aMsg,
|
2015-01-16 22:58:52 +03:00
|
|
|
InfallibleTArray<jsipc::CpowEntry>&& aCpows,
|
2016-04-09 16:50:59 +03:00
|
|
|
const IPC::Principal& aPrincipal,
|
|
|
|
const ClonedMessageData& aData);
|
2014-06-11 09:44:03 +04:00
|
|
|
|
|
|
|
protected: // members
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsFrameMessageManager> mMessageManager;
|
2014-06-11 09:44:03 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentParent, NS_ICONTENTPARENT_IID)
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif /* mozilla_dom_nsIContentParent_h */
|