зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1402519 - Remove MOZ_CRASHREPORTER directives from gfx; r=jrmuizel
MozReview-Commit-ID: 7S8AJ18cCx0 --HG-- extra : rebase_source : 983387883dd0feabf8e4e6b1b7335403645470af
This commit is contained in:
Родитель
0750d2d41a
Коммит
9a1d2f50d2
|
@ -6,13 +6,10 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include "nsExceptionHandler.h"
|
||||||
#include "GfxTexturesReporter.h"
|
#include "GfxTexturesReporter.h"
|
||||||
#include "gfxPrefs.h"
|
#include "gfxPrefs.h"
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::gl;
|
using namespace mozilla::gl;
|
||||||
|
|
||||||
|
@ -76,7 +73,5 @@ GfxTexturesReporter::UpdateAmount(MemoryUse action, size_t amount)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporter::AnnotateTexturesSize(sAmount);
|
CrashReporter::AnnotateTexturesSize(sAmount);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,12 +144,11 @@ GPUChild::RecvGraphicsError(const nsCString& aError)
|
||||||
mozilla::ipc::IPCResult
|
mozilla::ipc::IPCResult
|
||||||
GPUChild::RecvInitCrashReporter(Shmem&& aShmem, const NativeThreadId& aThreadId)
|
GPUChild::RecvInitCrashReporter(Shmem&& aShmem, const NativeThreadId& aThreadId)
|
||||||
{
|
{
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
mCrashReporter = MakeUnique<ipc::CrashReporterHost>(
|
mCrashReporter = MakeUnique<ipc::CrashReporterHost>(
|
||||||
GeckoProcessType_GPU,
|
GeckoProcessType_GPU,
|
||||||
aShmem,
|
aShmem,
|
||||||
aThreadId);
|
aThreadId);
|
||||||
#endif
|
|
||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,12 +251,10 @@ void
|
||||||
GPUChild::ActorDestroy(ActorDestroyReason aWhy)
|
GPUChild::ActorDestroy(ActorDestroyReason aWhy)
|
||||||
{
|
{
|
||||||
if (aWhy == AbnormalShutdown) {
|
if (aWhy == AbnormalShutdown) {
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
if (mCrashReporter) {
|
if (mCrashReporter) {
|
||||||
mCrashReporter->GenerateCrashReport(OtherPid());
|
mCrashReporter->GenerateCrashReport(OtherPid());
|
||||||
mCrashReporter = nullptr;
|
mCrashReporter = nullptr;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT,
|
Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT,
|
||||||
nsDependentCString(XRE_ChildProcessTypeToString(GeckoProcessType_GPU)), 1);
|
nsDependentCString(XRE_ChildProcessTypeToString(GeckoProcessType_GPU)), 1);
|
||||||
|
|
|
@ -100,10 +100,8 @@ GPUParent::Init(base::ProcessId aParentPid,
|
||||||
// versions.
|
// versions.
|
||||||
GetIPCChannel()->SendBuildID();
|
GetIPCChannel()->SendBuildID();
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
// Init crash reporter support.
|
// Init crash reporter support.
|
||||||
CrashReporterClient::InitSingleton(this);
|
CrashReporterClient::InitSingleton(this);
|
||||||
#endif
|
|
||||||
|
|
||||||
// Ensure gfxPrefs are initialized.
|
// Ensure gfxPrefs are initialized.
|
||||||
gfxPrefs::GetSingleton();
|
gfxPrefs::GetSingleton();
|
||||||
|
@ -471,9 +469,7 @@ GPUParent::ActorDestroy(ActorDestroyReason aWhy)
|
||||||
gfxVars::Shutdown();
|
gfxVars::Shutdown();
|
||||||
gfxConfig::Shutdown();
|
gfxConfig::Shutdown();
|
||||||
gfxPrefs::DestroySingleton();
|
gfxPrefs::DestroySingleton();
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporterClient::DestroySingleton();
|
CrashReporterClient::DestroySingleton();
|
||||||
#endif
|
|
||||||
XRE_ShutdownChildProcess();
|
XRE_ShutdownChildProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,12 +39,9 @@
|
||||||
#include "mozilla/dom/VideoDecoderManagerChild.h"
|
#include "mozilla/dom/VideoDecoderManagerChild.h"
|
||||||
#include "mozilla/dom/VideoDecoderManagerParent.h"
|
#include "mozilla/dom/VideoDecoderManagerParent.h"
|
||||||
#include "MediaPrefs.h"
|
#include "MediaPrefs.h"
|
||||||
|
#include "nsExceptionHandler.h"
|
||||||
#include "nsPrintfCString.h"
|
#include "nsPrintfCString.h"
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
# include "nsExceptionHandler.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
#if defined(MOZ_WIDGET_ANDROID)
|
||||||
#include "mozilla/widget/AndroidUiThread.h"
|
#include "mozilla/widget/AndroidUiThread.h"
|
||||||
#include "mozilla/layers/UiCompositorControllerChild.h"
|
#include "mozilla/layers/UiCompositorControllerChild.h"
|
||||||
|
@ -368,7 +365,6 @@ GPUProcessManager::OnProcessLaunchComplete(GPUProcessHost* aHost)
|
||||||
mVsyncBridge = VsyncBridgeChild::Create(mVsyncIOThread, mProcessToken, Move(vsyncChild));
|
mVsyncBridge = VsyncBridgeChild::Create(mVsyncIOThread, mProcessToken, Move(vsyncChild));
|
||||||
mGPUChild->SendInitVsyncBridge(Move(vsyncParent));
|
mGPUChild->SendInitVsyncBridge(Move(vsyncParent));
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporter::AnnotateCrashReport(
|
CrashReporter::AnnotateCrashReport(
|
||||||
NS_LITERAL_CSTRING("GPUProcessStatus"),
|
NS_LITERAL_CSTRING("GPUProcessStatus"),
|
||||||
NS_LITERAL_CSTRING("Running"));
|
NS_LITERAL_CSTRING("Running"));
|
||||||
|
@ -376,7 +372,6 @@ GPUProcessManager::OnProcessLaunchComplete(GPUProcessHost* aHost)
|
||||||
CrashReporter::AnnotateCrashReport(
|
CrashReporter::AnnotateCrashReport(
|
||||||
NS_LITERAL_CSTRING("GPUProcessLaunchCount"),
|
NS_LITERAL_CSTRING("GPUProcessLaunchCount"),
|
||||||
nsPrintfCString("%d", mNumProcessAttempts));
|
nsPrintfCString("%d", mNumProcessAttempts));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
@ -717,11 +712,9 @@ GPUProcessManager::DestroyProcess()
|
||||||
mVsyncBridge = nullptr;
|
mVsyncBridge = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporter::AnnotateCrashReport(
|
CrashReporter::AnnotateCrashReport(
|
||||||
NS_LITERAL_CSTRING("GPUProcessStatus"),
|
NS_LITERAL_CSTRING("GPUProcessStatus"),
|
||||||
NS_LITERAL_CSTRING("Destroyed"));
|
NS_LITERAL_CSTRING("Destroyed"));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<CompositorSession>
|
already_AddRefed<CompositorSession>
|
||||||
|
|
|
@ -9,9 +9,7 @@
|
||||||
#include "gfxConfig.h"
|
#include "gfxConfig.h"
|
||||||
#include "nsAppDirectoryServiceDefs.h"
|
#include "nsAppDirectoryServiceDefs.h"
|
||||||
#include "nsDirectoryServiceUtils.h"
|
#include "nsDirectoryServiceUtils.h"
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
#endif
|
|
||||||
#include "nsServiceManagerUtils.h"
|
#include "nsServiceManagerUtils.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include "nsXULAppAPI.h"
|
#include "nsXULAppAPI.h"
|
||||||
|
@ -167,11 +165,9 @@ DriverCrashGuard::~DriverCrashGuard()
|
||||||
dom::ContentChild::GetSingleton()->SendEndDriverCrashGuard(uint32_t(mType));
|
dom::ContentChild::GetSingleton()->SendEndDriverCrashGuard(uint32_t(mType));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
// Remove the crash report annotation.
|
// Remove the crash report annotation.
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("GraphicsStartupTest"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("GraphicsStartupTest"),
|
||||||
NS_LITERAL_CSTRING(""));
|
NS_LITERAL_CSTRING(""));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -210,7 +206,6 @@ DriverCrashGuard::ActivateGuard()
|
||||||
{
|
{
|
||||||
mGuardActivated = true;
|
mGuardActivated = true;
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
// Anotate crash reports only if we're a real guard. Otherwise, we could
|
// Anotate crash reports only if we're a real guard. Otherwise, we could
|
||||||
// attribute a random parent process crash to a graphics problem in a child
|
// attribute a random parent process crash to a graphics problem in a child
|
||||||
// process.
|
// process.
|
||||||
|
@ -218,7 +213,6 @@ DriverCrashGuard::ActivateGuard()
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("GraphicsStartupTest"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("GraphicsStartupTest"),
|
||||||
NS_LITERAL_CSTRING("1"));
|
NS_LITERAL_CSTRING("1"));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// If we're in the content process, the rest of the guarding is handled
|
// If we're in the content process, the rest of the guarding is handled
|
||||||
// in the parent.
|
// in the parent.
|
||||||
|
|
|
@ -5,13 +5,6 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "gfxCrashReporterUtils.h"
|
#include "gfxCrashReporterUtils.h"
|
||||||
|
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
#define MOZ_GFXFEATUREREPORTER 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MOZ_GFXFEATUREREPORTER
|
|
||||||
#include "gfxCrashReporterUtils.h"
|
|
||||||
#include <string.h> // for strcmp
|
#include <string.h> // for strcmp
|
||||||
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
|
||||||
#include "mozilla/Services.h" // for GetObserverService
|
#include "mozilla/Services.h" // for GetObserverService
|
||||||
|
@ -137,13 +130,3 @@ ScopedGfxFeatureReporter::AppNote(const nsACString& aMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace mozilla
|
} // end namespace mozilla
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
namespace mozilla {
|
|
||||||
void ScopedGfxFeatureReporter::WriteAppNote(char) {}
|
|
||||||
void ScopedGfxFeatureReporter::AppNote(const nsACString&) {}
|
|
||||||
|
|
||||||
} // namespace mozilla
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -81,7 +81,6 @@ TEST(GfxPrefs, Set) {
|
||||||
ASSERT_TRUE(gfxPrefs::APZMaxVelocity() == -1.0f);
|
ASSERT_TRUE(gfxPrefs::APZMaxVelocity() == -1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
// Randomly test the function we use in nsExceptionHandler.cpp here:
|
// Randomly test the function we use in nsExceptionHandler.cpp here:
|
||||||
extern bool SimpleNoCLibDtoA(double aValue, char* aBuffer, int aBufferLength);
|
extern bool SimpleNoCLibDtoA(double aValue, char* aBuffer, int aBufferLength);
|
||||||
TEST(GfxPrefs, StringUtility)
|
TEST(GfxPrefs, StringUtility)
|
||||||
|
@ -104,4 +103,3 @@ TEST(GfxPrefs, StringUtility)
|
||||||
// It won't fit into 32:
|
// It won't fit into 32:
|
||||||
ASSERT_FALSE(SimpleNoCLibDtoA(testVal[4], testBuffer, sizeof(testBuffer)/2));
|
ASSERT_FALSE(SimpleNoCLibDtoA(testVal[4], testBuffer, sizeof(testBuffer)/2));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
|
@ -21,16 +21,13 @@
|
||||||
#include "mozilla/layers/DeviceAttachmentsD3D11.h"
|
#include "mozilla/layers/DeviceAttachmentsD3D11.h"
|
||||||
#include "mozilla/layers/MLGDeviceD3D11.h"
|
#include "mozilla/layers/MLGDeviceD3D11.h"
|
||||||
#include "mozilla/layers/PaintThread.h"
|
#include "mozilla/layers/PaintThread.h"
|
||||||
|
#include "nsExceptionHandler.h"
|
||||||
#include "nsIGfxInfo.h"
|
#include "nsIGfxInfo.h"
|
||||||
|
#include "nsPrintfCString.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include <d3d11.h>
|
#include <d3d11.h>
|
||||||
#include <ddraw.h>
|
#include <ddraw.h>
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
|
||||||
#include "nsPrintfCString.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace gfx {
|
namespace gfx {
|
||||||
|
|
||||||
|
@ -772,12 +769,10 @@ DeviceManagerDx::MaybeResetAndReacquireDevices()
|
||||||
Telemetry::Accumulate(Telemetry::DEVICE_RESET_REASON, uint32_t(resetReason));
|
Telemetry::Accumulate(Telemetry::DEVICE_RESET_REASON, uint32_t(resetReason));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
nsPrintfCString reasonString("%d", int(resetReason));
|
nsPrintfCString reasonString("%d", int(resetReason));
|
||||||
CrashReporter::AnnotateCrashReport(
|
CrashReporter::AnnotateCrashReport(
|
||||||
NS_LITERAL_CSTRING("DeviceResetReason"),
|
NS_LITERAL_CSTRING("DeviceResetReason"),
|
||||||
reasonString);
|
reasonString);
|
||||||
#endif
|
|
||||||
|
|
||||||
bool createCompositorDevice = !!mCompositorDevice;
|
bool createCompositorDevice = !!mCompositorDevice;
|
||||||
bool createContentDevice = !!mContentDevice;
|
bool createContentDevice = !!mContentDevice;
|
||||||
|
|
|
@ -70,6 +70,7 @@
|
||||||
#include "gfxGradientCache.h"
|
#include "gfxGradientCache.h"
|
||||||
#include "gfxUtils.h" // for NextPowerOfTwo
|
#include "gfxUtils.h" // for NextPowerOfTwo
|
||||||
|
|
||||||
|
#include "nsExceptionHandler.h"
|
||||||
#include "nsUnicodeRange.h"
|
#include "nsUnicodeRange.h"
|
||||||
#include "nsServiceManagerUtils.h"
|
#include "nsServiceManagerUtils.h"
|
||||||
#include "nsTArray.h"
|
#include "nsTArray.h"
|
||||||
|
@ -77,9 +78,6 @@
|
||||||
#include "nsIScreenManager.h"
|
#include "nsIScreenManager.h"
|
||||||
#include "FrameMetrics.h"
|
#include "FrameMetrics.h"
|
||||||
#include "MainThreadUtils.h"
|
#include "MainThreadUtils.h"
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "nsWeakReference.h"
|
#include "nsWeakReference.h"
|
||||||
|
|
||||||
|
@ -298,12 +296,9 @@ void CrashStatsLogForwarder::UpdateCrashReport()
|
||||||
message << logAnnotation << Get<0>(it) << "]" << Get<1>(it) << " (t=" << Get<2>(it) << ") ";
|
message << logAnnotation << Get<0>(it) << "]" << Get<1>(it) << " (t=" << Get<2>(it) << ") ";
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
nsCString reportString(message.str().c_str());
|
nsCString reportString(message.str().c_str());
|
||||||
nsresult annotated = CrashReporter::AnnotateCrashReport(mCrashCriticalKey, reportString);
|
nsresult annotated = CrashReporter::AnnotateCrashReport(mCrashCriticalKey, reportString);
|
||||||
#else
|
|
||||||
nsresult annotated = NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
#endif
|
|
||||||
if (annotated != NS_OK) {
|
if (annotated != NS_OK) {
|
||||||
printf("Crash Annotation %s: %s",
|
printf("Crash Annotation %s: %s",
|
||||||
mCrashCriticalKey.get(), message.str().c_str());
|
mCrashCriticalKey.get(), message.str().c_str());
|
||||||
|
|
Загрузка…
Ссылка в новой задаче