зеркало из https://github.com/mozilla/gecko-dev.git
Use CrashReporterHost/Client in the GPU process. (bug 1278717 part 3, r=billm)
This commit is contained in:
Родитель
37396f9500
Коммит
43c76f1bba
|
@ -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')
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче