gecko-dev/netwerk/ipc/SocketProcessChild.h
Alex Gaynor 0f01791ffc Bug 1512990 - Part 4 - remove declarations of Recv/Answer methods from IPDL protocol base class; r=froydnj
For cases where the class has direct calls (that is, we cast `this` to the
subclass before making the call) no longer declare Recv/Answer methods on the
base class at all. This should ensure that slots for them are not generated in
vtables, and also allow the derived class to choose the method signature (e.g.
whether it wants to take something by reference or by value).

Differential Revision: https://phabricator.services.mozilla.com/D18132

--HG--
extra : moz-landing-system : lando
2019-02-06 15:58:43 +00:00

65 lines
2.1 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_SocketProcessChild_h
#define mozilla_net_SocketProcessChild_h
#include "mozilla/net/PSocketProcessChild.h"
#include "nsRefPtrHashtable.h"
namespace mozilla {
class ChildProfilerController;
}
namespace mozilla {
namespace net {
class SocketProcessBridgeParent;
// The IPC actor implements PSocketProcessChild in child process.
// This is allocated and kept alive by SocketProcessImpl.
class SocketProcessChild final : public PSocketProcessChild {
public:
SocketProcessChild();
~SocketProcessChild();
static SocketProcessChild* GetSingleton();
bool Init(base::ProcessId aParentPid, const char* aParentBuildID,
MessageLoop* aIOLoop, IPC::Channel* aChannel);
void ActorDestroy(ActorDestroyReason aWhy) override;
mozilla::ipc::IPCResult RecvPreferenceUpdate(const Pref& aPref);
mozilla::ipc::IPCResult RecvRequestMemoryReport(
const uint32_t& generation, const bool& anonymize,
const bool& minimizeMemoryUsage, const MaybeFileDesc& DMDFile);
mozilla::ipc::IPCResult RecvSetOffline(const bool& aOffline);
mozilla::ipc::IPCResult RecvInitSocketProcessBridgeParent(
const ProcessId& aContentProcessId,
Endpoint<mozilla::net::PSocketProcessBridgeParent>&& aEndpoint);
mozilla::ipc::IPCResult RecvInitProfiler(
Endpoint<mozilla::PProfilerChild>&& aEndpoint);
mozilla::ipc::IPCResult RecvSocketProcessTelemetryPing();
void CleanUp();
void DestroySocketProcessBridgeParent(ProcessId aId);
private:
// Mapping of content process id and the SocketProcessBridgeParent.
// This table keeps SocketProcessBridgeParent alive in socket process.
nsRefPtrHashtable<nsUint32HashKey, SocketProcessBridgeParent>
mSocketProcessBridgeParentMap;
#ifdef MOZ_GECKO_PROFILER
RefPtr<ChildProfilerController> mProfilerController;
#endif
};
} // namespace net
} // namespace mozilla
#endif // mozilla_net_SocketProcessChild_h