//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef PImageBridgeParent_h
#define PImageBridgeParent_h

#include "mozilla/layers/PImageBridge.h"
#ifdef DEBUG
#include "prenv.h"
#endif  // DEBUG

#include "mozilla/Tainting.h"
#include "mozilla/ipc/MessageChannel.h"
#include "mozilla/ipc/ProtocolUtils.h"
class nsIFile;

// Headers for things that cannot be forward declared
#include "ImageContainer.h"
#include "ImageTypes.h"
#include "NonCustomCSSPropertyId.h"
#include "Units.h"
#include "gfxPoint.h"
#include "gfxTypes.h"
#include "mozilla/HalIPCUtils.h"
#include "mozilla/ServoStyleConsts.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/WidgetUtils.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/FileHandleWrapper.h"
#include "mozilla/gfx/Matrix.h"
#include "mozilla/gfx/Point.h"
#include "mozilla/gfx/Rect.h"
#include "mozilla/gfx/Types.h"
#include "mozilla/ipc/CrossProcessSemaphore.h"
#include "mozilla/ipc/IPCTypes.h"
#include "mozilla/ipc/ProtocolUtils.h"
#include "mozilla/ipc/SharedMemoryHandle.h"
#include "mozilla/layers/CompositorTypes.h"
#include "mozilla/layers/GpuFence.h"
#include "mozilla/layers/LayersTypes.h"
#include "mozilla/layers/ScrollableLayerGuid.h"
#include "mozilla/layers/VideoBridgeUtils.h"
#include "mozilla/webrender/WebRenderTypes.h"
#include "nsColor.h"
#include "nsCoord.h"
#include "nsRegion.h"

namespace mozilla {
namespace layers {
class PTextureParent;
} // namespace layers
} // namespace mozilla
namespace mozilla {
namespace layers {
class PTextureChild;
} // namespace layers
} // namespace mozilla

namespace mozilla {
namespace media {
class PMediaSystemResourceManagerParent;
} // namespace media
} // namespace mozilla
namespace mozilla {
namespace media {
class PMediaSystemResourceManagerChild;
} // namespace media
} // namespace mozilla

namespace mozilla {
namespace layers {
class PTextureParent;
} // namespace layers
} // namespace mozilla

namespace mozilla {
namespace media {
class PMediaSystemResourceManagerParent;
} // namespace media
} // namespace mozilla

namespace mozilla {
struct null_t;
} // namespace mozilla

namespace mozilla {
namespace gfx {
struct DeviceColor;
} // namespace gfx
} // namespace mozilla

struct nsRect;

struct nsPoint;

namespace mozilla {
class TimeStamp;
} // namespace mozilla

namespace mozilla {
namespace layers {
struct TextureInfo;
} // namespace layers
} // namespace mozilla

namespace mozilla {
struct void_t;
} // namespace mozilla

struct nsID;

namespace mozilla {
namespace layers {
struct TextureInfo;
} // namespace layers
} // namespace mozilla

namespace mozilla {
namespace layers {


class PImageBridgeParent :
    public mozilla::ipc::IToplevelProtocol
{
private:
    friend class ::mozilla::layers::PTextureParent;
    friend class ::mozilla::media::PMediaSystemResourceManagerParent;
public:
    static constexpr ::mozilla::ipc::ProtocolId kProtocolId = PImageBridgeMsgStart;
protected:
    typedef mozilla::ipc::ActorId ActorId;
    typedef ::mozilla::layers::Animatable Animatable;
    typedef ::mozilla::layers::Animation Animation;
    typedef ::mozilla::layers::AnimationSegment AnimationSegment;
    typedef ::mozilla::layers::AsyncParentMessageData AsyncParentMessageData;
    typedef ::mozilla::layers::BufferDescriptor BufferDescriptor;
    typedef ::mozilla::ipc::ByteBuf ByteBuf;
    typedef ::mozilla::CSSCoord CSSCoord;
    typedef ::mozilla::CSSPoint CSSPoint;
    typedef ::mozilla::CSSRect CSSRect;
    typedef ::mozilla::gfx::ChromaSubsampling ChromaSubsampling;
    typedef ::mozilla::layers::ClearImagesType ClearImagesType;
    typedef ::mozilla::gfx::ColorDepth ColorDepth;
    typedef ::mozilla::gfx::ColorRange ColorRange;
    typedef ::mozilla::gfx::ColorSpace2 ColorSpace2;
    typedef ::mozilla::layers::CompositableHandle CompositableHandle;
    typedef ::mozilla::layers::CompositableOperation CompositableOperation;
    typedef ::mozilla::layers::CompositableOperationDetail CompositableOperationDetail;
    typedef ::mozilla::layers::CompositeProcessFencesHolderId CompositeProcessFencesHolderId;
    typedef ::mozilla::layers::CompositionPayload CompositionPayload;
    typedef ::mozilla::layers::CompositorAnimations CompositorAnimations;
    typedef ::mozilla::layers::CrossProcessSemaphoreDescriptor CrossProcessSemaphoreDescriptor;
    typedef ::mozilla::CrossProcessSemaphoreHandle CrossProcessSemaphoreHandle;
    typedef ::mozilla::gfx::DeviceColor DeviceColor;
    typedef ::mozilla::layers::DiagnosticTypes DiagnosticTypes;
    typedef ::mozilla::layers::EGLImageDescriptor EGLImageDescriptor;
    template<class FooSide> using Endpoint = mozilla::ipc::Endpoint<FooSide>;
    typedef ::mozilla::layers::EventRegionsOverride EventRegionsOverride;
    typedef ::mozilla::wr::ExternalImageId ExternalImageId;
    typedef ::mozilla::wr::ExternalImageSource ExternalImageSource;
    typedef ::mozilla::ipc::FileDescriptor FileDescriptor;
    typedef ::mozilla::gfx::FileHandleWrapper FileHandleWrapper;
    typedef ::mozilla::gfx::Glyph Glyph;
    typedef ::mozilla::layers::GpuFence GpuFence;
    typedef ::mozilla::layers::GpuProcessTextureId GpuProcessTextureId;
    typedef ::mozilla::layers::ImageCompositeNotification ImageCompositeNotification;
    typedef ::mozilla::gfx::IntPoint IntPoint;
    typedef ::mozilla::gfx::IntRect IntRect;
    typedef ::mozilla::gfx::IntSize IntSize;
    typedef ::mozilla::layers::LayerColor LayerColor;
    typedef ::mozilla::LayerCoord LayerCoord;
    typedef ::mozilla::layers::LayerHandle LayerHandle;
    typedef ::mozilla::LayerIntRect LayerIntRect;
    typedef ::mozilla::LayerIntRegion LayerIntRegion;
    typedef ::mozilla::LayerIntSize LayerIntSize;
    typedef ::mozilla::LayerMargin LayerMargin;
    typedef ::mozilla::LayerPoint LayerPoint;
    typedef ::mozilla::LayerRect LayerRect;
    typedef ::mozilla::LayerSize LayerSize;
    typedef ::mozilla::layers::LayersBackend LayersBackend;
    typedef ::mozilla::layers::LayersId LayersId;
    typedef ::mozilla::LayoutDeviceIntRect LayoutDeviceIntRect;
    typedef ::mozilla::LayoutDevicePoint LayoutDevicePoint;
    typedef ::mozilla::LayoutDeviceRect LayoutDeviceRect;
    typedef ::mozilla::LengthPercentage LengthPercentage;
    template<class FooSide> using ManagedEndpoint = mozilla::ipc::ManagedEndpoint<FooSide>;
    typedef ::mozilla::gfx::Matrix4x4 Matrix4x4;
    typedef ::mozilla::wr::MaybeExternalImageId MaybeExternalImageId;
    typedef ::mozilla::layers::MaybeVideoBridgeSource MaybeVideoBridgeSource;
    typedef ::mozilla::layers::MemoryOrShmem MemoryOrShmem;
    typedef ::mozilla::layers::MotionPathData MotionPathData;
    typedef ::NonCustomCSSPropertyId NonCustomCSSPropertyId;
    typedef ::mozilla::layers::OMTAValue OMTAValue;
    typedef ::mozilla::layers::OpAttachAsyncCompositable OpAttachAsyncCompositable;
    typedef ::mozilla::layers::OpAttachCompositable OpAttachCompositable;
    typedef ::mozilla::layers::OpClearImages OpClearImages;
    typedef ::mozilla::layers::OpContentBufferSwap OpContentBufferSwap;
    typedef ::mozilla::layers::OpDestroy OpDestroy;
    typedef ::mozilla::layers::OpEnableRemoteTexturePushCallback OpEnableRemoteTexturePushCallback;
    typedef ::mozilla::layers::OpNotifyNotUsed OpNotifyNotUsed;
    typedef ::mozilla::layers::OpRemoveTexture OpRemoveTexture;
    typedef ::mozilla::layers::OpUseRemoteTexture OpUseRemoteTexture;
    typedef ::mozilla::layers::OpUseTexture OpUseTexture;
    typedef ::mozilla::media::PMediaSystemResourceManagerChild PMediaSystemResourceManagerChild;
    typedef ::mozilla::media::PMediaSystemResourceManagerParent PMediaSystemResourceManagerParent;
    typedef ::mozilla::layers::PTextureChild PTextureChild;
    typedef ::mozilla::layers::PTextureParent PTextureParent;
    typedef ::mozilla::ParentLayerIntRect ParentLayerIntRect;
    typedef ::mozilla::ParentLayerRect ParentLayerRect;
    typedef ::mozilla::layers::PartialPrerenderData PartialPrerenderData;
    typedef ::mozilla::gfx::Point Point;
    typedef ::mozilla::gfx::Point3D Point3D;
    typedef base::ProcessId ProcessId;
    typedef ::mozilla::ipc::ProtocolFdMapping ProtocolFdMapping;
    typedef mozilla::ipc::ProtocolId ProtocolId;
    typedef ::mozilla::layers::RGBDescriptor RGBDescriptor;
    typedef ::mozilla::layers::ReadLockDescriptor ReadLockDescriptor;
    typedef ::mozilla::ipc::ReadOnlySharedMemoryHandle ReadOnlySharedMemoryHandle;
    typedef ::mozilla::layers::RemoteDecoderVideoSubDescriptor RemoteDecoderVideoSubDescriptor;
    typedef ::mozilla::layers::RemoteTextureId RemoteTextureId;
    typedef ::mozilla::layers::RemoteTextureOwnerId RemoteTextureOwnerId;
    typedef mozilla::ipc::ResponseRejectReason ResponseRejectReason;
    typedef ::mozilla::gfx::SamplingFilter SamplingFilter;
    typedef ::mozilla::layers::ScaleMode ScaleMode;
    typedef ::mozilla::hal::ScreenOrientation ScreenOrientation;
    typedef ::mozilla::ScreenRotation ScreenRotation;
    typedef ::mozilla::layers::ScrollDirection ScrollDirection;
    typedef ::mozilla::layers::ScrollTimelineOptions ScrollTimelineOptions;
    typedef ::mozilla::ipc::Shmem Shmem;
    typedef ::mozilla::SideBits SideBits;
    typedef ::mozilla::StereoMode StereoMode;
    typedef ::mozilla::StyleComputedTimingFunction StyleComputedTimingFunction;
    typedef ::mozilla::StyleOffsetPath StyleOffsetPath;
    typedef ::mozilla::StyleOffsetPosition StyleOffsetPosition;
    typedef ::mozilla::StyleOffsetRotate StyleOffsetRotate;
    typedef ::mozilla::StylePositionOrAuto StylePositionOrAuto;
    typedef ::mozilla::StyleRotate StyleRotate;
    typedef ::mozilla::StyleScale StyleScale;
    typedef ::mozilla::StyleTransform StyleTransform;
    typedef ::mozilla::StyleTranslate StyleTranslate;
    typedef ::mozilla::layers::SurfaceDescriptor SurfaceDescriptor;
    typedef ::mozilla::layers::SurfaceDescriptorAndroidHardwareBuffer SurfaceDescriptorAndroidHardwareBuffer;
    typedef ::mozilla::layers::SurfaceDescriptorBuffer SurfaceDescriptorBuffer;
    typedef ::mozilla::layers::SurfaceDescriptorCanvasSurface SurfaceDescriptorCanvasSurface;
    typedef ::mozilla::layers::SurfaceDescriptorD3D10 SurfaceDescriptorD3D10;
    typedef ::mozilla::layers::SurfaceDescriptorDMABuf SurfaceDescriptorDMABuf;
    typedef ::mozilla::layers::SurfaceDescriptorDXGIYCbCr SurfaceDescriptorDXGIYCbCr;
    typedef ::mozilla::layers::SurfaceDescriptorDcompSurface SurfaceDescriptorDcompSurface;
    typedef ::mozilla::layers::SurfaceDescriptorExternalImage SurfaceDescriptorExternalImage;
    typedef ::mozilla::layers::SurfaceDescriptorGPUVideo SurfaceDescriptorGPUVideo;
    typedef ::mozilla::layers::SurfaceDescriptorMacIOSurface SurfaceDescriptorMacIOSurface;
    typedef ::mozilla::layers::SurfaceDescriptorRemoteDecoder SurfaceDescriptorRemoteDecoder;
    typedef ::mozilla::layers::SurfaceDescriptorRemoteDecoderId SurfaceDescriptorRemoteDecoderId;
    typedef ::mozilla::layers::SurfaceDescriptorRemoteTexture SurfaceDescriptorRemoteTexture;
    typedef ::mozilla::layers::SurfaceDescriptorShared SurfaceDescriptorShared;
    typedef ::mozilla::layers::SurfaceDescriptorSharedGLTexture SurfaceDescriptorSharedGLTexture;
    typedef ::mozilla::gfx::SurfaceFormat SurfaceFormat;
    typedef ::mozilla::layers::SurfaceTextureDescriptor SurfaceTextureDescriptor;
    typedef ::mozilla::layers::TargetConfig TargetConfig;
    typedef ::mozilla::layers::TextureFlags TextureFlags;
    typedef ::mozilla::layers::TextureInfo TextureInfo;
    typedef ::mozilla::TimeDuration TimeDuration;
    typedef ::mozilla::TimeStamp TimeStamp;
    typedef ::mozilla::layers::TimedTexture TimedTexture;
    typedef ::mozilla::layers::TransactionId TransactionId;
    typedef ::mozilla::gfx::TransferFunction TransferFunction;
    typedef ::mozilla::layers::TransformData TransformData;
    template<class T> using UniquePtr = mozilla::UniquePtr<T>;
    typedef ::mozilla::layers::UntrustedShmemSection UntrustedShmemSection;
    typedef ::mozilla::layers::ScrollableLayerGuid::ViewID ViewID;
    typedef ::mozilla::WindowsHandle WindowsHandle;
    typedef ::mozilla::layers::YCbCrDescriptor YCbCrDescriptor;
    typedef ::mozilla::gfx::YUVColorSpace YUVColorSpace;
    typedef ::gfxImageFormat gfxImageFormat;
    typedef ::gfxPoint gfxPoint;
    typedef ::int16_t int16_t;
    typedef ::int32_t int32_t;
    typedef ::int64_t int64_t;
    typedef ::int8_t int8_t;
    typedef ::intptr_t intptr_t;
    typedef ::nsCString nsCString;
    typedef ::nsID nsID;
    typedef ::nsIntRegion nsIntRegion;
    typedef ::nsPoint nsPoint;
    typedef ::nsRect nsRect;
    typedef ::nsString nsString;
    typedef ::nscolor nscolor;
    typedef ::nscoord nscoord;
    typedef ::nsresult nsresult;
    typedef ::mozilla::null_t null_t;
    typedef ::uint16_t uint16_t;
    typedef ::uint32_t uint32_t;
    typedef ::uint64_t uint64_t;
    typedef ::uint8_t uint8_t;
    typedef ::uintptr_t uintptr_t;
    typedef ::mozilla::void_t void_t;

protected:
    virtual mozilla::ipc::IPCResult
    RecvPTextureConstructor(
            PTextureParent* actor,
            const SurfaceDescriptor& aSharedData,
            ReadLockDescriptor&& aReadLock,
            const LayersBackend& aBackend,
            const TextureFlags& aTextureFlags,
            const uint64_t& aSerial,
            const MaybeExternalImageId& aExternalImageId);
    virtual mozilla::ipc::IPCResult
    RecvPMediaSystemResourceManagerConstructor(PMediaSystemResourceManagerParent* actor);
    void
    ProcessingError(
            Result aCode,
            const char* aReason) override;
    bool
    ShouldContinueFromReplyTimeout() override;

public:
    typedef mozilla::ipc::IProtocol IProtocol;
    typedef IPC::Message Message;
    typedef base::ProcessHandle ProcessHandle;
    typedef mozilla::ipc::MessageChannel MessageChannel;

public:
    MOZ_IMPLICIT PImageBridgeParent();

    virtual ~PImageBridgeParent();

protected:
    void
    ActorAlloc() final;
    void
    ActorDealloc() final;
public:
    ::base::ProcessId
    OtherPid() const;
    ::GeckoChildID
    OtherChildID() const;
    ::mozilla::ipc::EndpointProcInfo
    OtherEndpointProcInfo() const;

    void
    ManagedPTextureParent(nsTArray<PTextureParent*>& aArr) const;
    const ManagedContainer<PTextureParent>&
    ManagedPTextureParent() const;

    void
    ManagedPMediaSystemResourceManagerParent(nsTArray<PMediaSystemResourceManagerParent*>& aArr) const;
    const ManagedContainer<PMediaSystemResourceManagerParent>&
    ManagedPMediaSystemResourceManagerParent() const;

    mozilla::Span<mozilla::ipc::ProtocolId const>
    ManagedProtocolIds() const final;

    UntypedManagedContainer*
    GetManagedActors(mozilla::ipc::ProtocolId aProtocol) final;

    ManagedEndpoint<PTextureChild>
    OpenPTextureEndpoint(PTextureParent* aActor);
    bool
    BindPTextureEndpoint(
            ManagedEndpoint<PTextureParent> aEndpoint,
            PTextureParent* aActor);

    ManagedEndpoint<PMediaSystemResourceManagerChild>
    OpenPMediaSystemResourceManagerEndpoint(PMediaSystemResourceManagerParent* aActor);
    bool
    BindPMediaSystemResourceManagerEndpoint(
            ManagedEndpoint<PMediaSystemResourceManagerParent> aEndpoint,
            PMediaSystemResourceManagerParent* aActor);

    [[nodiscard]] bool
    SendParentAsyncMessages(mozilla::Span<AsyncParentMessageData const> aMessages);

    [[nodiscard]] bool
    SendDidComposite(mozilla::Span<ImageCompositeNotification const> aNotifications);

    [[nodiscard]] bool
    SendReportFramesDropped(
            const CompositableHandle& aHandle,
            const uint32_t& aFrames);

    void
    DeallocManagee(
            mozilla::ipc::ProtocolId aProtocolId,
            IProtocol* aListener) override;

    Result
    OnMessageReceived(const Message& msg__) override;

    Result
    OnMessageReceived(
            const Message& msg__,
            UniquePtr<Message>& reply__) override;

private:
    ManagedContainer<PTextureParent> mManagedPTextureParent;
    ManagedContainer<PMediaSystemResourceManagerParent> mManagedPMediaSystemResourceManagerParent;
};


} // namespace layers
} // namespace mozilla
namespace IPC {
template<>
struct ParamTraits <::mozilla::layers::PImageBridgeParent*>
{
    typedef ::mozilla::layers::PImageBridgeParent* paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC

#endif // ifndef PImageBridgeParent_h
