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"
|
2019-08-15 15:06:51 +03:00
|
|
|
#include "mozilla/ipc/CrashReporterHelper.h"
|
2019-01-11 21:57:23 +03:00
|
|
|
#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.
|
2019-08-15 15:06:51 +03:00
|
|
|
class SocketProcessParent final
|
|
|
|
: public PSocketProcessParent,
|
2019-09-12 23:34:58 +03:00
|
|
|
public ipc::CrashReporterHelper<GeckoProcessType_Socket> {
|
2019-01-11 21:57:23 +03:00
|
|
|
public:
|
|
|
|
friend class SocketProcessHost;
|
|
|
|
|
|
|
|
explicit SocketProcessParent(SocketProcessHost* aHost);
|
|
|
|
~SocketProcessParent();
|
|
|
|
|
2019-01-11 23:55:07 +03:00
|
|
|
static SocketProcessParent* GetSingleton();
|
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
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-07-10 06:33:21 +03:00
|
|
|
nsTArray<HistogramAccumulation>&& aAccumulations);
|
2019-01-11 23:59:35 +03:00
|
|
|
mozilla::ipc::IPCResult RecvAccumulateChildKeyedHistograms(
|
2019-07-10 06:33:21 +03:00
|
|
|
nsTArray<KeyedHistogramAccumulation>&& aAccumulations);
|
2019-01-11 23:59:35 +03:00
|
|
|
mozilla::ipc::IPCResult RecvUpdateChildScalars(
|
2019-07-10 06:33:21 +03:00
|
|
|
nsTArray<ScalarAction>&& aScalarActions);
|
2019-01-11 23:59:35 +03:00
|
|
|
mozilla::ipc::IPCResult RecvUpdateChildKeyedScalars(
|
2019-07-10 06:33:21 +03:00
|
|
|
nsTArray<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-09-17 21:17:37 +03:00
|
|
|
PWebrtcTCPSocketParent* AllocPWebrtcTCPSocketParent(
|
|
|
|
const Maybe<TabId>& aTabId);
|
2019-09-17 21:15:41 +03:00
|
|
|
bool DeallocPWebrtcTCPSocketParent(PWebrtcTCPSocketParent* aActor);
|
2019-08-05 23:54:01 +03:00
|
|
|
PDNSRequestParent* AllocPDNSRequestParent(
|
|
|
|
const nsCString& aHost, const OriginAttributes& aOriginAttributes,
|
|
|
|
const uint32_t& aFlags);
|
|
|
|
virtual mozilla::ipc::IPCResult RecvPDNSRequestConstructor(
|
|
|
|
PDNSRequestParent* actor, const nsCString& hostName,
|
|
|
|
const OriginAttributes& aOriginAttributes,
|
|
|
|
const uint32_t& flags) override;
|
|
|
|
bool DeallocPDNSRequestParent(PDNSRequestParent*);
|
2019-04-23 16:10:56 +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 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
|