widget/windows/PDFiumProcessParent.h
author cku <cku@mozilla.com>
Sun, 05 Nov 2017 15:34:54 +0800
changeset 449822 8f600ac930ecfa6b064b288f17d7063df2a89247
parent 449816 5c50bbde0950ce2770e70faf04d53f004cc45e28
child 450799 8320a9f9de3e4ef593cf8c5a96c832ed5c28c9fc
permissions -rw-r--r--
Bug 1399787 - Part 13. Handle AbortDocument. r=jwatt While aborting conversion, we need to make sure there is no coversion task executing in the PDFium process before destroying it. MozReview-Commit-ID: 3Iqhe8KmYv2

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: sw=4 ts=4 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/. */

#ifndef PDFIUMPROCESSPARENT_H
#define PDFIUMPROCESSPARENT_H

#include "chrome/common/child_process_host.h"
#include "mozilla/ipc/GeckoChildProcessHost.h"

class nsIRunnable;
class nsDeviceContextSpecWin;

#ifdef MOZ_ENABLE_SKIA_PDF
namespace mozilla {
namespace widget {
  class PDFiumParent;
}
namespace gfx {
  class PrintTargetEMF;
}
}
#endif

namespace mozilla {
namespace widget {

class PDFiumProcessParent final : public mozilla::ipc::GeckoChildProcessHost
{
public:
  typedef mozilla::gfx::PrintTargetEMF PrintTargetEMF;

  PDFiumProcessParent();
  ~PDFiumProcessParent();

  bool Launch(PrintTargetEMF* aTarget);

  void Delete(bool aWaitingForEMFConversion);

  bool CanShutdown() override { return true; }

  PDFiumParent* GetActor() const { return mPDFiumParentActor; }
private:

  DISALLOW_COPY_AND_ASSIGN(PDFiumProcessParent);

  RefPtr<PDFiumParent> mPDFiumParentActor;
  nsCOMPtr<nsIThread> mLaunchThread;
};

} // namespace widget
} // namespace mozilla

#endif // ifndef PDFIUMPROCESSPARENT_H