Remove GMP, Plugin and IPC crash reporter hooks.

Stubs will be removed in follow-up

Tag #20.
This commit is contained in:
wolfbeast
2018-05-21 13:56:28 +02:00
parent 1309bdb541
commit fbdd52ea57
22 changed files with 8 additions and 373 deletions
-14
View File
@@ -32,7 +32,6 @@
#include "mozilla/dom/ExternalHelperAppChild.h"
#include "mozilla/dom/FlyWebPublishedServerIPC.h"
#include "mozilla/dom/GetFilesHelper.h"
#include "mozilla/dom/PCrashReporterChild.h"
#include "mozilla/dom/ProcessGlobal.h"
#include "mozilla/dom/PushNotifier.h"
#include "mozilla/dom/workers/ServiceWorkerManager.h"
@@ -1497,19 +1496,6 @@ ContentChild::RecvNotifyEmptyHTTPCache()
return true;
}
PCrashReporterChild*
ContentChild::AllocPCrashReporterChild(const mozilla::dom::NativeThreadId& id,
const uint32_t& processType)
{
return nullptr;
}
bool
ContentChild::DeallocPCrashReporterChild(PCrashReporterChild* crashreporter)
{
delete crashreporter;
return true;
}
PHalChild*
ContentChild::AllocPHalChild()
-7
View File
@@ -186,13 +186,6 @@ public:
virtual bool DeallocPBlobChild(PBlobChild* aActor) override;
virtual PCrashReporterChild*
AllocPCrashReporterChild(const mozilla::dom::NativeThreadId& id,
const uint32_t& processType) override;
virtual bool
DeallocPCrashReporterChild(PCrashReporterChild*) override;
virtual PHalChild* AllocPHalChild() override;
virtual bool DeallocPHalChild(PHalChild*) override;
-23
View File
@@ -2953,29 +2953,6 @@ ContentParent::FriendlyName(nsAString& aName, bool aAnonymize)
}
}
PCrashReporterParent*
ContentParent::AllocPCrashReporterParent(const NativeThreadId& tid,
const uint32_t& processType)
{
return nullptr;
}
bool
ContentParent::RecvPCrashReporterConstructor(PCrashReporterParent* actor,
const NativeThreadId& tid,
const uint32_t& processType)
{
static_cast<CrashReporterParent*>(actor)->SetChildData(tid, processType);
return true;
}
bool
ContentParent::DeallocPCrashReporterParent(PCrashReporterParent* crashreporter)
{
delete crashreporter;
return true;
}
hal_sandbox::PHalParent*
ContentParent::AllocPHalParent()
{
-12
View File
@@ -372,15 +372,6 @@ public:
virtual void OnChannelError() override;
virtual PCrashReporterParent*
AllocPCrashReporterParent(const NativeThreadId& tid,
const uint32_t& processType) override;
virtual bool
RecvPCrashReporterConstructor(PCrashReporterParent* actor,
const NativeThreadId& tid,
const uint32_t& processType) override;
virtual PNeckoParent* AllocPNeckoParent() override;
virtual bool RecvPNeckoConstructor(PNeckoParent* aActor) override
@@ -735,9 +726,6 @@ private:
RecvPBlobConstructor(PBlobParent* aActor,
const BlobConstructorParams& params) override;
virtual bool
DeallocPCrashReporterParent(PCrashReporterParent* crashreporter) override;
virtual bool RecvNSSU2FTokenIsCompatibleVersion(const nsString& aVersion,
bool* aIsCompatible) override;
+1 -26
View File
@@ -12,31 +12,6 @@ using mozilla::plugins::PluginModuleChild;
namespace mozilla {
namespace dom {
/*static*/
PCrashReporterChild*
CrashReporterChild::GetCrashReporter()
{
const ManagedContainer<PCrashReporterChild>* reporters = nullptr;
switch (XRE_GetProcessType()) {
case GeckoProcessType_Content: {
ContentChild* child = ContentChild::GetSingleton();
reporters = &child->ManagedPCrashReporterChild();
break;
}
case GeckoProcessType_Plugin: {
PluginModuleChild* child = PluginModuleChild::GetChrome();
reporters = &child->ManagedPCrashReporterChild();
break;
}
default:
break;
}
if (!reporters) {
return nullptr;
}
return LoneManagedOrNullAsserts(*reporters);
}
/*** STUB ***/
} // namespace dom
} // namespace mozilla
+1 -17
View File
@@ -7,25 +7,9 @@
#ifndef mozilla_dom_CrashReporterChild_h
#define mozilla_dom_CrashReporterChild_h
#include "mozilla/dom/PCrashReporterChild.h"
namespace mozilla {
namespace dom {
class CrashReporterChild :
public PCrashReporterChild
{
public:
CrashReporterChild() {
MOZ_COUNT_CTOR(CrashReporterChild);
}
~CrashReporterChild() {
MOZ_COUNT_DTOR(CrashReporterChild);
}
static PCrashReporterChild* GetCrashReporter();
};
/*** STUB ***/
} // namespace dom
} // namespace mozilla
+2 -43
View File
@@ -16,48 +16,7 @@
namespace mozilla {
namespace dom {
using namespace mozilla::ipc;
void
CrashReporterParent::AnnotateCrashReport(const nsCString& key,
const nsCString& data)
{
}
void
CrashReporterParent::ActorDestroy(ActorDestroyReason aWhy)
{
// Implement me! Bug 1005155
}
bool
CrashReporterParent::RecvAppendAppNotes(const nsCString& data)
{
mAppNotes.Append(data);
return true;
}
CrashReporterParent::CrashReporterParent()
:
mStartTime(::time(nullptr))
, mInitialized(false)
{
MOZ_COUNT_CTOR(CrashReporterParent);
}
CrashReporterParent::~CrashReporterParent()
{
MOZ_COUNT_DTOR(CrashReporterParent);
}
void
CrashReporterParent::SetChildData(const NativeThreadId& tid,
const uint32_t& processType)
{
mInitialized = true;
mMainThread = tid;
mProcessType = GeckoProcessType(processType);
}
/*** STUB ***/
} // namespace dom
} // namespace mozilla
+2 -51
View File
@@ -7,63 +7,14 @@
#ifndef mozilla_dom_CrashReporterParent_h
#define mozilla_dom_CrashReporterParent_h
#include "mozilla/dom/PCrashReporterParent.h"
#include "mozilla/dom/TabMessageUtils.h"
#include "nsIFile.h"
namespace mozilla {
namespace dom {
class CrashReporterParent : public PCrashReporterParent
{
public:
CrashReporterParent();
virtual ~CrashReporterParent();
/*
* Initialize this reporter with data from the child process.
*/
void
SetChildData(const NativeThreadId& id, const uint32_t& processType);
/*
* Returns the ID of the child minidump.
* GeneratePairedMinidump or GenerateCrashReport must be called first.
*/
const nsString& ChildDumpID() const {
return mChildDumpID;
}
/*
* Add an annotation to our internally tracked list of annotations.
* Callers must apply these notes using GenerateChildData otherwise
* the notes will get dropped.
*/
void
AnnotateCrashReport(const nsCString& aKey, const nsCString& aData);
protected:
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
virtual bool RecvAnnotateCrashReport(const nsCString& aKey,
const nsCString& aData) override
{
AnnotateCrashReport(aKey, aData);
return true;
}
virtual bool RecvAppendAppNotes(const nsCString& aData) override;
nsCString mAppNotes;
nsString mChildDumpID;
// stores the child main thread id
NativeThreadId mMainThread;
time_t mStartTime;
// stores the child process type
GeckoProcessType mProcessType;
bool mInitialized;
};
/*** STUB ***/
} // namespace dom
} // namespace mozilla
-4
View File
@@ -11,7 +11,6 @@ include protocol PCompositorBridge;
include protocol PContentBridge;
include protocol PContentPermissionRequest;
include protocol PCycleCollectWithLogs;
include protocol PCrashReporter;
include protocol PPSMContentDownloader;
include protocol PExternalHelperApp;
include protocol PHandlerService;
@@ -243,7 +242,6 @@ nested(upto inside_cpow) sync protocol PContent
manages PBlob;
manages PBrowser;
manages PContentPermissionRequest;
manages PCrashReporter;
manages PCycleCollectWithLogs;
manages PPSMContentDownloader;
manages PExternalHelperApp;
@@ -625,8 +623,6 @@ parent:
async PRemoteSpellcheckEngine();
sync PCrashReporter(NativeThreadId tid, uint32_t processType);
/**
* Is this token compatible with the provided version?
*
-31
View File
@@ -1,31 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set sw=4 ts=8 et tw=80 :
* 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/. */
include protocol PContent;
include protocol PPluginModule;
include protocol PGMP;
namespace mozilla {
namespace dom {
struct Mapping {
nsCString library_name;
nsCString file_id;
uintptr_t start_address;
size_t mapping_length;
size_t file_offset;
};
async protocol PCrashReporter {
manager PContent or PPluginModule or PGMP;
parent:
async AnnotateCrashReport(nsCString key, nsCString data);
async AppendAppNotes(nsCString data);
async __delete__();
};
}
}
-1
View File
@@ -92,7 +92,6 @@ IPDL_SOURCES += [
'PContentBridge.ipdl',
'PContentPermission.ipdlh',
'PContentPermissionRequest.ipdl',
'PCrashReporter.ipdl',
'PCycleCollectWithLogs.ipdl',
'PFilePicker.ipdl',
'PMemoryReportRequest.ipdl',
-14
View File
@@ -26,7 +26,6 @@
#include "widevine-adapter/WidevineAdapter.h"
using namespace mozilla::ipc;
using mozilla::dom::CrashReporterChild;
static const int MAX_VOUCHER_LENGTH = 500000;
@@ -331,19 +330,6 @@ GMPChild::ProcessingError(Result aCode, const char* aReason)
}
}
mozilla::dom::PCrashReporterChild*
GMPChild::AllocPCrashReporterChild(const NativeThreadId& aThread)
{
return new CrashReporterChild();
}
bool
GMPChild::DeallocPCrashReporterChild(PCrashReporterChild* aCrashReporter)
{
delete aCrashReporter;
return true;
}
PGMPTimerChild*
GMPChild::AllocPGMPTimerChild()
{
-3
View File
@@ -52,9 +52,6 @@ private:
bool AnswerStartPlugin(const nsString& aAdapter) override;
bool RecvPreloadLibs(const nsCString& aLibs) override;
PCrashReporterChild* AllocPCrashReporterChild(const NativeThreadId& aThread) override;
bool DeallocPCrashReporterChild(PCrashReporterChild*) override;
PGMPTimerChild* AllocPGMPTimerChild() override;
bool DeallocPGMPTimerChild(PGMPTimerChild* aActor) override;
-17
View File
@@ -23,7 +23,6 @@
#include "VideoUtils.h"
#include "mozilla/dom/CrashReporterParent.h"
using mozilla::dom::CrashReporterParent;
using mozilla::ipc::GeckoChildProcessHost;
#include "mozilla/Telemetry.h"
@@ -580,22 +579,6 @@ GMPParent::ActorDestroy(ActorDestroyReason aWhy)
}
}
mozilla::dom::PCrashReporterParent*
GMPParent::AllocPCrashReporterParent(const NativeThreadId& aThread)
{
MOZ_ASSERT(false, "Should only be sent if crash reporting is enabled.");
CrashReporterParent* cr = new CrashReporterParent();
cr->SetChildData(aThread, GeckoProcessType_GMPlugin);
return cr;
}
bool
GMPParent::DeallocPCrashReporterParent(PCrashReporterParent* aCrashReporter)
{
delete aCrashReporter;
return true;
}
PGMPStorageParent*
GMPParent::AllocPGMPStorageParent()
{
-3
View File
@@ -168,9 +168,6 @@ private:
RefPtr<GenericPromise> ReadChromiumManifestFile(nsIFile* aFile); // GMP thread.
void ActorDestroy(ActorDestroyReason aWhy) override;
PCrashReporterParent* AllocPCrashReporterParent(const NativeThreadId& aThread) override;
bool DeallocPCrashReporterParent(PCrashReporterParent* aCrashReporter) override;
bool RecvPGMPStorageConstructor(PGMPStorageParent* actor) override;
PGMPStorageParent* AllocPGMPStorageParent() override;
bool DeallocPGMPStorageParent(PGMPStorageParent* aActor) override;
-3
View File
@@ -3,7 +3,6 @@
* 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/. */
include protocol PCrashReporter;
include protocol PGMPContent;
include protocol PGMPTimer;
include protocol PGMPStorage;
@@ -17,12 +16,10 @@ intr protocol PGMP
{
parent opens PGMPContent;
manages PCrashReporter;
manages PGMPTimer;
manages PGMPStorage;
parent:
async PCrashReporter(NativeThreadId tid);
async PGMPTimer();
async PGMPStorage();
-5
View File
@@ -5,7 +5,6 @@
include protocol PPluginInstance;
include protocol PPluginScriptableObject;
include protocol PCrashReporter;
include protocol PContent;
include ProfilerTypes;
@@ -39,7 +38,6 @@ intr protocol PPluginModule
bridges PContent, PPluginModule;
manages PPluginInstance;
manages PCrashReporter;
both:
// Window-specific message which instructs the interrupt mechanism to enter
@@ -94,9 +92,6 @@ child:
async SetParentHangTimeout(uint32_t seconds);
intr PCrashReporter()
returns (NativeThreadId tid, uint32_t processType);
/**
* Control the Gecko Profiler in the plugin process.
*/
-25
View File
@@ -56,8 +56,6 @@ using namespace mozilla;
using namespace mozilla::ipc;
using namespace mozilla::plugins;
using namespace mozilla::widget;
using mozilla::dom::CrashReporterChild;
using mozilla::dom::PCrashReporterChild;
#if defined(XP_WIN)
const wchar_t * kFlashFullscreenClass = L"ShockwaveFlashFullScreen";
@@ -733,29 +731,6 @@ PluginModuleChild::AllocPPluginModuleChild(mozilla::ipc::Transport* aTransport,
return PluginModuleChild::CreateForContentProcess(aTransport, aOtherPid);
}
PCrashReporterChild*
PluginModuleChild::AllocPCrashReporterChild(mozilla::dom::NativeThreadId* id,
uint32_t* processType)
{
return new CrashReporterChild();
}
bool
PluginModuleChild::DeallocPCrashReporterChild(PCrashReporterChild* actor)
{
delete actor;
return true;
}
bool
PluginModuleChild::AnswerPCrashReporterConstructor(
PCrashReporterChild* actor,
mozilla::dom::NativeThreadId* id,
uint32_t* processType)
{
return true;
}
void
PluginModuleChild::ActorDestroy(ActorDestroyReason why)
{
-15
View File
@@ -46,17 +46,12 @@ typedef NS_NPAPIPLUGIN_CALLBACK(NPError, NP_PLUGINUNIXINIT) (const NPNetscapeFun
typedef NS_NPAPIPLUGIN_CALLBACK(NPError, NP_PLUGINSHUTDOWN) (void);
namespace mozilla {
namespace dom {
class PCrashReporterChild;
} // namespace dom
namespace plugins {
class PluginInstanceChild;
class PluginModuleChild : public PPluginModuleChild
{
typedef mozilla::dom::PCrashReporterChild PCrashReporterChild;
protected:
virtual mozilla::ipc::RacyInterruptPolicy
MediateInterruptRace(const MessageInfo& parent,
@@ -124,16 +119,6 @@ protected:
virtual bool
RecvSetParentHangTimeout(const uint32_t& aSeconds) override;
virtual PCrashReporterChild*
AllocPCrashReporterChild(mozilla::dom::NativeThreadId* id,
uint32_t* processType) override;
virtual bool
DeallocPCrashReporterChild(PCrashReporterChild* actor) override;
virtual bool
AnswerPCrashReporterConstructor(PCrashReporterChild* actor,
mozilla::dom::NativeThreadId* id,
uint32_t* processType) override;
virtual void
ActorDestroy(ActorDestroyReason why) override;
-29
View File
@@ -10,7 +10,6 @@
#include "mozilla/Attributes.h"
#include "mozilla/dom/ContentParent.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/PCrashReporterParent.h"
#include "mozilla/ipc/GeckoChildProcessHost.h"
#include "mozilla/ipc/MessageChannel.h"
#include "mozilla/ipc/ProtocolUtils.h"
@@ -67,7 +66,6 @@ using mozilla::ProfileGatherer;
#endif
using mozilla::ipc::MessageChannel;
using mozilla::ipc::GeckoChildProcessHost;
using mozilla::dom::PCrashReporterParent;
using mozilla::dom::CrashReporterParent;
using namespace mozilla;
@@ -2525,33 +2523,6 @@ PluginModuleParent::RecvPluginHideWindow(const uint32_t& aWindowId)
#endif
}
PCrashReporterParent*
PluginModuleParent::AllocPCrashReporterParent(mozilla::dom::NativeThreadId* id,
uint32_t* processType)
{
MOZ_CRASH("unreachable");
}
bool
PluginModuleParent::DeallocPCrashReporterParent(PCrashReporterParent* actor)
{
MOZ_CRASH("unreachable");
}
PCrashReporterParent*
PluginModuleChromeParent::AllocPCrashReporterParent(mozilla::dom::NativeThreadId* id,
uint32_t* processType)
{
return nullptr;
}
bool
PluginModuleChromeParent::DeallocPCrashReporterParent(PCrashReporterParent* actor)
{
delete actor;
return true;
}
bool
PluginModuleParent::RecvSetCursor(const NSCursorInfo& aCursorInfo)
{
-14
View File
@@ -34,7 +34,6 @@ namespace mozilla {
class ProfileGatherer;
#endif
namespace dom {
class PCrashReporterParent;
class CrashReporterParent;
} // namespace dom
@@ -76,7 +75,6 @@ class PluginModuleParent
{
protected:
typedef mozilla::PluginLibrary PluginLibrary;
typedef mozilla::dom::PCrashReporterParent PCrashReporterParent;
typedef mozilla::dom::CrashReporterParent CrashReporterParent;
PPluginInstanceParent*
@@ -158,12 +156,6 @@ protected:
virtual bool
RecvPluginHideWindow(const uint32_t& aWindowId) override;
virtual PCrashReporterParent*
AllocPCrashReporterParent(mozilla::dom::NativeThreadId* id,
uint32_t* processType) override;
virtual bool
DeallocPCrashReporterParent(PCrashReporterParent* actor) override;
virtual bool
RecvSetCursor(const NSCursorInfo& aCursorInfo) override;
@@ -508,12 +500,6 @@ private:
virtual bool ShouldContinueFromReplyTimeout() override;
virtual PCrashReporterParent*
AllocPCrashReporterParent(mozilla::dom::NativeThreadId* id,
uint32_t* processType) override;
virtual bool
DeallocPCrashReporterParent(PCrashReporterParent* actor) override;
PluginProcessParent* Process() const { return mSubprocess; }
base::ProcessHandle ChildProcessHandle() { return mSubprocess->GetChildProcessHandle(); }
+2 -16
View File
@@ -116,7 +116,6 @@ using google_breakpad::PageAllocator;
#endif
using namespace mozilla;
using mozilla::dom::CrashReporterChild;
using mozilla::dom::PCrashReporterChild;
using mozilla::ipc::CrashReporterClient;
namespace CrashReporter {
@@ -2249,13 +2248,7 @@ nsresult AnnotateCrashReport(const nsACString& key, const nsACString& data)
}
MOZ_ASSERT(NS_IsMainThread());
PCrashReporterChild* reporter = CrashReporterChild::GetCrashReporter();
if (!reporter) {
EnqueueDelayedNote(new DelayedNote(key, data));
return NS_OK;
}
if (!reporter->SendAnnotateCrashReport(nsCString(key), escapedData))
return NS_ERROR_FAILURE;
EnqueueDelayedNote(new DelayedNote(key, data));
return NS_OK;
}
@@ -2334,14 +2327,7 @@ nsresult AppendAppNotesToCrashReport(const nsACString& data)
}
MOZ_ASSERT(NS_IsMainThread());
PCrashReporterChild* reporter = CrashReporterChild::GetCrashReporter();
if (!reporter) {
EnqueueDelayedNote(new DelayedNote(data));
return NS_OK;
}
if (!reporter->SendAppendAppNotes(escapedData))
return NS_ERROR_FAILURE;
EnqueueDelayedNote(new DelayedNote(data));
return NS_OK;
}