2019-01-11 21:57:23 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; 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 mozilla_net_SocketProcessParent_h
|
|
|
|
#define mozilla_net_SocketProcessParent_h
|
|
|
|
|
|
|
|
#include "mozilla/UniquePtr.h"
|
|
|
|
#include "mozilla/net/PSocketProcessParent.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
2019-01-11 21:48:25 +03:00
|
|
|
|
2019-01-11 23:52:39 +03:00
|
|
|
namespace dom {
|
|
|
|
class MemoryReport;
|
|
|
|
class MemoryReportRequestHost;
|
|
|
|
} // namespace dom
|
|
|
|
|
2019-01-11 21:48:25 +03:00
|
|
|
namespace ipc {
|
|
|
|
class CrashReporterHost;
|
|
|
|
} // namespace ipc
|
|
|
|
|
2019-01-11 21:57:23 +03:00
|
|
|
namespace net {
|
|
|
|
|
|
|
|
class SocketProcessHost;
|
|
|
|
|
|
|
|
// IPC actor of socket process in parent process. This is allocated and managed
|
|
|
|
// by SocketProcessHost.
|
|
|
|
class SocketProcessParent final : public PSocketProcessParent {
|
|
|
|
public:
|
|
|
|
friend class SocketProcessHost;
|
|
|
|
|
|
|
|
explicit SocketProcessParent(SocketProcessHost* aHost);
|
|
|
|
~SocketProcessParent();
|
|
|
|
|
2019-01-11 23:55:07 +03:00
|
|
|
static SocketProcessParent* GetSingleton();
|
|
|
|
|
2019-01-11 21:48:25 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitCrashReporter(
|
2019-02-06 18:58:43 +03:00
|
|
|
Shmem&& aShmem, const NativeThreadId& aThreadId);
|
|
|
|
mozilla::ipc::IPCResult RecvAddMemoryReport(const MemoryReport& aReport);
|
|
|
|
mozilla::ipc::IPCResult RecvFinishMemoryReport(const uint32_t& aGeneration);
|
2019-01-11 23:59:35 +03:00
|
|
|
mozilla::ipc::IPCResult RecvAccumulateChildHistograms(
|
2019-02-06 18:58:43 +03:00
|
|
|
InfallibleTArray<HistogramAccumulation>&& aAccumulations);
|
2019-01-11 23:59:35 +03:00
|
|
|
mozilla::ipc::IPCResult RecvAccumulateChildKeyedHistograms(
|
2019-02-06 18:58:43 +03:00
|
|
|
InfallibleTArray<KeyedHistogramAccumulation>&& aAccumulations);
|
2019-01-11 23:59:35 +03:00
|
|
|
mozilla::ipc::IPCResult RecvUpdateChildScalars(
|
2019-02-06 18:58:43 +03:00
|
|
|
InfallibleTArray<ScalarAction>&& aScalarActions);
|
2019-01-11 23:59:35 +03:00
|
|
|
mozilla::ipc::IPCResult RecvUpdateChildKeyedScalars(
|
2019-02-06 18:58:43 +03:00
|
|
|
InfallibleTArray<KeyedScalarAction>&& aScalarActions);
|
2019-01-11 23:59:35 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRecordChildEvents(
|
2019-02-06 18:58:43 +03:00
|
|
|
nsTArray<ChildEventData>&& events);
|
2019-01-11 23:59:35 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRecordDiscardedData(
|
2019-02-06 18:58:43 +03:00
|
|
|
const DiscardedData& aDiscardedData);
|
2019-01-11 21:48:25 +03:00
|
|
|
|
2019-01-11 21:57:23 +03:00
|
|
|
void ActorDestroy(ActorDestroyReason aWhy) override;
|
2019-01-11 23:52:39 +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);
|
2019-01-11 21:57:23 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
SocketProcessHost* mHost;
|
2019-01-11 21:48:25 +03:00
|
|
|
UniquePtr<ipc::CrashReporterHost> mCrashReporter;
|
2019-01-11 23:52:39 +03:00
|
|
|
UniquePtr<dom::MemoryReportRequestHost> mMemoryReportRequest;
|
2019-01-11 21:57:23 +03:00
|
|
|
|
|
|
|
static void Destroy(UniquePtr<SocketProcessParent>&& aParent);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace net
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_net_SocketProcessParent_h
|