Bug 1402519 - Remove MOZ_CRASHREPORTER directives from gfx; r=jrmuizel

MozReview-Commit-ID: 7S8AJ18cCx0

--HG--
extra : rebase_source : 983387883dd0feabf8e4e6b1b7335403645470af
This commit is contained in:
Gabriele Svelto 2017-10-10 15:11:07 +02:00
Родитель 0750d2d41a
Коммит 9a1d2f50d2
9 изменённых файлов: 7 добавлений и 61 удалений

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

@ -6,13 +6,10 @@
#include <string>
#include <sstream>
#include "nsExceptionHandler.h"
#include "GfxTexturesReporter.h"
#include "gfxPrefs.h"
#ifdef MOZ_CRASHREPORTER
#include "nsExceptionHandler.h"
#endif
using namespace mozilla;
using namespace mozilla::gl;
@ -76,7 +73,5 @@ GfxTexturesReporter::UpdateAmount(MemoryUse action, size_t amount)
}
}
#ifdef MOZ_CRASHREPORTER
CrashReporter::AnnotateTexturesSize(sAmount);
#endif
}

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

@ -144,12 +144,11 @@ GPUChild::RecvGraphicsError(const nsCString& aError)
mozilla::ipc::IPCResult
GPUChild::RecvInitCrashReporter(Shmem&& aShmem, const NativeThreadId& aThreadId)
{
#ifdef MOZ_CRASHREPORTER
mCrashReporter = MakeUnique<ipc::CrashReporterHost>(
GeckoProcessType_GPU,
aShmem,
aThreadId);
#endif
return IPC_OK();
}
@ -252,12 +251,10 @@ void
GPUChild::ActorDestroy(ActorDestroyReason aWhy)
{
if (aWhy == AbnormalShutdown) {
#ifdef MOZ_CRASHREPORTER
if (mCrashReporter) {
mCrashReporter->GenerateCrashReport(OtherPid());
mCrashReporter = nullptr;
}
#endif
Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT,
nsDependentCString(XRE_ChildProcessTypeToString(GeckoProcessType_GPU)), 1);

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

@ -100,10 +100,8 @@ GPUParent::Init(base::ProcessId aParentPid,
// versions.
GetIPCChannel()->SendBuildID();
#ifdef MOZ_CRASHREPORTER
// Init crash reporter support.
CrashReporterClient::InitSingleton(this);
#endif
// Ensure gfxPrefs are initialized.
gfxPrefs::GetSingleton();
@ -471,9 +469,7 @@ GPUParent::ActorDestroy(ActorDestroyReason aWhy)
gfxVars::Shutdown();
gfxConfig::Shutdown();
gfxPrefs::DestroySingleton();
#ifdef MOZ_CRASHREPORTER
CrashReporterClient::DestroySingleton();
#endif
XRE_ShutdownChildProcess();
}

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

@ -39,12 +39,9 @@
#include "mozilla/dom/VideoDecoderManagerChild.h"
#include "mozilla/dom/VideoDecoderManagerParent.h"
#include "MediaPrefs.h"
#include "nsExceptionHandler.h"
#include "nsPrintfCString.h"
#ifdef MOZ_CRASHREPORTER
# include "nsExceptionHandler.h"
#endif
#if defined(MOZ_WIDGET_ANDROID)
#include "mozilla/widget/AndroidUiThread.h"
#include "mozilla/layers/UiCompositorControllerChild.h"
@ -368,7 +365,6 @@ GPUProcessManager::OnProcessLaunchComplete(GPUProcessHost* aHost)
mVsyncBridge = VsyncBridgeChild::Create(mVsyncIOThread, mProcessToken, Move(vsyncChild));
mGPUChild->SendInitVsyncBridge(Move(vsyncParent));
#ifdef MOZ_CRASHREPORTER
CrashReporter::AnnotateCrashReport(
NS_LITERAL_CSTRING("GPUProcessStatus"),
NS_LITERAL_CSTRING("Running"));
@ -376,7 +372,6 @@ GPUProcessManager::OnProcessLaunchComplete(GPUProcessHost* aHost)
CrashReporter::AnnotateCrashReport(
NS_LITERAL_CSTRING("GPUProcessLaunchCount"),
nsPrintfCString("%d", mNumProcessAttempts));
#endif
}
static bool
@ -717,11 +712,9 @@ GPUProcessManager::DestroyProcess()
mVsyncBridge = nullptr;
}
#ifdef MOZ_CRASHREPORTER
CrashReporter::AnnotateCrashReport(
NS_LITERAL_CSTRING("GPUProcessStatus"),
NS_LITERAL_CSTRING("Destroyed"));
#endif
}
already_AddRefed<CompositorSession>

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

@ -9,9 +9,7 @@
#include "gfxConfig.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsDirectoryServiceUtils.h"
#ifdef MOZ_CRASHREPORTER
#include "nsExceptionHandler.h"
#endif
#include "nsServiceManagerUtils.h"
#include "nsString.h"
#include "nsXULAppAPI.h"
@ -167,11 +165,9 @@ DriverCrashGuard::~DriverCrashGuard()
dom::ContentChild::GetSingleton()->SendEndDriverCrashGuard(uint32_t(mType));
}
#ifdef MOZ_CRASHREPORTER
// Remove the crash report annotation.
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("GraphicsStartupTest"),
NS_LITERAL_CSTRING(""));
#endif
}
bool
@ -210,7 +206,6 @@ DriverCrashGuard::ActivateGuard()
{
mGuardActivated = true;
#ifdef MOZ_CRASHREPORTER
// 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
// process.
@ -218,7 +213,6 @@ DriverCrashGuard::ActivateGuard()
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("GraphicsStartupTest"),
NS_LITERAL_CSTRING("1"));
}
#endif
// If we're in the content process, the rest of the guarding is handled
// in the parent.

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

@ -5,13 +5,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "gfxCrashReporterUtils.h"
#if defined(MOZ_CRASHREPORTER)
#define MOZ_GFXFEATUREREPORTER 1
#endif
#ifdef MOZ_GFXFEATUREREPORTER
#include "gfxCrashReporterUtils.h"
#include <string.h> // for strcmp
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
#include "mozilla/Services.h" // for GetObserverService
@ -137,13 +130,3 @@ ScopedGfxFeatureReporter::AppNote(const nsACString& aMessage)
}
} // 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);
}
#ifdef MOZ_CRASHREPORTER
// Randomly test the function we use in nsExceptionHandler.cpp here:
extern bool SimpleNoCLibDtoA(double aValue, char* aBuffer, int aBufferLength);
TEST(GfxPrefs, StringUtility)
@ -104,4 +103,3 @@ TEST(GfxPrefs, StringUtility)
// It won't fit into 32:
ASSERT_FALSE(SimpleNoCLibDtoA(testVal[4], testBuffer, sizeof(testBuffer)/2));
}
#endif

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

@ -21,16 +21,13 @@
#include "mozilla/layers/DeviceAttachmentsD3D11.h"
#include "mozilla/layers/MLGDeviceD3D11.h"
#include "mozilla/layers/PaintThread.h"
#include "nsExceptionHandler.h"
#include "nsIGfxInfo.h"
#include "nsPrintfCString.h"
#include "nsString.h"
#include <d3d11.h>
#include <ddraw.h>
#ifdef MOZ_CRASHREPORTER
#include "nsExceptionHandler.h"
#include "nsPrintfCString.h"
#endif
namespace mozilla {
namespace gfx {
@ -772,12 +769,10 @@ DeviceManagerDx::MaybeResetAndReacquireDevices()
Telemetry::Accumulate(Telemetry::DEVICE_RESET_REASON, uint32_t(resetReason));
}
#ifdef MOZ_CRASHREPORTER
nsPrintfCString reasonString("%d", int(resetReason));
CrashReporter::AnnotateCrashReport(
NS_LITERAL_CSTRING("DeviceResetReason"),
reasonString);
#endif
bool createCompositorDevice = !!mCompositorDevice;
bool createContentDevice = !!mContentDevice;

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

@ -70,6 +70,7 @@
#include "gfxGradientCache.h"
#include "gfxUtils.h" // for NextPowerOfTwo
#include "nsExceptionHandler.h"
#include "nsUnicodeRange.h"
#include "nsServiceManagerUtils.h"
#include "nsTArray.h"
@ -77,9 +78,6 @@
#include "nsIScreenManager.h"
#include "FrameMetrics.h"
#include "MainThreadUtils.h"
#ifdef MOZ_CRASHREPORTER
#include "nsExceptionHandler.h"
#endif
#include "nsWeakReference.h"
@ -298,12 +296,9 @@ void CrashStatsLogForwarder::UpdateCrashReport()
message << logAnnotation << Get<0>(it) << "]" << Get<1>(it) << " (t=" << Get<2>(it) << ") ";
}
#ifdef MOZ_CRASHREPORTER
nsCString reportString(message.str().c_str());
nsresult annotated = CrashReporter::AnnotateCrashReport(mCrashCriticalKey, reportString);
#else
nsresult annotated = NS_ERROR_NOT_IMPLEMENTED;
#endif
if (annotated != NS_OK) {
printf("Crash Annotation %s: %s",
mCrashCriticalKey.get(), message.str().c_str());