2019-01-11 18:57:23 +00: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 18:48:25 +00:00
|
|
|
|
2019-01-11 20:52:39 +00:00
|
|
|
namespace dom {
|
|
|
|
class MemoryReport;
|
|
|
|
class MemoryReportRequestHost;
|
|
|
|
} // namespace dom
|
|
|
|
|
2019-01-11 18:48:25 +00:00
|
|
|
namespace ipc {
|
|
|
|
class CrashReporterHost;
|
|
|
|
} // namespace ipc
|
|
|
|
|
2019-01-11 18:57:23 +00: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 20:55:07 +00:00
|
|
|
static SocketProcessParent* GetSingleton();
|
|
|
|
|
2019-01-11 18:48:25 +00:00
|
|
|
mozilla::ipc::IPCResult RecvInitCrashReporter(
|
2019-02-06 15:58:43 +00:00
|
|
|
Shmem&& aShmem, const NativeThreadId& aThreadId);
|
|
|
|
mozilla::ipc::IPCResult RecvAddMemoryReport(const MemoryReport& aReport);
|
|
|
|
mozilla::ipc::IPCResult RecvFinishMemoryReport(const uint32_t& aGeneration);
|
2019-01-11 20:59:35 +00:00
|
|
|
mozilla::ipc::IPCResult RecvAccumulateChildHistograms(
|
2019-02-06 15:58:43 +00:00
|
|
|
InfallibleTArray<HistogramAccumulation>&& aAccumulations);
|
2019-01-11 20:59:35 +00:00
|
|
|
mozilla::ipc::IPCResult RecvAccumulateChildKeyedHistograms(
|
2019-02-06 15:58:43 +00:00
|
|
|
InfallibleTArray<KeyedHistogramAccumulation>&& aAccumulations);
|
2019-01-11 20:59:35 +00:00
|
|
|
mozilla::ipc::IPCResult RecvUpdateChildScalars(
|
2019-02-06 15:58:43 +00:00
|
|
|
InfallibleTArray<ScalarAction>&& aScalarActions);
|
2019-01-11 20:59:35 +00:00
|
|
|
mozilla::ipc::IPCResult RecvUpdateChildKeyedScalars(
|
2019-02-06 15:58:43 +00:00
|
|
|
InfallibleTArray<KeyedScalarAction>&& aScalarActions);
|
2019-01-11 20:59:35 +00:00
|
|
|
mozilla::ipc::IPCResult RecvRecordChildEvents(
|
2019-02-06 15:58:43 +00:00
|
|
|
nsTArray<ChildEventData>&& events);
|
2019-01-11 20:59:35 +00:00
|
|
|
mozilla::ipc::IPCResult RecvRecordDiscardedData(
|
2019-02-06 15:58:43 +00:00
|
|
|
const DiscardedData& aDiscardedData);
|
2019-01-11 18:48:25 +00:00
|
|
|
|
2019-04-23 13:10:56 +00:00
|
|
|
PWebrtcProxyChannelParent* AllocPWebrtcProxyChannelParent(
|
2019-04-26 14:46:26 +00:00
|
|
|
const TabId& aTabId);
|
2019-04-23 13:10:56 +00:00
|
|
|
bool DeallocPWebrtcProxyChannelParent(PWebrtcProxyChannelParent* aActor);
|
|
|
|
|
2019-01-11 18:57:23 +00:00
|
|
|
void ActorDestroy(ActorDestroyReason aWhy) override;
|
2019-01-11 20:52:39 +00:00
|
|
|
bool SendRequestMemoryReport(const uint32_t& aGeneration,
|
|
|
|
const bool& aAnonymize,
|
|
|
|
const bool& aMinimizeMemoryUsage,
|
2019-02-28 21:20:40 +00:00
|
|
|
const Maybe<ipc::FileDescriptor>& aDMDFile);
|
2019-01-11 18:57:23 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
SocketProcessHost* mHost;
|
2019-01-11 18:48:25 +00:00
|
|
|
UniquePtr<ipc::CrashReporterHost> mCrashReporter;
|
2019-01-11 20:52:39 +00:00
|
|
|
UniquePtr<dom::MemoryReportRequestHost> mMemoryReportRequest;
|
2019-01-11 18:57:23 +00:00
|
|
|
|
|
|
|
static void Destroy(UniquePtr<SocketProcessParent>&& aParent);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace net
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_net_SocketProcessParent_h
|