gecko-dev/dom/canvas/PWebGL.ipdl
David Parks cbf4e1a5cc Bug 1621762: Part 7 - Add IpdlQueue actor traits to WebGLParent/WebGLChild r=jgilbert,jld
Adds IpdlQueue capability to PWebGL actors.  The WebGLChild, used in content processes, implements SyncProducerActor and AsyncConsumerActor because it sends (sync and async) messages and receives responses to them that it reads as async messages.  The WebGLParent, used in the compositor process, is a SyncConsumerActor and AsyncProducerActor for dual reasons.

Differential Revision: https://phabricator.services.mozilla.com/D68264
2020-04-30 22:24:44 +00:00

58 lines
2.0 KiB
Plaintext

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: sw=2 ts=8 et :
*/
/* 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 PCompositorBridge;
include protocol PLayerTransaction;
using mozilla::layers::CompositableHandle from "mozilla/layers/LayersTypes.h";
using mozilla::webgl::ContextLossReason from "mozilla/dom/WebGLIpdl.h";
using std::string from "ipc/IPCMessageUtils.h";
using mozilla::webgl::InitContextDesc from "mozilla/dom/WebGLIpdl.h";
using mozilla::webgl::InitContextResult from "mozilla/dom/WebGLIpdl.h";
using mozilla::HostWebGLCommandSinkP from "mozilla/dom/WebGLCrossProcessCommandQueue.h";
using mozilla::HostWebGLCommandSinkI from "mozilla/dom/WebGLCrossProcessCommandQueue.h";
using mozilla::dom::IpdlQueueBuffer from "mozilla/dom/IpdlQueue.h";
using mozilla::dom::IpdlQueueBuffers from "mozilla/dom/IpdlQueue.h";
namespace mozilla {
namespace dom {
/**
* Represents the connection between a WebGLChild actor that issues WebGL
* command from the content process, and a WebGLParent in the compositor
* process that runs the commands.
*/
sync refcounted protocol PWebGL
{
manager PCompositorBridge;
parent:
sync Initialize(InitContextDesc desc, UniquePtr<HostWebGLCommandSinkP> sinkP,
UniquePtr<HostWebGLCommandSinkI> sinkI)
returns (InitContextResult res);
async __delete__();
// DLP: TODO: Does this need to be sync?
sync UpdateCompositableHandle(PLayerTransaction aLayerTrans,
CompositableHandle aHandle);
sync ExchangeIpdlQueueData(IpdlQueueBuffer aMsg) returns (IpdlQueueBuffers aResponse);
child:
async JsWarning(string text);
// Tell client that this queue needs to be shut down
async OnContextLoss(ContextLossReason aReason);
both:
async TransmitIpdlQueueData(IpdlQueueBuffer aData);
};
} // dom
} // mozilla