gecko-dev/netwerk/ipc/SocketProcessParent.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

85 строки
3.0 KiB
C
Исходник Обычный вид История

/* -*- 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/ipc/CrashReporterHelper.h"
#include "mozilla/net/PSocketProcessParent.h"
namespace mozilla {
namespace dom {
class MemoryReport;
class MemoryReportRequestHost;
} // namespace dom
namespace ipc {
class CrashReporterHost;
} // namespace ipc
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 ipc::CrashReporterHelper<GeckoProcessType_Socket> {
public:
friend class SocketProcessHost;
explicit SocketProcessParent(SocketProcessHost* aHost);
~SocketProcessParent();
static SocketProcessParent* GetSingleton();
mozilla::ipc::IPCResult RecvAddMemoryReport(const MemoryReport& aReport);
mozilla::ipc::IPCResult RecvFinishMemoryReport(const uint32_t& aGeneration);
mozilla::ipc::IPCResult RecvAccumulateChildHistograms(
nsTArray<HistogramAccumulation>&& aAccumulations);
mozilla::ipc::IPCResult RecvAccumulateChildKeyedHistograms(
nsTArray<KeyedHistogramAccumulation>&& aAccumulations);
mozilla::ipc::IPCResult RecvUpdateChildScalars(
nsTArray<ScalarAction>&& aScalarActions);
mozilla::ipc::IPCResult RecvUpdateChildKeyedScalars(
nsTArray<KeyedScalarAction>&& aScalarActions);
mozilla::ipc::IPCResult RecvRecordChildEvents(
nsTArray<ChildEventData>&& events);
mozilla::ipc::IPCResult RecvRecordDiscardedData(
const DiscardedData& aDiscardedData);
PWebrtcTCPSocketParent* AllocPWebrtcTCPSocketParent(
const Maybe<TabId>& aTabId);
bool DeallocPWebrtcTCPSocketParent(PWebrtcTCPSocketParent* aActor);
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*);
void ActorDestroy(ActorDestroyReason aWhy) override;
bool SendRequestMemoryReport(const uint32_t& aGeneration,
const bool& aAnonymize,
const bool& aMinimizeMemoryUsage,
const Maybe<ipc::FileDescriptor>& aDMDFile);
private:
SocketProcessHost* mHost;
UniquePtr<dom::MemoryReportRequestHost> mMemoryReportRequest;
static void Destroy(UniquePtr<SocketProcessParent>&& aParent);
};
} // namespace net
} // namespace mozilla
#endif // mozilla_net_SocketProcessParent_h