gecko-dev/dom/canvas/WebGLChild.h
David Parks 744a8b7f58 Bug 1635956: Part 3 - Implement Shmem functionality in WebGL ProducerConsumerQueue r=jgilbert
Implements LookupSharedMemory and AllocShmem in ProducerConsumerQueue (and fixes a few minor build issues).  To be used in construction of a ProducerConsumerQueue, an actor has to subclass IPcqActor.

Differential Revision: https://phabricator.services.mozilla.com/D74974
2020-06-02 06:18:52 +00:00

50 lines
1.4 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 WEBGLCHILD_H_
#define WEBGLCHILD_H_
#include <string>
#include "mozilla/dom/PWebGLChild.h"
#include "mozilla/dom/IpdlQueue.h"
namespace mozilla {
class ClientWebGLContext;
namespace dom {
class WebGLChild final : public PWebGLChild,
public SyncProducerActor<WebGLChild>,
public AsyncConsumerActor<WebGLChild>,
public SupportsWeakPtr<WebGLChild>,
public mozilla::webgl::PcqActor {
public:
MOZ_DECLARE_WEAKREFERENCE_TYPENAME(WebGLChild)
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WebGLChild, override);
using OtherSideActor = WebGLParent;
ClientWebGLContext& mContext;
explicit WebGLChild(ClientWebGLContext&);
// For SyncProducerActor:
static IpdlQueueProtocol GetIpdlQueueProtocol(size_t aCmd, ...);
private:
friend PWebGLChild;
virtual ~WebGLChild();
public:
mozilla::ipc::IPCResult RecvJsWarning(const std::string&) const;
mozilla::ipc::IPCResult RecvOnContextLoss(webgl::ContextLossReason) const;
};
} // namespace dom
} // namespace mozilla
#endif // WEBGLCHILD_H_