Use CrashReporterHost/Client in the GPU process. (bug 1278717 part 3, r=billm)

This commit is contained in:
David Anderson 2016-10-11 14:25:41 -07:00
Родитель 37396f9500
Коммит 43c76f1bba
6 изменённых файлов: 41 добавлений и 1 удалений

Просмотреть файл

@ -144,6 +144,7 @@ LOCAL_INCLUDES += [
'/layout/base',
'/media/webrtc',
'/netwerk/base',
'/toolkit/crashreporter',
'/toolkit/xre',
'/uriloader/exthandler',
'/widget',

Просмотреть файл

@ -12,6 +12,7 @@
#if defined(XP_WIN)
# include "mozilla/gfx/DeviceManagerDx.h"
#endif
#include "mozilla/ipc/CrashReporterHost.h"
namespace mozilla {
namespace gfx {
@ -113,9 +114,27 @@ GPUChild::RecvGraphicsError(const nsCString& aError)
return true;
}
bool
GPUChild::RecvInitCrashReporter(Shmem&& aShmem)
{
#ifdef MOZ_CRASHREPORTER
mCrashReporter = MakeUnique<ipc::CrashReporterHost>(GeckoProcessType_GPU, aShmem);
#endif
return true;
}
void
GPUChild::ActorDestroy(ActorDestroyReason aWhy)
{
if (aWhy == AbnormalShutdown) {
#ifdef MOZ_CRASHREPORTER
if (mCrashReporter) {
mCrashReporter->GenerateCrashReport(OtherPid());
mCrashReporter = nullptr;
}
#endif
}
gfxVars::RemoveReceiver(this);
mHost->OnChannelClosed();
}

Просмотреть файл

@ -12,6 +12,9 @@
#include "mozilla/gfx/gfxVarReceiver.h"
namespace mozilla {
namespace ipc {
class CrashReporterHost;
} // namespace
namespace gfx {
class GPUProcessHost;
@ -34,6 +37,7 @@ public:
// PGPUChild overrides.
bool RecvInitComplete(const GPUDeviceData& aData) override;
bool RecvReportCheckerboard(const uint32_t& aSeverity, const nsCString& aLog) override;
bool RecvInitCrashReporter(Shmem&& shmem) override;
void ActorDestroy(ActorDestroyReason aWhy) override;
bool RecvGraphicsError(const nsCString& aError) override;
@ -41,6 +45,7 @@ public:
private:
GPUProcessHost* mHost;
UniquePtr<ipc::CrashReporterHost> mCrashReporter;
bool mGPUReady;
};

Просмотреть файл

@ -13,6 +13,7 @@
#include "GPUProcessHost.h"
#include "mozilla/Assertions.h"
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/ipc/CrashReporterClient.h"
#include "mozilla/ipc/ProcessChild.h"
#include "mozilla/layers/APZThreadUtils.h"
#include "mozilla/layers/APZCTreeManager.h"
@ -27,6 +28,7 @@
#include "VRManager.h"
#include "VRManagerParent.h"
#include "VsyncBridgeParent.h"
#include "nsExceptionHandler.h"
#if defined(XP_WIN)
# include "DeviceManagerD3D9.h"
# include "mozilla/gfx/DeviceManagerDx.h"
@ -70,6 +72,11 @@ GPUParent::Init(base::ProcessId aParentPid,
nsDebugImpl::SetMultiprocessMode("GPU");
#ifdef MOZ_CRASHREPORTER
// Init crash reporter support.
CrashReporterClient::InitSingleton(this);
#endif
// Ensure gfxPrefs are initialized.
gfxPrefs::GetSingleton();
gfxConfig::Init();
@ -320,6 +327,9 @@ GPUParent::ActorDestroy(ActorDestroyReason aWhy)
gfxVars::Shutdown();
gfxConfig::Shutdown();
gfxPrefs::DestroySingleton();
#ifdef MOZ_CRASHREPORTER
CrashReporterClient::DestroySingleton();
#endif
NS_ShutdownXPCOM(nullptr);
XRE_ShutdownChildProcess();
}

Просмотреть файл

@ -78,6 +78,8 @@ child:
// Graphics errors, analogous to PContent::GraphicsError
async GraphicsError(nsCString aError);
async InitCrashReporter(Shmem shmem);
};
} // namespace gfx

Просмотреть файл

@ -68,7 +68,10 @@ IPDL_SOURCES = [
'PVsyncBridge.ipdl',
]
LOCAL_INCLUDES += ['/dom/ipc']
LOCAL_INCLUDES += [
'/dom/ipc',
'/toolkit/crashreporter',
]
include('/ipc/chromium/chromium-config.mozbuild')