2018-11-14 21:06:24 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* 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_dom_media_ipc_RDDChild_h_
|
|
|
|
#define _include_dom_media_ipc_RDDChild_h_
|
|
|
|
#include "mozilla/PRDDChild.h"
|
|
|
|
|
2019-08-15 15:06:51 +03:00
|
|
|
#include "mozilla/ipc/CrashReporterHelper.h"
|
2018-11-14 21:06:24 +03:00
|
|
|
#include "mozilla/UniquePtr.h"
|
2019-06-28 10:08:43 +03:00
|
|
|
#include "mozilla/gfx/gfxVarReceiver.h"
|
2018-11-14 21:06:24 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2019-02-27 23:14:54 +03:00
|
|
|
#if defined(XP_LINUX) && defined(MOZ_SANDBOX)
|
|
|
|
class SandboxBroker;
|
|
|
|
#endif
|
|
|
|
|
2018-11-14 21:06:24 +03:00
|
|
|
namespace dom {
|
|
|
|
class MemoryReportRequestHost;
|
|
|
|
} // namespace dom
|
|
|
|
|
|
|
|
class RDDProcessHost;
|
|
|
|
|
2019-08-15 15:06:51 +03:00
|
|
|
class RDDChild final : public PRDDChild,
|
|
|
|
public ipc::CrashReporterHelper<GeckoProcessType_RDD>,
|
|
|
|
public gfx::gfxVarReceiver {
|
2018-11-14 21:06:24 +03:00
|
|
|
typedef mozilla::dom::MemoryReportRequestHost MemoryReportRequestHost;
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit RDDChild(RDDProcessHost* aHost);
|
|
|
|
~RDDChild();
|
|
|
|
|
2019-03-28 05:25:50 +03:00
|
|
|
bool Init(bool aStartMacSandbox);
|
2018-11-14 21:06:24 +03:00
|
|
|
|
|
|
|
bool EnsureRDDReady();
|
|
|
|
|
2019-06-28 10:08:43 +03:00
|
|
|
void OnVarChanged(const GfxVarUpdate& aVar) override;
|
|
|
|
|
2018-11-14 21:06:24 +03:00
|
|
|
// PRDDChild overrides.
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitComplete();
|
2018-11-14 21:06:24 +03:00
|
|
|
|
|
|
|
void ActorDestroy(ActorDestroyReason aWhy) override;
|
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvAddMemoryReport(const MemoryReport& aReport);
|
|
|
|
mozilla::ipc::IPCResult RecvFinishMemoryReport(const uint32_t& aGeneration);
|
2018-11-14 21:06:24 +03:00
|
|
|
|
|
|
|
bool SendRequestMemoryReport(const uint32_t& aGeneration,
|
|
|
|
const bool& aAnonymize,
|
|
|
|
const bool& aMinimizeMemoryUsage,
|
2019-03-01 00:20:40 +03:00
|
|
|
const Maybe<ipc::FileDescriptor>& aDMDFile);
|
2018-11-14 21:06:24 +03:00
|
|
|
|
|
|
|
static void Destroy(UniquePtr<RDDChild>&& aChild);
|
|
|
|
|
|
|
|
private:
|
|
|
|
RDDProcessHost* mHost;
|
|
|
|
UniquePtr<MemoryReportRequestHost> mMemoryReportRequest;
|
2019-02-27 23:14:54 +03:00
|
|
|
#if defined(XP_LINUX) && defined(MOZ_SANDBOX)
|
|
|
|
UniquePtr<SandboxBroker> mSandboxBroker;
|
|
|
|
#endif
|
2018-11-14 21:06:24 +03:00
|
|
|
bool mRDDReady;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // _include_dom_media_ipc_RDDChild_h_
|