gfx/ipc/GPUProcessImpl.h
author Sebastian Hengst <archaeopteryx@coole-files.de>
Wed, 02 Nov 2016 16:39:42 +0100
changeset 347209 289db9779bc846cd11adfb3ceedeec9e44899299
parent 335126 daa0763d313fde37533cce0ce21741c2633df84e
child 369865 e9d8a75a0dcceedeaabf2924bcf8459db2da01f5
permissions -rw-r--r--
Backed out changeset a73da05c87ba (bug 1253740)

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=99: */
/* 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 _include_gfx_ipc_GPUProcessImpl_h__
#define _include_gfx_ipc_GPUProcessImpl_h__

#include "mozilla/ipc/ProcessChild.h"
#include "GPUParent.h"

#if defined(XP_WIN)
# include "mozilla/mscom/MainThreadRuntime.h"
#endif

namespace mozilla {
namespace gfx {

// This class owns the subprocess instance of a PGPU - which in this case,
// is a GPUParent. It is instantiated as a singleton in XRE_InitChildProcess.
class GPUProcessImpl final : public ipc::ProcessChild
{
public:
  explicit GPUProcessImpl(ProcessId aParentPid);
  ~GPUProcessImpl();

  bool Init() override;
  void CleanUp() override;

private:
  DISALLOW_COPY_AND_ASSIGN(GPUProcessImpl);

  GPUParent mGPU;

#if defined(XP_WIN)
  // This object initializes and configures COM.
  mozilla::mscom::MainThreadRuntime mCOMRuntime;
#endif
};

} // namespace gfx
} // namespace mozilla

#endif // _include_gfx_ipc_GPUProcessImpl_h__